标签:message odi 代码 clu pat end 命令 android 混淆
对于简单的Android应用。简单的几步操作就能完毕:
[aapt] invalid resource directory name: project文件夹/bin/res crunch BUILD FAILED sdk/tools/ant/build.xml:649: The following error occurred while executing this line: build.xml:694:null returned: 1
-obfuscate: [mkdir] Created dir:project文件夹/bin/proguard [jar] Building jar: project文件夹/bin/proguard/original.jar [proguard] ProGuard, version 5.2.1 ...
假设你的libs中刚好有编译好的so,那打包好的apk似乎能正常执行。在配置好的jniproject,仅仅要执行ndk的ndk-build就可以完毕so的编译。因此,仅仅要在build.xml同文件夹中加入custom_rules.xml文件,内容例如以下:
<?xml version="1.0" encoding="UTF-8"?> <project name="工程名" default="help"> <target name="-pre-compile"> <echo >ndk build.............................</echo> <exec executable="${ndk.dir}/ndk-build" > </exec> </target> </project>
主project依赖你的库project,在库project中也生成build.xml,然后依照上面的方法操作就可以。
在eclipse的Java Build Path->Libraries中调整其载入顺序,那么ant编译怎么改动呢?还是利用前面编写的custom_rules.xml,内容例如以下:
<?xml version="1.0" encoding="UTF-8"?> <project name="hooktest" default="help"> <property name="project.target.android.jar" value="${sdk.dir}/platforms/${target}/android.jar" /> <target name="-pre-compile"> <echo >set project target class path.............................</echo> <path id="project.target.class.path"> <pathelement location="framework.jar"/> <pathelement location="${project.target.android.jar}"/> </path> <property name="my.project.target.class.path" refid="project.target.class.path" /> <echo message="project.target.class.path:${my.project.target.class.path}" /> </target> </project>
<target name="-pre-build"> <echo >copy file.............................</echo> <copy todir="${source.absolute.dir}"> <fileset dir="其他源代码文件夹"> <include name="**/*.java" /> <include name="**/*.aidl" /> </fileset> </copy> </target> <target name="src-clean" > <echo >delete file.............................</echo> <delete dir="${source.absolute.dir}/拷贝的源代码文件夹" /> </target> <target name="-post-build" depends="src-clean"> </target> <target name="-pre-clean" depends="src-clean"> </target>
其他问题还有如库project间的资源引用,假设直接使用默认的R文件是没有问题的,可是要是在eclipse中利用build Java Build Path->project加入了子project,而且还用了当中的R文件来应用资源,那么ant打包就还得再继续折腾
标签:message odi 代码 clu pat end 命令 android 混淆
原文地址:http://www.cnblogs.com/slgkaifa/p/6995111.html