我正在尝试使用人行横道构建android应用程序。我按照这个官方指南来设置。并成功构建了实例工程。但是当我尝试从我自己的HTML5项目中构建时,它构建失败了。
错误输出:
Starting application build (arm)
* Checking keystore for signing
No keystore provided for signing. Using xwalk's keystore for debugging.
Please use a valid keystore when distributing to the app market.
* Updating project with xwalk_core_library
* Checking for external extensions
* Copying native libraries for arm
* Building Android apk package with Crosswalk embedded (arm)
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] 3 warnings
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] 3 warnings
BUILD FAILED
/home/jian/app/android-sdk-linux/tools/ant/build.xml:928: The following error occurred while executing this line:
/home/jian/app/android-sdk-linux/tools/ant/build.xml:946: null returned: 1
Total time: 40 seconds
Command "/home/jian/app/ant/bin/ant release -f /tmp/Threecakes-Qqo589/build.xml -Dkey.store=/home/jian/app/crosswalk-14.43.343.17/xwalk-debug.keystore -Dkey.alias=xwalkdebugkey -Dkey.store.password=xwalkdebug -Dkey.alias.password=xwalkdebug" exited with non-zero exit code 1
这是我的环境设置:
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export ANDROID_HOME=/home/jian/app/android-sdk-linux
export ANT_HOME=/home/jian/app/ant
export PATH=/home/jian/app/ant/bin:/usr/lib/jvm/java-8-oracle/bin:$PATH
export PATH=/home/jian/app/android-sdk-linux:$PATH
export PATH=/home/jian/app/android-sdk-linux/tools:$PATH
export PATH=/home/jian/app/android-sdk-linux/platform-tools:$PATH
这是版本信息:
java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
ant -version
Apache Ant(TM) version 1.9.6 compiled on June 29 2015
adb help
Android Debug Bridge version 1.0.32
crosswalk version
14.43.343.17
And This is part of ant/build.xml
where the error occurred .
<target name="-package-resources" depends="-crunch">
<!-- only package resources if *not* a library project -->
<do-only-if-not-library elseText="Library project: do not package resources..." >
<aapt executable="${aapt}"
command="package"
versioncode="${version.code}"
versionname="${version.name}"
debug="${build.is.packaging.debug}"
manifest="${out.manifest.abs.file}"
assets="${asset.absolute.dir}"
androidjar="${project.target.android.jar}"
apkfolder="${out.absolute.dir}"
nocrunch="${build.packaging.nocrunch}"
resourcefilename="${resource.package.file.name}"
resourcefilter="${aapt.resource.filter}"
libraryResFolderPathRefid="project.library.res.folder.path"
libraryPackagesRefid="project.library.packages"
libraryRFileRefid="project.library.bin.r.file.path"
previousBuildType="${build.last.target}"
buildType="${build.target}"
ignoreAssets="${aapt.ignore.assets}">
<res path="${out.res.absolute.dir}" />
<res path="${resource.absolute.dir}" />
<!-- <nocompress /> forces no compression on any files in assets or res/raw -->
<!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
</aapt>
</do-only-if-not-library>
</target>
为什么我成功地构建了示例项目,但未能构建自己的项目?如何修正这个错误。谢谢你的帮助!
我也遇到过同样的问题。
我降级Java版本来修复它:
java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
您可以向https://crosswalk-project.org/jira/browse/报告您的问题,以获得Crosswalk开发人员的更快响应。