Android crash when lunch after upgrading react-native 0.60 - android

After upgrading react native to get it work when build 64Bits (for the last GooglePlay requirement)
I follow the guideline for upgrade, now I'm crashing at start with the following logcat error
Android application crash on start.
Just in case, regarding org.apache.http.legacy, I added
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
in the AndroidManifest to get react-native-maps work with android 9 (it was working before the upgrade process).
Logcat
7724-7788 E/CrashLogHandler: Stack trace: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/facebook/react/views/webview/ReactWebViewManager;
at com.planet.planet.MainApplication$1.getPackages(MainApplication.java:53)
at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:78)
at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
at com.facebook.react.ReactActivityDelegate.loadApp(ReactActivityDelegate.java:91)
at com.facebook.react.ReactActivityDelegate.onCreate(ReactActivityDelegate.java:80)
at com.facebook.react.ReactActivity.onCreate(ReactActivity.java:52)
at com.planet.planet.MainActivity.onCreate(MainActivity.java:32)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
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:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
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:858)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.react.views.webview.ReactWebViewManager" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.planet.planet.debug-kl4UVs7kB1DjwIuGzZwG2w==/base.apk", zip file "/data/app/com.planet.planet

Related

App crashes (Databinding Error) after AndroidX Migration

I am trying to migrate a 3 yrs old project to AndroidX. The project have 3 modules.
app
sdk
apis
app is the main module. The project builds AAR file of sdk and apis module on runtime. And the app uses sdk and apis
The changes I did in order to migrate are :
updated target version of app.gradle and gradlewrapper properties
migrated to AndroidX
updated all dependecies of all modules.
As the app starts, it launches an activity from app module which works fine. Just after that it launches an Activity from sdk module. But here the app crashes at DataBindingUtil.setContentView. Databinding is enabled for all 3 modules. Below is the stacktrace.
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/android/databinding/library/baseAdapters/DataBinderMapperImpl;
at com.xyz.sdk.DataBinderMapperImpl.collectDependencies(DataBinderMapperImpl.java:274)
at androidx.databinding.MergedDataBinderMapper.addMapper(MergedDataBinderMapper.java:58)
at androidx.databinding.MergedDataBinderMapper.addMapper(MergedDataBinderMapper.java:60)
at androidx.databinding.DataBinderMapperImpl.<init>(DataBinderMapperImpl.java:5)
at androidx.databinding.DataBindingUtil.<clinit>(DataBindingUtil.java:32)
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284)
at com.xyz.sdk.landing.LandingPageActivity.onCreate(LandingPageActivity.java:51)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
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:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
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:858)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.databinding.library.baseAdapters.DataBinderMapperImpl" on path: DexPathList[[zip file "/data/app/com.example.admin.myapplication-fYwVmwZfRLEOIXuh0dvhUg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.admin.myapplication-fYwVmwZfRLEOIXuh0dvhUg==/lib/x86, /system/lib]]
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 com.xyz.sdk.DataBinderMapperImpl.collectDependencies(DataBinderMapperImpl.java:274) 
at androidx.databinding.MergedDataBinderMapper.addMapper(MergedDataBinderMapper.java:58) 
at androidx.databinding.MergedDataBinderMapper.addMapper(MergedDataBinderMapper.java:60) 
at androidx.databinding.DataBinderMapperImpl.<init>(DataBinderMapperImpl.java:5) 
at androidx.databinding.DataBindingUtil.<clinit>(DataBindingUtil.java:32) 
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284) 
at com.xyz.sdk.landing.LandingPageActivity.onCreate(LandingPageActivity.java:51) 
at android.app.Activity.performCreate(Activity.java:7136) 
at android.app.Activity.performCreate(Activity.java:7127) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) 
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:1808) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6669) 
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:858) 
I had the same error. If you are working in a multi-module project, you need to enable databinding for the app modules that depend on libraries that use it.
So, my fix was to add this to the module using directly databinding and to my app module too.
buildFeatures {
dataBinding true
}
In addition to the existing answers. I have to add below lines in proguard.
-keep class androidx.databinding.** { *; }
-keep class * extends androidx.databinding.DataBinderMapper { *; }

Emulator keeps crashing when running

Hi i am trying to make an app which shows the location of a place and everytime i run my app on the android emulator and every-time time i run it keeps on crashing and it is displaying this message in the log cat down below. I am running android studio version 3.4.2. I would appreciate it if someone could help me with this problem.
The libary i loaded in was : implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:8.0.0'
2020-03-27 16:22:33.335 12756-12756/com.example.mappingexample E/SoLoader: couldn't find DSO to load: libmapbox-gl.so caused by: dlopen failed: "/data/data/com.example.mappingexample/lib-main/libmapbox-gl.so" has unexpected e_machine: 40 (EM_ARM)
2020-03-27 16:22:33.340 12756-12756/com.example.mappingexample E/Mbgl-LibraryLoader: Failed to load native shared library.
com.facebook.soloader.SoLoader$WrongAbiError: APK was built for a different platform
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:645)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525)
at com.mapbox.mapboxsdk.module.loader.LibraryLoaderProviderImpl$SoLibraryLoader.load(LibraryLoaderProviderImpl.java:42)
at com.mapbox.mapboxsdk.LibraryLoader.load(LibraryLoader.java:43)
at com.mapbox.mapboxsdk.net.NativeConnectivityListener.<clinit>(NativeConnectivityListener.java:13)
at com.mapbox.mapboxsdk.net.ConnectivityReceiver.instance(ConnectivityReceiver.java:43)
at com.mapbox.mapboxsdk.Mapbox.getInstance(Mapbox.java:67)
at com.example.mappingexample.MainActivity.onCreate(MainActivity.java:40)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
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:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
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:858)
Caused by: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libmapbox-gl.so caused by: dlopen failed: "/data/data/com.example.mappingexample/lib-main/libmapbox-gl.so" has unexpected e_machine: 40 (EM_ARM)
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:789)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577) 
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525) 
at com.mapbox.mapboxsdk.module.loader.LibraryLoaderProviderImpl$SoLibraryLoader.load(LibraryLoaderProviderImpl.java:42) 
at com.mapbox.mapboxsdk.LibraryLoader.load(LibraryLoader.java:43) 
at com.mapbox.mapboxsdk.net.NativeConnectivityListener.<clinit>(NativeConnectivityListener.java:13) 
at com.mapbox.mapboxsdk.net.ConnectivityReceiver.instance(ConnectivityReceiver.java:43) 
at com.mapbox.mapboxsdk.Mapbox.getInstance(Mapbox.java:67) 
at com.example.mappingexample.MainActivity.onCreate(MainActivity.java:40) 
at android.app.Activity.performCreate(Activity.java:7136) 
at android.app.Activity.performCreate(Activity.java:7127) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) 
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:1808) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6669) 
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:858) 
2020-03-27 16:22:33.344 12756-12756/com.example.mappingexample E/.mappingexampl: No implementation found for void com.mapbox.mapboxsdk.net.NativeConnectivityListener.initialize() (tried Java_com_mapbox_mapboxsdk_net_NativeConnectivityListener_initialize and Java_com_mapbox_mapboxsdk_net_NativeConnectivityListener_initialize__)
2020-03-27 16:22:33.344 12756-12756/com.example.mappingexample D/AndroidRuntime: Shutting down VM
2020-03-27 16:22:33.345 12756-12756/com.example.mappingexample E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.mappingexample, PID: 12756
java.lang.UnsatisfiedLinkError: No implementation found for void com.mapbox.mapboxsdk.net.NativeConnectivityListener.initialize() (tried Java_com_mapbox_mapboxsdk_net_NativeConnectivityListener_initialize and Java_com_mapbox_mapboxsdk_net_NativeConnectivityListener_initialize__)
at com.mapbox.mapboxsdk.net.NativeConnectivityListener.initialize(Native Method)
at com.mapbox.mapboxsdk.net.NativeConnectivityListener.<init>(NativeConnectivityListener.java:27)
at com.mapbox.mapboxsdk.net.ConnectivityReceiver.instance(ConnectivityReceiver.java:43)
at com.mapbox.mapboxsdk.Mapbox.getInstance(Mapbox.java:67)
at com.example.mappingexample.MainActivity.onCreate(MainActivity.java:40)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
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:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
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:858)
2020-03-27 16:22:33.360 12756-12756/com.example.mappingexample I/Process: Sending signal. PID: 12756 SIG: 9
You can resolve this issue by following these steps:
1. Go to Gradle (Module: App)
2. Add this code on android {}
android {
packagingOptions {
pickFirst '**/armeabi-v7a/libmapbox-gl.so'
pickFirst '**/x86/libmapbox-gl.so'
pickFirst '**/arm64-v8a/libmapbox-gl.so'
pickFirst '**/x86_64/libmapbox-gl.so'
pickFirst '**/x86/libmapbox-gl.so'
}
}

Android crash only above oreo , below is the stack trace of the crash . If anybody have the idea then please share

java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/commons/logging/LogFactory; at
com.amazonaws.mobileconnectors.s3.transferutility.TransferUtility.(TransferUtility.java:91)
at
com.amazons3library.AmazonUtils.getTransferUtility(AmazonUtils.java:28)
at com.amazons3library.AmazonS3.uploadImage(AmazonS3.java:60) at
com.healthgroup.activity.NewGroupActivity.startUpload(NewGroupActivity.java:1260)
at
com.healthgroup.activity.NewGroupActivity.onActivityResult(NewGroupActivity.java:1193)
at android.app.Activity.dispatchActivityResult(Activity.java:7462) at
android.app.ActivityThread.deliverResults(ActivityThread.java:4391) at
android.app.ActivityThread.handleSendResult(ActivityThread.java:4440)
at
android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
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:6718) 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:858) Caused
by: java.lang.ClassNotFoundException: Didn't find class
"org.apache.commons.logging.LogFactory" on path: DexPathList[[zip file
"/data/app/com.healthgroup-Xo-La3W311JYbhhYhF2oXg==/base.apk"],nativeLibraryDirectories=[/data/app/com.healthgroup-Xo-La3W311JYbhhYhF2oXg==/lib/arm64,
/data/app/com.healthgroup-Xo-La3W311JYbhhYhF2oXg==/base.apk!/lib/arm64-v8a,
/system/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)
I found the answer of my problem . In case someone face the same issue just add these lines in to the application element in the manifest file
<uses-library
android:name="org.apache.http.legacy"
android:required="false"/>

New app which Use AndroidX artifacts crash

When creating new app and checking the Use Android X artifacts without modifying anything the app crash bout on my phone and the emulator.
I have asked my friend to repeat method of creating the app and every thing work in his phone.
It is my first time using Android X, Am I doing something wrong? I am running Android Studio 3.3.0.20 in snap (Linux).
2019-02-08 17:54:44.477 5487-5487/worshifter.com.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: worshifter.com.myapplication, PID: 5487
java.lang.RuntimeException: Unable to start activity ComponentInfo{worshifter.com.myapplication/worshifter.com.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class androidx.constraintlayout.widget.ConstraintLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
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:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
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:858)
Caused by: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class androidx.constraintlayout.widget.ConstraintLayout
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class androidx.constraintlayout.widget.ConstraintLayout
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.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at worshifter.com.myapplication.MainActivity.onCreate(MainActivity.java:12)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
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:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
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:858)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/constraintlayout/widget/R$styleable;
at androidx.constraintlayout.widget.ConstraintLayout.init(ConstraintLayout.java:590)
at androidx.constraintlayout.widget.ConstraintLayout.<init>(ConstraintLayout.java:567)
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.inflate(LayoutInflater.java:492) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) 
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
at worshifter.com.myapplication.MainActivity.onCreate(MainActivity.java:12) 
at android.app.Activity.performCreate(Activity.java:7136) 
at android.app.Activity.performCreate(Activity.java:7127) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) 
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:1808) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6669) 
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:858) 
2019-02-08 17:54:44.478 5487-5487/worshifter.com.myapplication E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.constraintlayout.widget.R$styleable" on path: DexPathList[[zip file "/data/app/worshifter.com.myapplication-gnuqp7fLCQHjhJ5ZKGKRAQ==/base.apk"],nativeLibraryDirectories=[/data/app/worshifter.com.myapplication-gnuqp7fLCQHjhJ5ZKGKRAQ==/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 28 more
Edit found out that when removing android.enableJetifier=true the app works.
I have the same issue.
As you see it show in logs: Error inflating class androidx.constraintlayout.widget.ConstraintLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
You should go to project level build.gradle and update ConstraintLayout to the latest version (and also the good idea update all other dependencies from beta versions):
Default dependencies:
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.core:core-ktx:1.1.0-alpha04'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
Actual version:
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
Also I created bugreport about this issue:
https://issuetracker.google.com/issues/122892917
The solution is as simple as upgrading the libraries to their latest version in the build.gradle file.
Hint: Use the Android Studio's linting feature to update the libraries to their latest version (Left Alt+Enter on Windows)
I got same error,
My release apk can install to Emulator, Device,
But it crashed.
I check build.gradle file, updated to library to latest version.
Also remove deprecated library, error library, as image in below.
Then, my release apk never got crash when start application as before.

Android Studio errors once detached from EXPO

I’ve been using Expo XDE and once I detach the project and run in Android Studio I'm having some major problems and can't sort it out.
Env Details:
Windows: 10
Android Studio: 3.1.4
Node.js: 8.11.3
NPM: 5.6.0
expo: 1.1.0-beta.5
exp: 57.0.0
Steps to replicate issue
Open upe Expo XDE and create new project
-> Run and test that it works in simulator in android studio (yes it works)
Open up app.json and add
“android”: {
“package”: “com.yourcompany.yourappname”
}
cmd line into project and ‘exp detach’
‘exp start’ (no errors given initially and gives url)
Open project in Android Studio (takes time with “Building ‘android’ Gradle project info”)
Build completes successfully with all oks.
Now in android studio I go to Run on the top menu, then select Run ‘app’
emulator screen goes white doesnt change and under the Run output I get these errors
(Also once all this was done I looked back in the cm line where I ran exp start and it now says “Metro Bundler failed to start. (code: EPERM)”)
E/GraphResponse: {HttpStatus: 400, errorCode: 100, subErrorCode: 33, errorType: GraphMethodException, errorMessage: Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api}
W/AsyncCondition: Could not find listener for key: openOptimisticExperienceActivity
Could not find listener for key: openExperienceActivity
E/AppLoader: Error fetching cached manifest, falling back to default timeout: Could not load manifest. Are you sure this experience has been published?
D/AndroidRuntime: Shutting down VM
--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.yourcompany.tes, PID: 7527
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yourcompany.tes/host.exp.exponent.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘boolean java.lang.String.equals(java.lang.Object)’ on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
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:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
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:858)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘boolean java.lang.String.equals(java.lang.Object)’ on a null object reference
at host.exp.exponent.ExponentManifest.fetchCachedManifest(ExponentManifest.java:287)
at host.exp.exponent.AppLoader.start(AppLoader.java:91)
at host.exp.exponent.experience.DetachActivity.onCreate(DetachActivity.java:95)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
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:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
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:858)
I/Process: Sending signal. PID: 7527 SIG: 9
Application terminated.

Categories

Resources