android – 发布崩溃的应用程序,而在调试时没有

android – 发布崩溃的应用程序,而在调试时没有,第1张

概述我正在使用 Android Studio开发一个应用程序,当我从调试转换为发布版本变体时,它开始崩溃.在调试时,它根本不会发生任何事情.真正的问题是我找不到真正的错误,因为每个引用都被重命名. 您是否遇到过这样的错误,仅在发布时发生过? 印刷的堆栈是这样的: 04-11 08:28:42.756 5997-5997/com.korcholis.clothio E/ActivityThread 我正在使用 Android Studio开发一个应用程序,当我从调试转换为发布版本变体时,它开始崩溃.在调试时,它根本不会发生任何事情.真正的问题是我找不到真正的错误,因为每个引用都被重命名.

您是否遇到过这样的错误,仅在发布时发生过?

印刷的堆栈是这样的:

04-11 08:28:42.756    5997-5997/com.korcholis.clothio E/ActivityThread﹕ Failed to inflate    androID.vIEw.InflateException: Binary XML file line #10: Error inflating class fragment            at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:713)            at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:755)            at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:492)            at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:397)            at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:353)            at com.androID.internal.policy.impl.PhoneWindow.setContentVIEw(PhoneWindow.java:267)            at androID.app.Activity.setContentVIEw(Activity.java:1906)            at androID.support.v7.a.g.a(UnkNown Source)            at androID.support.v7.a.n.a(UnkNown Source)            at androID.support.v7.a.g.setContentVIEw(UnkNown Source)            at com.korcholis.clothio.SampleListActivity.onCreate(UnkNown Source)            at androID.app.Activity.performCreate(Activity.java:5207)            at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)            at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2309)            at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)            at androID.app.ActivityThread.access0(ActivityThread.java:156)            at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1272)            at androID.os.Handler.dispatchMessage(Handler.java:99)            at androID.os.Looper.loop(Looper.java:137)            at androID.app.ActivityThread.main(ActivityThread.java:5303)            at java.lang.reflect.Method.invokeNative(Native Method)            at java.lang.reflect.Method.invoke(Method.java:525)            at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)            at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:555)            at dalvik.system.NativeStart.main(Native Method)     Caused by: java.lang.IllegalStateException: Could not find constructor that hast just a (Context) argument for helper class class com.korcholis.clothio.b.c            at com.a.a.a.a.a.c(UnkNown Source)            at com.a.a.a.a.a.b(UnkNown Source)            at com.a.a.a.a.a.a(UnkNown Source)            at com.korcholis.clothio.fragments.SampleListFragment.a(UnkNown Source)            at androID.support.v4.app.Fragment.i(UnkNown Source)            at androID.support.v4.app.ae.a(UnkNown Source)            at androID.support.v4.app.ae.b(UnkNown Source)            at androID.support.v4.app.ae.a(UnkNown Source)            at androID.support.v4.app.w.onCreateVIEw(UnkNown Source)            at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:685)at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:755)at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:492)at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:397)at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:353)at com.androID.internal.policy.impl.PhoneWindow.setContentVIEw(PhoneWindow.java:267)at androID.app.Activity.setContentVIEw(Activity.java:1906)at androID.support.v7.a.g.a(UnkNown Source)at androID.support.v7.a.n.a(UnkNown Source)at androID.support.v7.a.g.setContentVIEw(UnkNown Source)at com.korcholis.clothio.SampleListActivity.onCreate(UnkNown Source)at androID.app.Activity.performCreate(Activity.java:5207)at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2309)at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)at androID.app.ActivityThread.access0(ActivityThread.java:156)at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1272)at androID.os.Handler.dispatchMessage(Handler.java:99)at androID.os.Looper.loop(Looper.java:137)at androID.app.ActivityThread.main(ActivityThread.java:5303)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:525)at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:555)at dalvik.system.NativeStart.main(Native Method)     Caused by: java.lang.NoSuchMethodException: <init> [class androID.content.Context]            at java.lang.class.getConstructorOrMethod(Class.java:423)            at java.lang.class.getConstructor(Class.java:397)at com.a.a.a.a.a.c(UnkNown Source)at com.a.a.a.a.a.b(UnkNown Source)at com.a.a.a.a.a.a(UnkNown Source)at com.korcholis.clothio.fragments.SampleListFragment.a(UnkNown Source)at androID.support.v4.app.Fragment.i(UnkNown Source)at androID.support.v4.app.ae.a(UnkNown Source)at androID.support.v4.app.ae.b(UnkNown Source)at androID.support.v4.app.ae.a(UnkNown Source)at androID.support.v4.app.w.onCreateVIEw(UnkNown Source)at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:685)at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:755)at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:492)at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:397)at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:353)at com.androID.internal.policy.impl.PhoneWindow.setContentVIEw(PhoneWindow.java:267)at androID.app.Activity.setContentVIEw(Activity.java:1906)at androID.support.v7.a.g.a(UnkNown Source)at androID.support.v7.a.n.a(UnkNown Source)at androID.support.v7.a.g.setContentVIEw(UnkNown Source)at com.korcholis.clothio.SampleListActivity.onCreate(UnkNown Source)at androID.app.Activity.performCreate(Activity.java:5207)at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2309)at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)at androID.app.ActivityThread.access0(ActivityThread.java:156)at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1272)at androID.os.Handler.dispatchMessage(Handler.java:99)at androID.os.Looper.loop(Looper.java:137)at androID.app.ActivityThread.main(ActivityThread.java:5303)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:525)at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:555)at dalvik.system.NativeStart.main(Native Method)04-11 08:28:42.756    5997-5997/com.korcholis.clothio D/AndroIDRuntime﹕ Shutting down VM04-11 08:28:42.756    5997-5997/com.korcholis.clothio W/dalvikvm﹕ threadID=1: thread exiting with uncaught exception (group=0x41902700)04-11 08:28:42.756    5997-5997/com.korcholis.clothio E/AndroIDRuntime﹕ FATAL EXCEPTION: main    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.korcholis.clothio/com.korcholis.clothio.SampleListActivity}: androID.vIEw.InflateException: Binary XML file line #10: Error inflating class fragment            at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2355)            at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)            at androID.app.ActivityThread.access0(ActivityThread.java:156)            at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1272)            at androID.os.Handler.dispatchMessage(Handler.java:99)            at androID.os.Looper.loop(Looper.java:137)            at androID.app.ActivityThread.main(ActivityThread.java:5303)            at java.lang.reflect.Method.invokeNative(Native Method)            at java.lang.reflect.Method.invoke(Method.java:525)            at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)            at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:555)            at dalvik.system.NativeStart.main(Native Method)     Caused by: androID.vIEw.InflateException: Binary XML file line #10: Error inflating class fragment            at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:713)            at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:755)            at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:492)            at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:397)            at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:353)            at com.androID.internal.policy.impl.PhoneWindow.setContentVIEw(PhoneWindow.java:267)            at androID.app.Activity.setContentVIEw(Activity.java:1906)            at androID.support.v7.a.g.a(UnkNown Source)            at androID.support.v7.a.n.a(UnkNown Source)            at androID.support.v7.a.g.setContentVIEw(UnkNown Source)            at com.korcholis.clothio.SampleListActivity.onCreate(UnkNown Source)            at androID.app.Activity.performCreate(Activity.java:5207)            at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)            at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2309)at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)at androID.app.ActivityThread.access0(ActivityThread.java:156)at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1272)at androID.os.Handler.dispatchMessage(Handler.java:99)at androID.os.Looper.loop(Looper.java:137)at androID.app.ActivityThread.main(ActivityThread.java:5303)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:525)at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:555)at dalvik.system.NativeStart.main(Native Method)     Caused by: java.lang.IllegalStateException: Could not find constructor that hast just a (Context) argument for helper class class com.korcholis.clothio.b.c            at com.a.a.a.a.a.c(UnkNown Source)            at com.a.a.a.a.a.b(UnkNown Source)            at com.a.a.a.a.a.a(UnkNown Source)            at com.korcholis.clothio.fragments.SampleListFragment.a(UnkNown Source)            at androID.support.v4.app.Fragment.i(UnkNown Source)            at androID.support.v4.app.ae.a(UnkNown Source)            at androID.support.v4.app.ae.b(UnkNown Source)            at androID.support.v4.app.ae.a(UnkNown Source)            at androID.support.v4.app.w.onCreateVIEw(UnkNown Source)            at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:685)at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:755)at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:492)at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:397)at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:353)at com.androID.internal.policy.impl.PhoneWindow.setContentVIEw(PhoneWindow.java:267)at androID.app.Activity.setContentVIEw(Activity.java:1906)at androID.support.v7.a.g.a(UnkNown Source)at androID.support.v7.a.n.a(UnkNown Source)at androID.support.v7.a.g.setContentVIEw(UnkNown Source)at com.korcholis.clothio.SampleListActivity.onCreate(UnkNown Source)at androID.app.Activity.performCreate(Activity.java:5207)at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2309)at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)at androID.app.ActivityThread.access0(ActivityThread.java:156)at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1272)at androID.os.Handler.dispatchMessage(Handler.java:99)at androID.os.Looper.loop(Looper.java:137)at androID.app.ActivityThread.main(ActivityThread.java:5303)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:525)at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:555)at dalvik.system.NativeStart.main(Native Method)     Caused by: java.lang.NoSuchMethodException: <init> [class androID.content.Context]            at java.lang.class.getConstructorOrMethod(Class.java:423)            at java.lang.class.getConstructor(Class.java:397)at com.a.a.a.a.a.c(UnkNown Source)at com.a.a.a.a.a.b(UnkNown Source)at com.a.a.a.a.a.a(UnkNown Source)at com.korcholis.clothio.fragments.SampleListFragment.a(UnkNown Source)at androID.support.v4.app.Fragment.i(UnkNown Source)at androID.support.v4.app.ae.a(UnkNown Source)at androID.support.v4.app.ae.b(UnkNown Source)at androID.support.v4.app.ae.a(UnkNown Source)at androID.support.v4.app.w.onCreateVIEw(UnkNown Source)at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:685)at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:755)at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:492)at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:397)at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:353)at com.androID.internal.policy.impl.PhoneWindow.setContentVIEw(PhoneWindow.java:267)at androID.app.Activity.setContentVIEw(Activity.java:1906)at androID.support.v7.a.g.a(UnkNown Source)at androID.support.v7.a.n.a(UnkNown Source)at androID.support.v7.a.g.setContentVIEw(UnkNown Source)at com.korcholis.clothio.SampleListActivity.onCreate(UnkNown Source)at androID.app.Activity.performCreate(Activity.java:5207)at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2309)at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)at androID.app.ActivityThread.access0(ActivityThread.java:156)at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1272)at androID.os.Handler.dispatchMessage(Handler.java:99)at androID.os.Looper.loop(Looper.java:137)at androID.app.ActivityThread.main(ActivityThread.java:5303)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:525)at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:555)at dalvik.system.NativeStart.main(Native Method)

感谢你们

编辑:正如AesSedai101所说,这是Proguard和我正在使用的东西之间的问题:Ormlite.所以我将添加标签和一个对我有用的proguard文件:

-keepattributes Signature-keep class com.korcholis.clothio.data.** {     *; }-keep class com.j256.**-keepclassmembers class com.j256.** { *; }-keep enum com.j256.**-keepclassmembers enum com.j256.** { *; }-keep interface com.j256.**-keepclassmembers interface com.j256.** { *; }

将com.korcholis.clothio.data.**替换为存储数据库模型的包,但不要忘记最终版.**

解决方法 看起来Proguard正在从你的一个类中删除一个构造函数.请务必按照 manual中的说明添加Proguard配置.如果未添加,Proguard将删除所有未使用的代码,其中包括活动构造函数等. 总结

以上是内存溢出为你收集整理的android – 发布崩溃的应用程序,而在调试时没有全部内容,希望文章能够帮你解决android – 发布崩溃的应用程序,而在调试时没有所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1137799.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存