MAVEN Invalid SDK: Platform/API level 16 not available

前端 未结 1 424
死守一世寂寞
死守一世寂寞 2020-12-11 05:48

I have a working android app on my Android Studio (windows) and I am trying to create an apklib with MAVEN for the project.

When I run compile on MAVEN (3.0.5) I get

相关标签:
1条回答
  • 2020-12-11 06:44

    ---EDIT---

    There was also an error because I had my settings.xml set to the incorrect android SDK home path. I updated my ~/.m2/settings.xml file to the correct SDK path and set my $ANDROID_HOME variable to the correct path and this was fixed.


    I was able to get past this error with the following changes:

    1. Update to maven 3.1.1
    2. in my pom.xml I changed

    <plugin> <groupId> com.jayway.maven.plugins.android.generation2 </groupId> <artifactId>android-maven-plugin</artifactId> <version>3.7.0</version> </plugin>

    To: <plugin> <groupId>com.jayway.maven.plugins.android.generation2</groupId> <artifactId>android-maven-plugin</artifactId> <version>3.8.1</version> <configuration> <sdk> <platform>19</platform> </sdk> </configuration> </plugin>
    (note this change both updates to the latests plugin version (3.8.1) and specifies the platform for the sdk)

    1. I ran $PATH_TO_YOUR_ANDROID_SDK/android update sdk --no-ui --all --force

    2. I deleted my ~/.m2 directory

    3. I ran mvn clean install and everything worked

    0 讨论(0)
提交回复
热议问题