从 libsdl.org ant install 编译 android SDL 失败并显示 BUILD FAILED
帮助!我一直在尝试编译&从 libsdl.org 测试最新的 SDL (1.3) 端口
(可在此处找到:http://www .libsdl.org/tmp/android-project.zip)
步骤
cd android-project ndk-构建 蚂蚁安装 sh data.sh
它不会使用 NDK-r5b 进行编译,一直抱怨找不到“SDL.h”...即使路径等似乎设置正确。
所以我安装了 r4b,然后 cd 到(新的)android-project 目录并运行 ndk-build ...,没有错误。 (还检查以确保它首先使用“which ndk-build”使用 r4b)
它构建正常......但“ant install”步骤失败。
sgtwhy@sgtwhy-PC /cygdrive/t/Android/android-project $ adb devices 附加设备列表 emulator-5554 设备
sgtwhy@sgtwhy-PC /cygdrive/t/Android/android-project $ ant 安装构建文件: T:\Android\android-project\build.xml
构建失败 T:\Android\android-project\build.xml:49: 任务定义类 com.android.ant.SetupTask 不能 使用类加载器找到 AntClassLoader[]
总时间:0秒
我正在使用“stock”build.xml 文件并验证 *.properties 文件似乎也具有正确的路径。
有什么想法如何让它发挥作用吗?现在它已编译 - 需要以某种方式将其推送到手机。
[编辑/更新]
我进入项目并运行 android.bat 来更新属性文件。
$ cd android 项目 $ android.bat 更新项目 -t 3 --path 。
然后运行“ant install”-成功了!
sgtwhy@sgtwhy-PC /cygdrive/t/Android/android-project $ ant 安装构建文件: T:\Android\android-project\build.xml [设置] Android SDK 工具修订版 10 [设置] 项目目标:Android 1.6 [设置] API 级别:4 [设置] [设置] - - - - - - - - - [设置] 解决库依赖关系: [设置] 没有库依赖项。 [设置] [设置] - - - - - - - - - [设置] [设置] 警告:未设置 minSdkVersion 值。应用程序将安装在 所有安卓版本。 [设置] [设置]导入规则文件:tools\ant\main_rules.xml
-调试混淆检查:
-设置调试模式:
-编译测试如果测试:
-预构建:
-目录: [echo] 如果需要的话创建输出目录... [mkdir] 创建目录:T:\Android\android-project\bin [mkdir] 创建目录:T:\Android\android-project\gen [mkdir] 创建目录:T:\Android\android-project\bin\classes
-aidl: [echo]将aidl文件编译成Java类...
-渲染脚本: [echo] 将 RenderScript 文件编译成 Java 类并 RenderScript 字节代码...
-资源-src: [echo] 从资源生成 R.java / Manifest.java...
-预编译:
编译: [javac] T:\Android\android-sdk\tools\ant\main_rules.xml:384: 警告:“包括 deantruntime”不是 设置,默认为 build.sysclasspath=最后;设置为假 用于可重复构建 [javac] 将2个源文件编译为 T:\Android\android-project\bin\classes
-编译后:
-混淆:
-dex: [echo] 将编译后的文件和外部库转换为 T:\Android\和 roid-project\bin\classes.dex...
-包资源: [echo] 打包资源 [aapt]正在创建完整的资源包...
-package-debug-sign:[apkbuilder] 创建 SDLApp-debug-unaligned.apk 并使用调试密钥对其进行签名...
调试: [echo] 在最终的 apk 上运行 zipalign... [echo] 调试包:T:\Android\android-project\bin\SDLApp-debug.apk
安装: [echo] 安装 T:\Android\android-project\bin\SDLApp-debug.apk 到默认的模拟器或设备上... [执行] pkg:/data/local/tmp/SDLApp-debug.apk [执行] 成功 [执行] 267 KB/s(3.455 秒内 946557 字节)
构建成功总时间:19 秒
Help! I've been trying to compile & test the recent SDL (1.3) port from libsdl.org
(found here: http://www.libsdl.org/tmp/android-project.zip)
steps
cd android-project
ndk-build
ant install
sh data.sh
It wouldn't compiled using NDK-r5b, kept complaining that "SDL.h" not found ... even though the paths, etc seemed to be setup properly.
So I installed r4b and then cd into the (fresh) android-project directory and ran ndk-build ... with no errors. (also checked to be sure it was using r4b using "which ndk-build" first)
IT BUILDS OK ... but the "ant install" step fails.
sgtwhy@sgtwhy-PC
/cygdrive/t/Android/android-project $
adb devices List of devices attached
emulator-5554 devicesgtwhy@sgtwhy-PC
/cygdrive/t/Android/android-project $
ant install Buildfile:
T:\Android\android-project\build.xmlBUILD FAILED
T:\Android\android-project\build.xml:49:
taskdef class
com.android.ant.SetupTask cannot be
found using the classloader
AntClassLoader[]Total time: 0 seconds
I'm using the "stock" build.xml file and verified the *.properties files appear to have correct paths as well.
Any ideas how to get this working ? Now that its compiled - need to push it to the phone somehow.
[EDIT / UPDATE ]
I went into the project and ran android.bat to update the properties files.
$ cd android-project
$ android.bat update project -t 3 --path .
and then ran "ant install" - with success!
sgtwhy@sgtwhy-PC
/cygdrive/t/Android/android-project $
ant install Buildfile:
T:\Android\android-project\build.xml
[setup] Android SDK Tools Revision 10
[setup] Project Target: Android 1.6
[setup] API level: 4
[setup]
[setup] ------------------
[setup] Resolving library dependencies:
[setup] No library dependencies.
[setup]
[setup] ------------------
[setup]
[setup] WARNING: No minSdkVersion value set. Application will install on
all Android versions.
[setup]
[setup] Importing rules file: tools\ant\main_rules.xml-debug-obfuscation-check:
-set-debug-mode:
-compile-tested-if-test:
-pre-build:
-dirs:
[echo] Creating output directories if needed...
[mkdir] Created dir: T:\Android\android-project\bin
[mkdir] Created dir: T:\Android\android-project\gen
[mkdir] Created dir: T:\Android\android-project\bin\classes-aidl:
[echo] Compiling aidl files into Java classes...-renderscript:
[echo] Compiling RenderScript files into Java classes and
RenderScript byte code...-resource-src:
[echo] Generating R.java / Manifest.java from the resources...-pre-compile:
compile:
[javac] T:\Android\android-sdk\tools\ant\main_rules.xml:384:
warning: 'inclu deantruntime' was not
set, defaulting to
build.sysclasspath=last; set to false
f or repeatable builds
[javac] Compiling 2 source files to
T:\Android\android-project\bin\classes-post-compile:
-obfuscate:
-dex:
[echo] Converting compiled files and external libraries into
T:\Android\and
roid-project\bin\classes.dex...-package-resources:
[echo] Packaging resources
[aapt] Creating full resource package...-package-debug-sign: [apkbuilder] Creating SDLApp-debug-unaligned.apk
and signing it with a debug key ...debug:
[echo] Running zip align on final apk...
[echo] Debug Package: T:\Android\android-project\bin\SDLApp-debug.apkinstall:
[echo] Installing T:\Android\android-project\bin\SDLApp-debug.apk
onto defa ult emulator or device...
[exec] pkg: /data/local/tmp/SDLApp-debug.apk
[exec] Success
[exec] 267 KB/s (946557 bytes in 3.455s)BUILD SUCCESSFUL Total time: 19
seconds
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论