Bug 26897 - Cant compile .apk though api level is set correctly (API level 19)
Summary: Cant compile .apk though api level is set correctly (API level 19)
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 5.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2015-02-10 02:03 UTC by lasse.alfastsen
Modified: 2017-09-12 18:22 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description lasse.alfastsen 2015-02-10 02:03:49 UTC
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(3,3): Error XA0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com. Reason: Could not find SDK platform directory 'C:\Users\Lasse\AppData\Local\Android\android-sdk\platforms\android-14'.  Are --sdk-dir and --sdk-version set appropriately? (XA0000) (AndroidBeamDemo)
Comment 1 Jonathan Pryor 2015-02-19 14:37:40 UTC
$(TargetFrameworkVersion) is not the only relevant API level value. What is also used is the //uses-sdk/@android:targetSdkVersion attribute value within AndroidManifest.xml, which -- if present -- overrides the $(TargetFrameworkVersion) value when building the .apk, so that e.g. Android resources can be found.

Occasionally the targetSdkVersion attribute will need to be set, e.g. Google Play Services often requires targetSdkVersion be set to the latest-and-greatest to make use of new Android resources, while you will often instead want $(TargetFrameworkVersion) to match your minSdkVersion (to ensure your app runs on your minimum supported target).

Please check your Properties\AndroidManifest.xml file and ensure it isn't setting targetSdkVersion to 14.
Comment 2 Jon Douglas [MSFT] 2017-09-12 18:22:39 UTC
Marking this RESOLVED ANSWERED due to comments in https://bugzilla.xamarin.com/show_bug.cgi?id=26897#c1

Please feel free to reopen this bug if this is still an issue.