Forum Xamarin.Android

App Center: error XA0000: Could not determine API level for $(TargetFrameworkVersion) of 'v8.1'

kavokuappskavokuapps Member ✭✭
edited February 2020 in Xamarin.Android

Hi,

I am trying to build my Android App (Xamarin Forms 4.4) using App Center: this is the error I am getting:

error XA0000: Could not determine API level for $(TargetFrameworkVersion) of 'v8.1'

When I setup the build, I don't find listed version 8.1.. only 8.1.5 -- I am wondering what I am doing wrong?

In Project properties on Visual Studio I have set as target Android: v8.1 (API Level 27)

Additional to that, I added:
AndroidUseLatestPlatformSdk as False

in each of the csproj Property groups, as suggested in many forums.

Any help is much appreciated.

Best Answer

Answers

  • kavokuappskavokuapps Member ✭✭

    @Jarvan thank you for taking the time to answer my question. Now, I am getting this error:

    "/Users/runner/runners/2.165.0/work/1/s//.Android/.Android.csproj" (PackageForAndroid target) (1) ->
    (_ValidateAndroidPackageProperties target) ->
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(582,2): error : Could not find android.jar for API Level . This means the Android SDK platform for API Level 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/runner/Library/Android/sdk/platforms/android-/android.jar missing.) [/Users/runner/runners/2.165.0/work/1/s/
    /.Android/.Android.csproj]

    this is my project definition, I guess it can help:

    <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
        <ProjectGuid>{24CE3C36-16B9-426D-AA0C-5461ECF8D88C}</ProjectGuid>
        <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF44-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
        <TemplateGuid>{9AA2D3C6-3393-45F1-8E7C-5A4401728795}</TemplateGuid>
        <OutputType>Library</OutputType>
        <RootNamespace>Sekure.Droid</RootNamespace>
        <AssemblyName>Sekure.Android</AssemblyName>
        <AndroidApplication>True</AndroidApplication>
        <AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
        <AndroidResgenClass>Resource</AndroidResgenClass>
        <AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
        <MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
        <MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
        <AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
        <TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
        <AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
        <NuGetPackageImportStamp>
        </NuGetPackageImportStamp>
        <AndroidKeyStore>false</AndroidKeyStore>
        <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
        <AndroidSupportedAbis>armeabi-v7a;arm64-v8a</AndroidSupportedAbis>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <DebugSymbols>true</DebugSymbols>
        <DebugType>portable</DebugType>
        <Optimize>false</Optimize>
        <OutputPath>bin\Debug</OutputPath>
        <DefineConstants>DEBUG;</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <AndroidLinkMode>None</AndroidLinkMode>
        <AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
        <TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
        <MandroidI18n />
        <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
        <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
        <AndroidSupportedAbis />
        <AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <DebugSymbols>false</DebugSymbols>
        <DebugType>pdbonly</DebugType>
        <Optimize>true</Optimize>
        <OutputPath>bin\Release</OutputPath>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
        <TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
        <AndroidManagedSymbols>true</AndroidManagedSymbols>
        <AndroidLinkTool>proguard</AndroidLinkTool>
        <AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
        <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
        <AotAssemblies>false</AotAssemblies>
        <EnableLLVM>false</EnableLLVM>
        <BundleAssemblies>false</BundleAssemblies>
      </PropertyGroup>
      <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
    </Project>
    
  • YelinzhYelinzh Member, Xamarin Team Xamurai

    If youve sovled the issue, please mark the solution as the answer. It'll help others who face the similar problem.

Sign In or Register to comment.