Android - Signed apk未在移动设备上运行

时间:2016-01-06 04:23:26

标签: android android-install-apk

我面临着非常奇怪的问题。当我直接从项目的bin文件夹中复制APK并粘贴到手机SD卡中。并安装它,它工作正常。虽然我在项目中使用Android工具导出签名APK并将APK放入SD卡。它安装成功但没有运行。我不知道为什么会这样。我也是你在app中的progaurad。是app崩溃的原因吗?

这是logcat输出

> FATAL EXCEPTION: main
Process: com.globalassignmenthelp, PID: 7708
java.lang.AbstractMethodError: abstract method "android.view.View q.a(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet)"
at r.onCreateView(Unknown Source)
at android.support.v4.app.FragmentActivity.onCreateView(Unknown Source)
at com.globalassignmenthelp.Perspective.onCreateView(Unknown Source)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:733)
at android.view.LayoutInflater.inflate(LayoutInflater.java:482)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:3571)
at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3644)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:381)
at android.app.Activity.setContentView(Activity.java:2159)
at com.globalassignmenthelp.Perspective.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:5966)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2408)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2517)
at android.app.ActivityThread.access$800(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:189)
at android.app.ActivityThread.main(ActivityThread.java:5529)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)

请提前帮助和致谢。

2 个答案:

答案 0 :(得分:2)

我认为你使用了错误的程序。当progurad出现问题时,会出现这种问题。尝试使用此代码替换project.properties- 这是链接 - Progurad Code

希望这会对你有所帮助。

答案 1 :(得分:1)

add this code to proguard.txt

if you are using v4

 # support-v4
-dontwarn android.support.v4.**
-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class android.support.v4.** { *; }

if you are using v7

# support-v7
-dontwarn android.support.v7.**
-keep class android.support.v7.internal.** { *; }
-keep interface android.support.v7.internal.** { *; }
-keep class android.support.v7.** { *; }