android apk运行时错误

时间:2014-03-13 07:18:26

标签: java android eclipse

我有一个应用程序,我放在包/ app / myappfolder,我使用谷歌的android-support-v4.jar库,它在myappfolder / libs,在Android.mk文件中我添加以下行:< / p>

LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := android-support-v4:libs/android-support-v4.jar
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_DEX_PREOPT := false

我的代码使用了android.support.v4.app。*包。

然后,我使用&#34; mmm -b packages / app / myappfolder&#34;来构建构建消息,它包含以下行

Install: out/target/product/target/system/app/myapp.apk
target Prebuilt: android-support-v4 (out/target/product/target/obj/JAVA_LIBRARIES/android-support-v4_intermediates/javalib.jar)

我想,这意味着build已生成myapp.apk和javalib.jar,javalib.jar的库与android-support-v4.jar相同,对吗?

我只知道adb install -r myapp.apk到我的目标板,应用程序无法运行,并且崩溃时出现错误:

E/AndroidRuntime(24403): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f020000 a=-1 r=0x7f020000}
E/AndroidRuntime(24403):    at android.content.res.Resources.loadDrawable(Resources.java:1927)
E/AndroidRuntime(24403):    at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
E/AndroidRuntime(24403):    at android.view.View.<init>(View.java:3330)
E/AndroidRuntime(24403):    at android.view.ViewGroup.<init>(ViewGroup.java:431)
E/AndroidRuntime(24403):    at android.widget.FrameLayout.<init>(FrameLayout.java:101)
E/AndroidRuntime(24403):    at android.widget.FrameLayout.<init>(FrameLayout.java:97)
E/AndroidRuntime(24403):    ... 28 more
E/AndroidRuntime(24422): FATAL EXCEPTION: main
E/AndroidRuntime(24422): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.changhong.factorymode/com.changhong.factorymode.MainActivity}: android.view.InflateException: Binary XML file line #20: Error inflating class <unknown>

如果使用带有ADT构建和安装的eclipse,这个应用程序运行良好,这是我不能将javalib.jar推送到目标板的原因吗?如果是的话,怎么做?还有其他原因吗?

0 个答案:

没有答案