2014-04-11 4 views
7

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.access$600(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.access$600(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.access$600(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 VM 
04-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.access$600(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.access$600(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.access$600(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.access$600(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) 

가 너희들을 감사

편집 :

인쇄 스택이있다 Ormlite : AesSedai101가 언급 한 바와 같이 그래서, 그것은 내가 사용하고 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.** 교체를하지만, 최종 .**

+0

'SampleListFragment' 코드를 게시하십시오. –

+0

귀하의 응용 프로그램에 서명하기 전에 모든 lint 오류를 제거하십시오. 당신은 그것을 찾을 수 있습니다 - 마우스 오른쪽 단추로 클릭 프로젝트 -> 안드로이드 도구 -> lint.Ckeck 일반적인 오류 –

+0

@SimplePlan 그것은 아주 오래, 요점은 다음과 같습니다 : https : // gist .github.com/Korcholis/10444650 – Korcholis

답변

14

가 Proguard와 같은데 잊지 마세요 클래스 중 하나에서 생성자를 제거하고 있습니다. manual에 지정된대로 Proguard 구성을 반드시 추가하십시오. 이것이 추가되지 않으면 Proguard는 Activity 생성자와 같은 것을 포함하여 사용되지 않는 모든 코드를 제거합니다.

+0

정확 하 게! 고마워, 당신의 대답을 유효한 것으로 받아 들일 수있게 해주세요. – Korcholis

+1

감사합니다. 그리고 추신 : 바퀴가 돌기 시작하거나 끝나지 않습니다. 하지만 제게 이것은 AN 결말이었습니다. <3 #WoT – Joel

0

방금이 문제가 발생하여 새 서명 된 APK를 생성하기 전에 빌드> 프로젝트 정리를 실행하여 문제를 해결했습니다.