Android with maven? Apk unknown

后端 未结 5 1018
隐瞒了意图╮
隐瞒了意图╮ 2020-12-06 02:13

Cannot get Android to work with maven. What could be the problem (generated from maven quickstart archetype):



        
相关标签:
5条回答
  • 2020-12-06 02:18

    Add extensions option to your android-maven-plugin configuration.

    extensions

    Whether to load Maven extensions (such as packaging and type handlers) from this plugin.

    Sample configuration:

    <plugin>
        <groupId>com.jayway.maven.plugins.android.generation2</groupId>
        <artifactId>android-maven-plugin</artifactId>
        <version>3.9.0-rc.2</version>
        <extensions>true</extensions>
        <configuration>
            <sdk>
                <platform>${android.platform}</platform>
            </sdk>
        </configuration>
    </plugin>
    

    This solves probem with apk unknown packaging.

    0 讨论(0)
  • 2020-12-06 02:21

    I had same problem because I had android plugin added in <build><pluginManagement> section of configuration.

    Moving it to <build><plugins> solved my issue.

    0 讨论(0)
  • 2020-12-06 02:28

    I am currently using android-maven-plugin 3.1.1 for my project and give it a try with 3.2.0, It looks like Maven has some trouble downloading one of the required dependencies emma-2.1.5320.jar from Maven Central Repository, however, I have tired mvn clean install several times and finally get emma-2.1.5320.jar downloaded.

    Try running mvn clean install several times, if it still doesn't work, download and install it manually, emma-2.1.5320.jar with source and javadoc are available on Maven Central Repository:

    mvn install:install-file -Dfile=emma-2.1.5320.jar \
                         -Dsources=emma-2.1.5320-sources.jar \
                         -Djavadoc=emma-2.1.5320-javadoc.jar \
                         -DgroupId=emma \
                         -DartifactId=emma \
                         -Dversion=2.1.5320 \
                         -Dpackaging=jar
    

    You should be able to use android-maven-plugin 3.2.0 now, hope this helps.

    0 讨论(0)
  • 2020-12-06 02:29

    Replace the <version>3.2.0</version> with <version>3.6.0</version> and then clean and then install the package. 3.6.0 is the latest version of android-maven-plugin.

    0 讨论(0)
  • You have installed the "normal" Maven plugin that works for Java projects (and .jar files). For Android you need the Maven Android Plugin

    Have a look in to this

    Error in pom file in Maven project after importing into Eclipse

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