问题
I received a project from another developer. I setup my machine. VS-2017 with the required components was already configured.
Android SDK-Manager has the corresponding version installed. Project is configured to compile with Android 7.1 (Nougat).
Starting the build I get one error
1>ERROR : error APT0000: In <declare-styleable> AppBarLayout, unable to find attribute android:keyboardNavigationCluster
It is unclear to me, were I need to set this information, or were this information is needed.
I rececked ERROR: In MenuView, unable to find attribute android:preserveIconSpacing and Error:In SherlockSpinner, unable to find attribute android:popupPromptView. Both articles don't help.
I rechecked the SDK-Tools, I deleted the folder C:\Users\<user>\AppData\Local\Xamarin.
As far as I understand the message there is an attribute missing, that needs to be set.
In a project file Resource.designer.cs I found
public const int AppBarLayout_android_keyboardNavigationCluster = 2;
The name seams to match exactly.
Can someone explain me this error?
Can someone explain how I get rid of it and how to fix similar problems in future?
回答1:
I had this error and after some research I just installed the Android OREO 8.0 SDK in the Android SDK Manager and than I select Android Project > Properties > Application > Use latest Platform (Android 8.0 (Oreo)). And it worked for me.
回答2:
I fixed it by setting the Target Android Version to API Level 26.
回答3:
You have to update the target of your project, It seems that the solution was created with a higher target (Oreo API Level 26)
回答4:
Thsi is what I did, I don't know what of the steps fixed the problems.
- Uninstalled all Android SDKs with the SDK manager
- Uninstalled the Xamarin components.
1.+2. Was done by uninstalling the App-Development features from VS-2017
- Install Xamarin and current SDKs.
After this I was able to select "Use latest platform (Android 8.0 Oreo)" in the Android project section in the Solution.
This wasn't possible before. I just could select "Android 7.1 (Nougat)" and 8.0 didn't showed up (but was installed). Now the error is gone.
回答5:
In my case I'd moved from Enterprise to Professional and found that there was a mismatch in the Xamarin options (Tools -> Options -> Xamarin) and the android SDK location needed to be changed to "C:\Users\YourMum\AppData\Local\Android\android-sdk".
Can't remember exactly what it was originally but think it was in Programs.
来源:https://stackoverflow.com/questions/46974003/xamarin-build-error-error-apt0000-in-declare-styleable-unable-to-find