我正在尝试从命令行构建我的Android项目。我更改了ant.properties并设置了以下内容:
source.dir =
这是因为我想从' main'开始构建源代码。文件夹(我的' jni'文件夹位于此下方)。
我看过'重复'关于我的问题标题的问题,但没有一个答案证明是有帮助的。
ANT无法构建我的项目,抱怨重复的AndroidManifest.xml文件,我完全不知道为什么。
有人可以帮帮我吗?
我的详细ANT输出如下所示。
SparkbookPro:main admin$ ant -v debug
Apache Ant(TM) version 1.9.7 compiled on April 9 2016
Trying the default build file: build.xml
Buildfile: /Work/TT/android-TT/app/src/main/build.xml
Detected Java version: 1.7 in: /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/jre
Detected OS: Mac OS X
parsing buildfile /Work/TT/android-TT/app/src/main/build.xml with URI = file:/Work/TT/android-TT/app/src/main/build.xml
Project base dir set to: /Work/TT/android-TT/app/src/main
parsing buildfile jar:file:/usr/local/Cellar/ant/1.9.7/libexec/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/usr/local/Cellar/ant/1.9.7/libexec/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
[property] Loading /Work/TT/android-TT/app/src/main/local.properties
[property] Loading /Work/TT/android-TT/app/src/main/ant.properties
[property] Loading Environment env.
Property "env.ANDROID_HOME" has not been set
Importing file /Work/TT/android-TT/app/src/main/custom_rules.xml from /Work/TT/android-TT/app/src/main/build.xml
Cannot find /Work/TT/android-TT/app/src/main/custom_rules.xml imported from /Work/TT/android-TT/app/src/main/build.xml
Importing file /Android/sdk/tools/ant/build.xml from /Work/TT/android-TT/app/src/main/build.xml
Overriding previous definition of reference to ant.projectHelper
parsing buildfile /Android/sdk/tools/ant/build.xml with URI = file:/Android/sdk/tools/ant/build.xml
Override ignored for property "source.dir"
Property "key.store" has not been set
[macrodef] creating macro do-only-if-not-library
[macrodef] creating macro do-only-if-manifest-hasCode
[macrodef] creating macro dex-helper
[macrodef] creating macro package-helper
[macrodef] creating macro zipalign-helper
[macrodef] creating macro run-tests-helper
[macrodef] creating macro record-build-key
[macrodef] creating macro record-build-info
[macrodef] creating macro uninstall-helper
Overriding previous definition of reference to ant.projectHelper
Build sequence for target(s) `debug' is [-set-mode-check, -set-debug-files, -check-env, -setup, -set-debug-mode, -debug-obfuscation-check, -pre-build, -build-setup, -code-gen, -pre-compile, -compile, -post-compile, -obfuscate, -dex, -crunch, -package-resources, -package, -post-package, -do-debug, -post-build, debug]
Complete build sequence is [-set-mode-check, -set-debug-files, -check-env, -setup, -set-debug-mode, -debug-obfuscation-check, -pre-build, -build-setup, -code-gen, -pre-compile, -compile, -post-compile, -obfuscate, -dex, -crunch, -package-resources, -package, -post-package, -do-debug, -post-build, debug, -set-instrumented-mode, instrument, emma, android_rules.-pre-build, android_rules.-release-obfuscation-check, android_rules.-setup, lint, android_rules.-release-sign, -test-project-check, android_rules.nodeps, android_rules.-set-debug-files, android_rules.-set-debug-mode, -pre-clean, -release-nosign, install, installd, android_rules.installt, android_rules.-dex, -set-release-mode, android_rules.installr, android_rules.emma, android_rules.-release-nosign, android_rules.-pre-compile, android_rules.instrument, android_rules.uninstall, android_rules.installi, android_rules.lint, android_rules.-obfuscate, android_rules.clean, android_rules.installd, android_rules.-post-build, android_rules.-debug-obfuscation-check, android_rules.-compile, installt, help, -release-obfuscation-check, -release-prompt-for-password, -release-sign, android_rules.release, installr, release, android_rules.-pre-clean, android_rules.-post-compile, installi, android_rules.-code-gen, android_rules.-release-prompt-for-password, android_rules.-package-resources, android_rules.-set-mode-check, android_rules.-test-project-check, test, android_rules.help, android_rules.install, clean, android_rules.-do-debug, android_rules.-check-env, android_rules.-package, android_rules.-set-instrumented-mode, android_rules.-post-package, android_rules.test, android_rules.debug, uninstall, android_rules.-build-setup, nodeps, android_rules.-crunch, , android_rules.-set-release-mode]
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 23.0.5
[checkenv] Installed at /Android/sdk
-setup:
[echo] Project Name: app
[gettype] Project Type: Application
-set-debug-mode:
Property "emma.enabled" has not been set
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 20.0.0
[property] Loading /Work/TT/android-TT/app/src/main/bin/build.prop
[property] Unable to find property file: /Work/TT/android-TT/app/src/main/bin/build.prop
[echo] Resolving Build Target for app...
[gettarget] Project Target: Android 4.0
[gettarget] API level: 14
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Skipping /Work/TT/android-TT/app/src/main/res because it already exists.
[mkdir] Skipping /Work/TT/android-TT/app/src/main/libs because it already exists.
[mkdir] Skipping /Work/TT/android-TT/app/src/main/bin because it already exists.
[mkdir] Skipping /Work/TT/android-TT/app/src/main/bin/res because it already exists.
[mkdir] Created dir: /Work/TT/android-TT/app/src/main/bin/rsObj
[mkdir] Created dir: /Work/TT/android-TT/app/src/main/bin/rsLibs
[mkdir] Skipping /Work/TT/android-TT/app/src/main/gen because it already exists.
[mkdir] Skipping /Work/TT/android-TT/app/src/main/bin/classes because it already exists.
[mkdir] Skipping /Work/TT/android-TT/app/src/main/bin/dexedLibs because it already exists.
[echo] ----------
[echo] Resolving Dependencies for app...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on
-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
Property "android.library" has not been set
[aapt] No changed resources. R.java and Manifest.java untouched.
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
[javac] /Work/TT/android-TT/app/src/main/AndroidManifest.xml skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/ant.properties skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/assets/image.bmp skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/AndroidManifest.xml skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/AndroidManifest.xml.d skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/app-debug-unaligned.apk skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/app.ap_ skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/app.ap_.d skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes.dex skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes.dex.d skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/BuildConfig.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/DummyEdit.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/R$attr.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/R$drawable.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/R$layout.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/R$string.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/R.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLActivity$1.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLActivity$2.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLActivity$3.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLActivity$4.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLActivity$5.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLActivity$6.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLActivity$SDLCommandHandler.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLActivity$ShowTextInputTask.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLActivity.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLGenericMotionListener_API12.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLInputConnection.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLJoystickHandler.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLJoystickHandler_API12$RangeComparator.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLJoystickHandler_API12$SDLJoystick.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLJoystickHandler_API12.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLMain.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLSurface$1.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/SDLSurface.class skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/dexedLibs/annotations-02cd0fe5571ca234f7aa893c504b0c27.jar skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/jarlist.cache skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/proguard.txt skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/res/drawable-hdpi/ic_launcher.png skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/res/drawable-mdpi/ic_launcher.png skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/res/drawable-xhdpi/ic_launcher.png skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/bin/res/drawable-xxhdpi/ic_launcher.png skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/build.xml skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/gen/R.java.d skipped - don't know how to handle it
[javac] gen/org/libsdl/app/BuildConfig.java added as gen/org/libsdl/app/BuildConfig.class doesn't exist.
[javac] gen/org/libsdl/app/R.java added as gen/org/libsdl/app/R.class doesn't exist.
[javac] java/org/libsdl/app/SDLActivity.java added as java/org/libsdl/app/SDLActivity.class doesn't exist.
[javac] /Work/TT/android-TT/app/src/main/jni/Android.mk skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/jni/Application.mk skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/jni/buildit skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/jni/cleanit skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/jni/main.cpp skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/jniLibs/armeabi-v7a/libSDL2.so skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/jniLibs/armeabi-v7a/libmain.so skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/libs/armeabi-v7a/libSDL2.so skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/libs/armeabi-v7a/libmain.so skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/local.properties skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/obj/local/armeabi-v7a/libSDL2.so skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/obj/local/armeabi-v7a/libmain.so skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/obj/local/armeabi-v7a/objs/main/work/SDL2-2.0.4/src/main/android/SDL_android_main.o skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/obj/local/armeabi-v7a/objs/main/work/SDL2-2.0.4/src/main/android/SDL_android_main.o.d skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/obj/local/armeabi-v7a/objs/main/work/TT/android-TT/app/src/main/jni/main.o skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/obj/local/armeabi-v7a/objs/main/work/TT/android-TT/app/src/main/jni/main.o.d skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/proguard-project.txt skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/project.properties skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/res/drawable-hdpi/ic_launcher.png skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/res/drawable-mdpi/ic_launcher.png skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/res/drawable-xhdpi/ic_launcher.png skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/res/drawable-xxhdpi/ic_launcher.png skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/res/layout/main.xml skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/res/values/strings.xml skipped - don't know how to handle it
[javac] /Work/TT/android-TT/app/src/main/gen/R.java.d skipped - don't know how to handle it
[javac] org/libsdl/app/BuildConfig.java added as org/libsdl/app/BuildConfig.class is outdated.
[javac] org/libsdl/app/R.java omitted as /Work/TT/android-TT/app/src/main/bin/classes/org/libsdl/app/R.class is up to date.
[javac] Compiling 4 source files to /Work/TT/android-TT/app/src/main/bin/classes
[javac] Using modern compiler
[javac] Compilation arguments:
[javac] '-d'
[javac] '/Work/TT/android-TT/app/src/main/bin/classes'
[javac] '-classpath'
[javac] '/Work/TT/android-TT/app/src/main/bin/classes:/Android/sdk/tools/support/annotations.jar'
[javac] '-sourcepath'
[javac] '/Work/TT/android-TT/app/src/main:/Work/TT/android-TT/app/src/main/gen'
[javac] '-target'
[javac] '1.5'
[javac] '-bootclasspath'
[javac] '/Android/sdk/platforms/android-14/android.jar'
[javac] '-encoding'
[javac] 'UTF-8'
[javac] '-g'
[javac] '-source'
[javac] '1.5'
[javac]
[javac] The ' characters around the executable and arguments are
[javac] not part of the command.
[javac] Files to be compiled:
[javac] /Work/TT/android-TT/app/src/main/gen/org/libsdl/app/BuildConfig.java
[javac] /Work/TT/android-TT/app/src/main/gen/org/libsdl/app/R.java
[javac] /Work/TT/android-TT/app/src/main/java/org/libsdl/app/SDLActivity.java
[javac] /Work/TT/android-TT/app/src/main/gen/org/libsdl/app/BuildConfig.java
[javac] Note: /Work/TT/android-TT/app/src/main/java/org/libsdl/app/SDLActivity.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
-post-compile:
-obfuscate:
-dex:
[dex] input: /Work/TT/android-TT/app/src/main/bin/classes
[dex] input: /Android/sdk/tools/support/annotations.jar
[dex] Using Pre-Dexed annotations-02cd0fe5571ca234f7aa893c504b0c27.jar <- /Android/sdk/tools/support/annotations.jar
[dex] Found modified input file
[dex] Converting compiled files and external libraries into /Work/TT/android-TT/app/src/main/bin/classes.dex...
[dx] Current OS is Mac OS X
[dx] Executing '/Android/sdk/build-tools/20.0.0/dx' with arguments:
[dx] '--dex'
[dx] '--output'
[dx] '/Work/TT/android-TT/app/src/main/bin/classes.dex'
[dx] '/Work/TT/android-TT/app/src/main/bin/classes'
[dx] '/Work/TT/android-TT/app/src/main/bin/dexedLibs/annotations-02cd0fe5571ca234f7aa893c504b0c27.jar'
[dx]
[dx] The ' characters around the executable and arguments are
[dx] not part of the command.
[dx] Merged dex A (25 defs/33.1KiB) with dex B (2 defs/1.1KiB). Result is 27 defs/39.2KiB. Took 0.1s
-crunch:
[crunch] Current OS is Mac OS X
[crunch] Executing '/Android/sdk/build-tools/20.0.0/aapt' with arguments:
[crunch] 'crunch'
[crunch] '-v'
[crunch] '-S'
[crunch] '/Work/TT/android-TT/app/src/main/res'
[crunch] '-C'
[crunch] '/Work/TT/android-TT/app/src/main/bin/res'
[crunch]
[crunch] The ' characters around the executable and arguments are
[crunch] not part of the command.
[crunch] Crunching PNG Files in source dir: /Work/TT/android-TT/app/src/main/res
[crunch] To destination dir: /Work/TT/android-TT/app/src/main/bin/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] Creating full resource package...
[aapt] Current OS is Mac OS X
[aapt] Executing '/Android/sdk/build-tools/20.0.0/aapt' with arguments:
[aapt] 'package'
[aapt] '--no-crunch'
[aapt] '-f'
[aapt] '--debug-mode'
[aapt] '-0'
[aapt] 'apk'
[aapt] '-M'
[aapt] '/Work/TT/android-TT/app/src/main/bin/AndroidManifest.xml'
[aapt] '-S'
[aapt] '/Work/TT/android-TT/app/src/main/bin/res'
[aapt] '-S'
[aapt] '/Work/TT/android-TT/app/src/main/res'
[aapt] '-A'
[aapt] '/Work/TT/android-TT/app/src/main/assets'
[aapt] '-I'
[aapt] '/Android/sdk/platforms/android-14/android.jar'
[aapt] '-F'
[aapt] '/Work/TT/android-TT/app/src/main/bin/app.ap_'
[aapt] '--generate-dependencies'
[aapt]
[aapt] The ' characters around the executable and arguments are
[aapt] not part of the command.
-package:
[apkbuilder] Current build type is different than previous build: forced apkbuilder run.
[apkbuilder] Creating app-debug-unaligned.apk and signing it with a debug key...
[apkbuilder] Found duplicate file for APK: AndroidManifest.xml
[apkbuilder] Origin 1: /Work/TT/android-TT/app/src/main/bin/app.ap_
[apkbuilder] Origin 2: /Work/TT/android-TT/app/src/main/AndroidManifest.xml
BUILD FAILED
/Android/sdk/tools/ant/build.xml:962: The following error occurred while executing this line:
/Android/sdk/tools/ant/build.xml:973: The following error occurred while executing this line:
/Android/sdk/tools/ant/build.xml:312: com.android.sdklib.build.DuplicateFileException: Duplicate files at the same path inside the APK
at com.android.sdklib.build.ApkBuilder.doAddFile(ApkBuilder.java:821)
at com.android.sdklib.build.ApkBuilder.addFile(ApkBuilder.java:507)
at com.android.sdklib.build.ApkBuilder.processFileForResource(ApkBuilder.java:872)
at com.android.sdklib.build.ApkBuilder.addSourceFolder(ApkBuilder.java:623)
at com.android.sdklib.build.ApkBuilder.addSourceFolder(ApkBuilder.java:605)
at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:356)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
at org.apache.tools.ant.Main.runBuild(Main.java:854)
at org.apache.tools.ant.Main.startAnt(Main.java:236)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
Total time: 4 seconds
SparkbookPro:main admin$
为了完整性,这是我的Android.mk。它构建了一个共享库libmain.so,它引用了libSDL2.so。
LOCAL_PATH := /Work/SDL2/lib-android/armeabi-v7a
include $(CLEAR_VARS)
LOCAL_MODULE := SDL2-prebuilt
LOCAL_SRC_FILES := $(LOCAL_PATH)/libSDL2.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_PATH := $(call my-dir)
JNI_LIBPATH := ../jniLibs
LOCAL_MODULE := main
SDL_PATH := /work/SDL2-2.0.4
NDK_TOOLCHAIN_VERSION=4.4.3
LOCAL_C_INCLUDES := $(SDL_PATH)/include
MY_CFLAGS := -DANDROID_PDS -mfloat-abi=softfp -mfpu=neon
LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \
/work/TT/android-TT/app/src/main/jni/main.cpp
LOCAL_SHARED_LIBRARIES := SDL2-prebuilt
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog -lm
include $(BUILD_SHARED_LIBRARY)
答案 0 :(得分:0)
问题似乎是由Android Studio和Gradle干预后使用泥泞的文件夹结构引起的。我拿了一份SDL模板项目的新副本,然后从命令行再次启动 - 没有更多问题。