Xamarin — Error: Could not find android.jar for API Level 25
Welcoming the Xamarin with hard effort!
Annoying Bugs encountered me. For those using Visual Studio 2017 for macOS to develop (Xamarin) App, might scratching their heads off.
Here’s the error messages:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2,2): Error: Could not find android.jar for API Level 25. This means the Android SDK platform for API Level 25 is not installed. Either install it in the Android SDK Manager (Tools > Open Android SDK Manager…), or change your Xamarin.Android project to target an API version that is installed. (/Users/[youruser]/Library/Android/sdk/platforms/android-25/android.jar missing.) (Modul4.Droid)
What I did so far (unfortunately, it only exist for Windows version).
This happens when you target your project to a non-installed Android SDK platform, to fix this you have to install the…danielarancibia.wordpress.com
Support for Android 5.0 API Level 21 has just been promoted to the stable channel: Windows: Xamarin 3.8.150 Mac…forums.xamarin.com
The fix is somewhat disappointed me. I can say myself this is considered as “hotfix” and it’s not recommended.
Here we go:
- Find and locate android.jar on your old SDK (e.g: android-23)
- Copy and paste into your android-25 directory
- Clean solution
- Voila, now you can debug your apps on Android seamlessly!
- Genymotion, I use this as my emulator target
- Android SDK 25.1.7, you might wanna download this, there’s a bug here on Visual Studio (aka Xamarin Studio) that check specific SDK version.
- Visual Studio 2017 for macOS
If you ask me why bother using yet “unstable” version of Visual Studio on macOS?
The answer is, I don’t have any reason to migrate yet. XD
Looks like there’s a corrupt SDK for my level 25. When I looked into my friends laptop, the android-25 contains android.jar. Another approach is re-downloading the SDK just for API Level 25.