问题一:
当前maven版本为3.0.5
oid-maven-plugin:3.5.3:generate-sources (default-generate-sources) on project zh
e800: Execution default-generate-sources of goal com.jayway.maven.plugins.androi
d.generation2:android-maven-plugin:3.5.3:generate-sources failed: Could not find
tool 'aapt'. Please provide a proper Android SDK directory path as configuratio
n parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an al
ternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or s
et environment variable ANDROID_HOME. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.aaa.ccc</groupId>
<artifactId>bbb</artifactId>
<version>1.0</version>
<packaging>apk</packaging>
<name>bbb</name>
<properties>
<sdk.path>${ANDROID_HOME}</sdk.path>
<android-emulator>1.6</android-emulator>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
<sdk>
<platform>15</platform>
<path>${ANDROID_HOME}</path>
</sdk>
<emulator>
<avd>${android-emulator}</avd>
</emulator>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>utf-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign</id>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.6.0</version>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
当前maven版本为3.0.5
jdk 为1.6.0_38
用python进行打包出现错误如下:
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.3:generate-sources (default-generate-sources) on project zh
e800: Execution default-generate-sources of goal com.jayway.maven.plugins.androi
d.generation2:android-maven-plugin:3.5.3:generate-sources failed: Could not find
tool 'aapt'. Please provide a proper Android SDK directory path as configuratio
n parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an al
ternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or s
et environment variable ANDROID_HOME. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
pom.xml文件修改如下:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.aaa.ccc</groupId>
<artifactId>bbb</artifactId>
<version>1.0</version>
<packaging>apk</packaging>
<name>bbb</name>
<properties>
<sdk.path>${ANDROID_HOME}</sdk.path>
<android-emulator>1.6</android-emulator>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
<sdk>
<platform>15</platform>
<path>${ANDROID_HOME}</path>
</sdk>
<emulator>
<avd>${android-emulator}</avd>
</emulator>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>utf-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign</id>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.6.0</version>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>