Xamarin - Classes not found (android support library)

旧巷老猫 提交于 2019-12-07 14:32:48

问题


I'm trying to implement Material Design with backward compatibility using AppCompat.

Following the tutorial.

But I'm getting the following error

Error 1 error: package android.support.v4.app.FragmentManager does not exist android.support.v4.app.FragmentManager.OnBackStackChangedListener C:\Users\Italo\Documents\Xamarin\TemaMaterial\TemaMaterial\obj\Debug\android\src\mono\android\support\v4\app\FragmentManager_OnBackStackChangedListenerImplementor.java 8 41 TemaMaterial Error 2 error: package android.support.v4.content.Loader does not exist android.support.v4.content.Loader.OnLoadCompleteListener C:\Users\Italo\Documents\Xamarin\TemaMaterial\TemaMaterial\obj\Debug\android\src\mono\android\support\v4\content\Loader_OnLoadCompleteListenerImplementor.java 8 36 TemaMaterial Error 3 error: package android.support.v4.content does not exist public void onLoadComplete (android.support.v4.content.Loader p0, java.lang.Object p1) C:\Users\Italo\Documents\Xamarin\TemaMaterial\TemaMaterial\obj\Debug\android\src\mono\android\support\v4\content\Loader_OnLoadCompleteListenerImplementor.java 27 56 TemaMaterial

It says that the package does not existe, but it exists. I still can't add images, so, here is the link


回答1:


Apparently the problem occur because the zip file android_m2repository_r14 is corrupted. So is necessary download manually and unzip at %localappdata%\Xamarin\Android.Support.v4 and %localappdata%\Xamarin\Android.Support.v7.AppCompat folders

I also installed Google APIs and Sources for Android SDK




回答2:


I had a similar issue to yours and resolved it by:

  1. Downloading the "android_m2repository_r22.zip" at "https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip"
  2. Create a folder called "content" in the directory "C:\Users\Javaad\AppData\Local\Xamarin\Xamarin.Android.Support.v4\23.0.1.3", yours will have a different user name.
  3. Then extract the contents of that zip file into the "content" folder.
  4. Clean your project
  5. Build

Hope this helps.



来源:https://stackoverflow.com/questions/31921110/xamarin-classes-not-found-android-support-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!