帮助我,我的应用程序有问题,何时运行告诉我这个错误...帮助我,我的应用程序有问题,何时运行告诉我下一个错误...
尝试设置ProGuard,但仍然不知道是否或proguard-rules.pro PROGuard - android.txt,我是新手,请帮助我。
**09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: FATAL EXCEPTION: main
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: Process: com.aes.avesdata.lapaz, PID: 32242
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aes.avesdata.lapaz/aes.avesdata.lapaz.activities.DetalleFTActivity}: **java.lang.RuntimeException: Could not inflate Behavior subclass android.support.design.widget.AppBarLayout$ScrollingViewBehavior**
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2442)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.access$800(ActivityThread.java:156)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1351)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.os.Looper.loop(Looper.java:211)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5373)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: Caused by: java.lang.RuntimeException: Could not inflate Behavior subclass android.support.design.widget.AppBarLayout$ScrollingViewBehavior
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.design.widget.CoordinatorLayout.a(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.design.widget.t.<init>(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.design.widget.CoordinatorLayout.a(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.design.widget.CoordinatorLayout.generateLayoutParams(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:808)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV7.a(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.v7.app.q.setContentView(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at aes.avesdata.lapaz.activities.DetalleFTActivity.onCreate(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:5990)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2442)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.access$800(ActivityThread.java:156)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1351)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.os.Looper.loop(Looper.java:211)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5373)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: android.support.design.widget.AppBarLayout$ScrollingViewBehavior
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.Class.classForName(Native Method)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.Class.forName(Class.java:309)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.design.widget.CoordinatorLayout.a(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.design.widget.t.<init>(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.design.widget.CoordinatorLayout.a(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.design.widget.CoordinatorLayout.generateLayoutParams(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:808)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV7.a(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.v7.app.q.setContentView(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at aes.avesdata.lapaz.activities.DetalleFTActivity.onCreate(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:5990)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2442)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.access$800(ActivityThread.java:156)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1351)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.os.Looper.loop(Looper.java:211)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5373)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.AppBarLayout$ScrollingViewBehavior" on path: DexPathList[[zip file "/data/app/com.aes.avesdata.lapaz-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.Class.classForName(Native Method)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.Class.forName(Class.java:309)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.design.widget.CoordinatorLayout.a(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.design.widget.t.<init>(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.design.widget.CoordinatorLayout.a(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.design.widget.CoordinatorLayout.generateLayoutParams(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:808)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.v7.app.AppCompatDelegateImplV7.a(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.support.v7.app.q.setContentView(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at aes.avesdata.lapaz.activities.DetalleFTActivity.onCreate(Unknown Source)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:5990)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2442)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.access$800(ActivityThread.java:156)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1351)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.os.Looper.loop(Looper.java:211)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5373)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: Suppressed: java.lang.ClassNotFoundException: android.support.design.widget.AppBarLayout$ScrollingViewBehavior
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.Class.classForName(Native Method)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: ... 27 more
09-22 16:37:22.236 32242-32242/? E/AndroidRuntime: Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available**
答案 0 :(得分:3)
在项目文件夹中有一个名为proguard-rules.pro
的文件,你所要做的就是在该文件中包含这一行
#For design support library
-keep class android.support.design.widget.** { *; }
-keep interface android.support.design.widget.** { *; }
现在在你的应用程序的gradle文件中启用proguard for debug这样的
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'jackson-rules.pro'
}
minifyEnabled true
启用了proguard for debug build。在测试了proguard配置后,确保将标志设置为false!