刚才那个问题解决了,现在又遇到一个问题,就是so打包到apk后,我们自己的so没问题,但是百度地图的so在加载的时候出错了,第三方的jar包 都没问题,可以正常运行,唯独百度地图出错了,你知道什么原因吗?01-10 14:27:44.983: E/AndroidRuntime(1853): FATAL EXCEPTION: main 01-10 14:27:44.983: E/AndroidRuntime(1853): java.lang.NullPointerException 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.graphics.Canvas.throwIfRecycled(Canvas.java:972) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.graphics.Canvas.drawBitmap(Canvas.java:998) 01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.MyLocationOverlay.drawCompass(Unknown Source) 01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.MyLocationOverlay.draw(Unknown Source) 01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.a.d(Unknown Source) 01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.a.b(Unknown Source) 01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.a.onDraw(Unknown Source) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6970) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1730) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1730) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1730) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.widget.FrameLayout.draw(FrameLayout.java:357) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1730) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.widget.FrameLayout.draw(FrameLayout.java:357) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1730) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.widget.FrameLayout.draw(FrameLayout.java:357) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.widget.FrameLayout.draw(FrameLayout.java:357) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.widget.FrameLayout.draw(FrameLayout.java:357) 01-10 14:27:44.983: E/AndroidRuntime(1853): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1961) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewRoot.draw(ViewRoot.java:1600) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewRoot.performTraversals(ViewRoot.java:1321) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.os.Handler.dispatchMessage(Handler.java:99) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.os.Looper.loop(Looper.java:143) 01-10 14:27:44.983: E/AndroidRuntime(1853): at android.app.ActivityThread.main(ActivityThread.java:4263) 01-10 14:27:44.983: E/AndroidRuntime(1853): at java.lang.reflect.Method.invokeNative(Native Method) 01-10 14:27:44.983: E/AndroidRuntime(1853): at java.lang.reflect.Method.invoke(Method.java:507) 01-10 14:27:44.983: E/AndroidRuntime(1853): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 01-10 14:27:44.983: E/AndroidRuntime(1853): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 01-10 14:27:44.983: E/AndroidRuntime(1853): at dalvik.system.NativeStart.main(Native Method) 01-10 14:32:28.860: E/NetworkLocationProvider(234): releaseCheckLocationLock: wake lock has already been released 01-10 14:32:45.146: E/ActivityManager(120): fail to set top app changed!
at android.graphics.Canvas.throwIfRecycled(Canvas.java:972) 你的位图回收了,然后又要在位图上绘制,看看代码吧
at com.baidu.mapapi.MyLocationOverlay.drawCompass(Unknown Source) 01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.MyLocationOverlay.draw(Unknown Source) 01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.a.d(Unknown Source) 01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.a.b(Unknown Source) 01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.a.onDraw(Unknown Source) 百度的jar需要keep你混淆了?
# This is a configuration file for ProGuard. # http://proguard.sourceforge.net/index.html#manual/usage.html# Optimizations: If you don't want to optimize, use the # proguard-android.txt configuration file instead of this one, which # turns off the optimization flags. Adding optimization introduces # certain risks, since for example not all optimizations performed by # ProGuard works on all versions of Dalvik. The following flags turn # off various optimizations known to have issues, but the list may not # be complete or up to date. (The "arithmetic" optimization can be # used if you are only targeting Android 2.0 or later.) Make sure you # test thoroughly if you go this route. -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/* -optimizationpasses 5 -allowaccessmodification -dontpreverify# The remainder of this file is identical to the non-optimized version # of the Proguard configuration file (except that the other file has # flags to turn off optimization).-dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -verbose-keepattributes *Annotation* -keep public class com.google.vending.licensing.ILicensingService -keep public class com.android.vending.licensing.ILicensingService# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native -keepclasseswithmembernames class * { native <methods>; }# keep setters in Views so that animations can still work. # see http://proguard.sourceforge.net/manual/examples.html#beans -keepclassmembers public class * extends android.view.View { void set*(***); *** get*(); }# We want to keep methods in Activity that could be used in the XML attribute onClick -keepclassmembers class * extends android.app.Activity { public void *(android.view.View); }# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); }-keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; }-keepclassmembers class **.R$* { public static <fields>; } 我想说这个keep可以不要# The support library contains references to newer platform versions. # Don't warn about those in case this app is linking against an older # platform version. We know about them, and they are safe. -dontwarn android.support.**http://proguard.sourceforge.net/index.html#manual/examples.html基本就是这样子,具体看你的代码了,第三方的jar一般不需要混淆,反射的,native的统统不能混淆 官方的injar outjar那些可以无视
楼主在吗。。 我也遇到了同样的问题,按照你说把assets目录下的所有文件都拷贝至 工程的 assets 文件夹里面去了。。但是 百度地图 还是用不鸟。。一点就崩溃。。打包的时候没有报错,但是一大堆的警告,关于百度地图的。。楼主遇到过吗?? 我摘抄一小段。。麻烦看到帮忙分析一下。。弄了好久了,都没解决。。之前一个用高德地图的,用楼主你的办法解决了。但是这次百度地图 怎么就不行呢?是这个百度地图的jar包 baidumapapi_v2_1_3.jar[apply] warning: Ignoring InnerClasses attribute for an anonymous inner class [apply] (com.baidu.location.g$1) that doesn't come with an [apply] associated EnclosingMethod attribute. This class was probably produced by a [apply] compiler that did not target the modern .class file format. The recommended [apply] solution is to recompile the class from source, using an up-to-date compiler [apply] and without specifying any "-target" type options. The consequence of ignoring [apply] this warning is that reflective operations on this class will incorrectly [apply] indicate that it is *not* an inner class. [apply] warning: Ignoring InnerClasses attribute for an anonymous inner class [apply] (com.baidu.location.g$2) that doesn't come with an [apply] associated EnclosingMethod attribute. This class was probably produced by a [apply] compiler that did not target the modern .class file format. The recommended [apply] solution is to recompile the class from source, using an up-to-date compiler [apply] and without specifying any "-target" type options. The consequence of ignoring [apply] this warning is that reflective operations on this class will incorrectly [apply] indicate that it is *not* an inner class.
ant debug or ant release
你好我是用build.xml脚本来写的 请问怎么写,能说详细些吗
然后ant debug或者release
一直这样打包。不知道你怎么操作的
生成build.xml不需要脚本,应该是xml写的问题了
01-10 14:27:44.983: E/AndroidRuntime(1853): java.lang.NullPointerException
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.graphics.Canvas.throwIfRecycled(Canvas.java:972)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.graphics.Canvas.drawBitmap(Canvas.java:998)
01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.MyLocationOverlay.drawCompass(Unknown Source)
01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.MyLocationOverlay.draw(Unknown Source)
01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.a.d(Unknown Source)
01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.a.b(Unknown Source)
01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.a.onDraw(Unknown Source)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6970)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1730)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1730)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1730)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1730)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1730)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.View.draw(View.java:6973)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-10 14:27:44.983: E/AndroidRuntime(1853): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1961)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewRoot.draw(ViewRoot.java:1600)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewRoot.performTraversals(ViewRoot.java:1321)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.os.Handler.dispatchMessage(Handler.java:99)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.os.Looper.loop(Looper.java:143)
01-10 14:27:44.983: E/AndroidRuntime(1853): at android.app.ActivityThread.main(ActivityThread.java:4263)
01-10 14:27:44.983: E/AndroidRuntime(1853): at java.lang.reflect.Method.invokeNative(Native Method)
01-10 14:27:44.983: E/AndroidRuntime(1853): at java.lang.reflect.Method.invoke(Method.java:507)
01-10 14:27:44.983: E/AndroidRuntime(1853): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
01-10 14:27:44.983: E/AndroidRuntime(1853): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
01-10 14:27:44.983: E/AndroidRuntime(1853): at dalvik.system.NativeStart.main(Native Method)
01-10 14:32:28.860: E/NetworkLocationProvider(234): releaseCheckLocationLock: wake lock has already been released
01-10 14:32:45.146: E/ActivityManager(120): fail to set top app changed!
你的位图回收了,然后又要在位图上绘制,看看代码吧
01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.MyLocationOverlay.draw(Unknown Source)
01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.a.d(Unknown Source)
01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.a.b(Unknown Source)
01-10 14:27:44.983: E/AndroidRuntime(1853): at com.baidu.mapapi.a.onDraw(Unknown Source)
百度的jar需要keep你混淆了?
1.首先打包so的脚本是这样的:
<!-- 打包成未签证的apk -->
<target name="package" depends="dex, package-res-and-assets">
<echo>打包成未签证的apk....</echo>
<exec executable="${apkbuilder}" failonerror="true">
<arg value="${out-unsigned-package-ospath}" />
<arg value="-u" />
<arg value="-z" />
<arg value="${resources-package-ospath}" />
<arg value="-f" />
<arg value="${dex-ospath}" />
<arg value="-rf" />
<arg value="${srcdir-ospath}" />
<!-- 打包*.so文件 -->
<arg line="-nf ${external-lib-ospath}"/>
</exec>
</target> 重点是这句话<arg line="-nf ${external-lib-ospath}"/>
2.第二个问题是由于百度地图在编译的时候会想apk 的assets目录写入很多小图片,然后我用ant编译的话就不会写入那些图片了。解决方法 从一个eclipse编译的apk中把assets目录下的文件全部复制到工程目录的assets,这样就可以打包到ant 编译的apk了。
ok啦到此结束!
不知道楼主的渠道在清单文件里吗?
我是这样做的
如果在清单文件:,ant遍历所有的渠道,然后遍历,这儿类似于多维数组
如果不在清单文件:直接打出未签名包,然后需要解压,修改渠道号,然后按照apk的压缩格式打包,签名
听你说的应该和我的方法一样,用正则表达式。 我觉得这样应该简单些,而且可以一次生成多个apk,很方便。
# http://proguard.sourceforge.net/index.html#manual/usage.html# Optimizations: If you don't want to optimize, use the
# proguard-android.txt configuration file instead of this one, which
# turns off the optimization flags. Adding optimization introduces
# certain risks, since for example not all optimizations performed by
# ProGuard works on all versions of Dalvik. The following flags turn
# off various optimizations known to have issues, but the list may not
# be complete or up to date. (The "arithmetic" optimization can be
# used if you are only targeting Android 2.0 or later.) Make sure you
# test thoroughly if you go this route.
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
-optimizationpasses 5
-allowaccessmodification
-dontpreverify# The remainder of this file is identical to the non-optimized version
# of the Proguard configuration file (except that the other file has
# flags to turn off optimization).-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose-keepattributes *Annotation*
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}# keep setters in Views so that animations can still work.
# see http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
}# We want to keep methods in Activity that could be used in the XML attribute onClick
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}-keepclassmembers class **.R$* {
public static <fields>;
} 我想说这个keep可以不要# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontwarn android.support.**http://proguard.sourceforge.net/index.html#manual/examples.html基本就是这样子,具体看你的代码了,第三方的jar一般不需要混淆,反射的,native的统统不能混淆
官方的injar outjar那些可以无视
你在 sdk下的build.xml搜索下 proguard 在obfuscate标签处,还有一堆东西,自己研究下吧,看着头晕
我摘抄一小段。。麻烦看到帮忙分析一下。。弄了好久了,都没解决。。之前一个用高德地图的,用楼主你的办法解决了。但是这次百度地图 怎么就不行呢?是这个百度地图的jar包 baidumapapi_v2_1_3.jar[apply] warning: Ignoring InnerClasses attribute for an anonymous inner class
[apply] (com.baidu.location.g$1) that doesn't come with an
[apply] associated EnclosingMethod attribute. This class was probably produced by a
[apply] compiler that did not target the modern .class file format. The recommended
[apply] solution is to recompile the class from source, using an up-to-date compiler
[apply] and without specifying any "-target" type options. The consequence of ignoring
[apply] this warning is that reflective operations on this class will incorrectly
[apply] indicate that it is *not* an inner class.
[apply] warning: Ignoring InnerClasses attribute for an anonymous inner class
[apply] (com.baidu.location.g$2) that doesn't come with an
[apply] associated EnclosingMethod attribute. This class was probably produced by a
[apply] compiler that did not target the modern .class file format. The recommended
[apply] solution is to recompile the class from source, using an up-to-date compiler
[apply] and without specifying any "-target" type options. The consequence of ignoring
[apply] this warning is that reflective operations on this class will incorrectly
[apply] indicate that it is *not* an inner class.
<!-- 打包成未签证的apk -->
<target name="package" depends="dex, package-res-and-assets">
<echo>打包成未签证的apk....</echo>
<exec executable="${apkbuilder}" failonerror="true">
<arg value="${out-unsigned-package-ospath}" />
<arg value="-u" />
<arg value="-z" />
<arg value="${resources-package-ospath}" />
<arg value="-f" />
<arg value="${dex-ospath}" />
<arg value="-rf" />
<arg value="${srcdir-ospath}" />
<!-- 打包*.so文件 -->
<arg line="-nf ${external-lib-ospath}"/>
</exec>
</target>
加了这个就报错BUILD FAILED
Target "dex" does not exist in the project "Mobile_Net_Credit". It is used from target "package".
以下的是我写的:Total time: 603 milliseconds
<?xml version="1.0" encoding="UTF-8"?>
<project name="Mobile_Net_Credit" default="help">
<!-- 打包成未签证的apk -->
<target name="Mobile_Net_Credit" depends="dex, package-res-and-assets">
<echo>打包成未签证的apk....</echo>
<exec executable="${apkbuilder}" failonerror="true">
<arg value="${out-unsigned-package-ospath}" />
<arg value="-u" />
<arg value="-z" />
<arg value="${resources-package-ospath}" />
<arg value="-f" />
<arg value="${dex-ospath}" />
<arg value="-rf" />
<arg value="${srcdir-ospath}" />
<!-- 打包*.so文件 -->
<arg line="-nf ${external-lib-ospath}"/>
</exec>
</target> 也报错,我知道name报错,可是我不是很明白这段话,请楼主帮帮忙吧!