问题
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:
- Downloading the "android_m2repository_r22.zip" at "https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip"
- 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.
- Then extract the contents of that zip file into the "content" folder.
- Clean your project
- Build
Hope this helps.
来源:https://stackoverflow.com/questions/31921110/xamarin-classes-not-found-android-support-library