Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void androidx.appcompat.widget.ad.a()’ on a null object reference ….ClassNotFoundException: Didn’t find class “androidx.core.app.CoreComponentFactory” on path: DexPathList[[]..
AndroidX로 마이그레이션 후 발생한 오류다!! 진심 짱난다.
2019-07-04 22:16:01.359 3978-3978/? E/LoadedApk: Unable to instantiate appComponentFactory
java.lang.ClassNotFoundException: Didn’t find class “androidx.core.app.CoreComponentFactory” on path: DexPathList[[],nativeLibraryDirectories=[/data/app/com.kakao.talk-o6GXVZ6B1yCPRz3TPvAjWA==/lib/arm, /data/app/com.kakao.talk-o6GXVZ6B1yCPRz3TPvAjWA==/base.apk!/lib/armeabi-v7a, /system/lib64, /system/product/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.LoadedApk.createAppFactory(LoadedApk.java:226)
at android.app.LoadedApk.updateApplicationInfo(LoadedApk.java:341)
at android.app.ActivityThread.handleDispatchPackageBroadcast(ActivityThread.java:5526)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1741)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at com.android.server.SystemServer.run(SystemServer.java:489)
at com.android.server.SystemServer.main(SystemServer.java:329)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:840)
2019-07-04 22:16:01.685 22032-22032/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.Test, PID: 22032
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.Test/com.Test.MainActivity}: android.view.InflateException: Binary XML file line #37: Binary XML file line #37: Error inflating class androidx.appcompat.widget.Toolbar
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2950)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3085)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6853)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)
Caused by: android.view.InflateException: Binary XML file line #37: Binary XML file line #37: Error inflating class androidx.appcompat.widget.Toolbar
Caused by: android.view.InflateException: Binary XML file line #37: Error inflating class androidx.appcompat.widget.Toolbar
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.r.s(Unknown Source:159)
at androidx.appcompat.app.r.r(Unknown Source:4)
at androidx.appcompat.app.r.b(Unknown Source:0)
at androidx.appcompat.app.o.setContentView(Unknown Source:4)
at com.Test.MainActivity.onCreate(Unknown Source:6)
at android.app.Activity.performCreate(Activity.java:7151)
at android.app.Activity.performCreate(Activity.java:7142)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2930)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3085)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6853)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void androidx.appcompat.widget.ad.a()’ on a null object reference
at androidx.appcompat.widget.ap.setBackgroundDrawable(Unknown Source:5)
2019-07-04 22:16:01.685 22032-22032/? E/AndroidRuntime: at android.view.View.setBackground(View.java:21538)
at android.view.View.(View.java:5511)
at android.widget.ImageView.(ImageView.java:178)
at android.widget.ImageButton.(ImageButton.java:86)
at android.widget.ImageButton.(ImageButton.java:82)
at androidx.appcompat.widget.ap.(Unknown Source:4)
at androidx.appcompat.widget.Toolbar.y(Unknown Source:14)
at androidx.appcompat.widget.Toolbar.c(Unknown Source:6)
at androidx.appcompat.widget.Toolbar.(Unknown Source:308)
at androidx.appcompat.widget.Toolbar.(Unknown Source:3)
… 32 more
2019-07-04 22:16:05.695 22032-22032/com.Test E/CrashlyticsCore: Failed to execute task.
java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(FutureTask.java:206)
at com.crashlytics.android.core.CrashlyticsBackgroundWorker.submitAndWait(Unknown Source:21)
at com.crashlytics.android.core.CrashlyticsController.handleUncaughtException(Unknown Source:59)
at com.crashlytics.android.core.CrashlyticsController$6.onUncaughtException(Unknown Source:2)
at com.crashlytics.android.core.CrashlyticsUncaughtExceptionHandler.uncaughtException(Unknown Source:13)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
at java.lang.Thread.dispatchUncaughtException(Thread.java:1955)
2019-07-04 22:16:05.696 22032-22032/com.Test E/UncaughtException: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.Test/com.Test.MainActivity}: android.view.InflateException: Binary XML file line #37: Binary XML file line #37: Error inflating class androidx.appcompat.widget.Toolbar
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2950)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3085)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6853)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)
Caused by: android.view.InflateException: Binary XML file line #37: Binary XML file line #37: Error inflating class androidx.appcompat.widget.Toolbar
Caused by: android.view.InflateException: Binary XML file line #37: Error inflating class androidx.appcompat.widget.Toolbar
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.r.s(Unknown Source:159)
at androidx.appcompat.app.r.r(Unknown Source:4)
at androidx.appcompat.app.r.b(Unknown Source:0)
at androidx.appcompat.app.o.setContentView(Unknown Source:4)
at com.Test.MainActivity.onCreate(Unknown Source:6)
at android.app.Activity.performCreate(Activity.java:7151)
at android.app.Activity.performCreate(Activity.java:7142)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2930)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3085)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6853)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void androidx.appcompat.widget.ad.a()’ on a null object reference
at androidx.appcompat.widget.ap.setBackgroundDrawable(Unknown Source:5)
at android.view.View.setBackground(View.java:21538)
at android.view.View.(View.java:5511)
2019-07-04 22:16:05.696 22032-22032/com.Test E/UncaughtException: at android.widget.ImageView.(ImageView.java:178)
at android.widget.ImageButton.(ImageButton.java:86)
at android.widget.ImageButton.(ImageButton.java:82)
at androidx.appcompat.widget.ap.(Unknown Source:4)
at androidx.appcompat.widget.Toolbar.y(Unknown Source:14)
at androidx.appcompat.widget.Toolbar.c(Unknown Source:6)
at androidx.appcompat.widget.Toolbar.(Unknown Source:308)
at androidx.appcompat.widget.Toolbar.(Unknown Source:3)
… 32 more
AndroidX가 뭔지 알아보자. 개발자 사이트 참고하기 바란다. (AndroidX 개요)
해결방법 :
proguard-rules.pro 에 아래 한줄을 추가해주면 해결된다.
-keep class androidx.core.app.CoreComponentFactory { *; }
AndroidX Build Fails in Release Mode regarding appComponentFactory