Answered

Android + React Native + App crash when call intercom.present()


ClassNotFoundException
Didn't find class "androidx.compose.ui.platform.ComposeView" on path: DexPathList[[zip file "/data/app/~~n484KKX1r-3zoEfjsBrAGQ==/com.android.truespaces-vuchoULl4z4i_2GC-keNLw==/base.apk"],nativeLibraryDirectories=[/data/app/~~n484KKX1r-3zoEfjsBrAGQ==/com.android.truespaces-vuchoULl4z4i_2GC-keNLw==/lib/arm64, /data/app/~~n484KKX1r-3zoEfjsBrAGQ==/com.android.truespaces-vuchoULl4z4i_2GC-keNLw==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
icon

Best answer by mateusz.leszkiewicz 21 May 2024, 15:42

View original

10 replies

Userlevel 3
Badge +4

Hi Roy Paal, It’s Mat from the Support Engineering Team 😀

It might look like a bug but might be caused by a lot of things.
Can you make sure you are using the latest React Native SDK?

If the issue still persists after update p​​​​​lease reach out to us via Messenger in your workspace to address the issue.

@mateusz.leszkiewicz I’m facing same issue, and yes I’m on the latest version of the react native SDK.

Here’s a log from logcat

FATAL EXCEPTION: main
Process: com.builtaccounting.app, PID: 26893
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/compose/ui/platform/ComposeView;
at androidx.activity.compose.ComponentActivityKt.setContent(ComponentActivity.kt:55)
at androidx.activity.compose.ComponentActivityKt.setContent$default(ComponentActivity.kt:51)
at io.intercom.android.sdk.m5.IntercomRootActivity.onCreate(IntercomRootActivity.kt:22)
at android.app.Activity.performCreate(Activity.java:8767)
at android.app.Activity.performCreate(Activity.java:8745)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1519)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3928)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4126)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:108)
at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:195)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:157)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:90)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2544)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8501)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.compose.ui.platform.ComposeView" on path: DexPathList[[zip file "/data/app/~~esApiDWs20Ysbg0-nzwOgA==/com.builtaccounting.app-L96rXWncAO_QaIIDmYp3Pw==/base.apk"],nativeLibraryDirectories=[/data/app/~~esApiDWs20Ysbg0-nzwOgA==/com.builtaccounting.app-L96rXWncAO_QaIIDmYp3Pw==/lib/arm64, /data/app/~~esApiDWs20Ysbg0-nzwOgA==/com.builtaccounting.app-L96rXWncAO_QaIIDmYp3Pw==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at androidx.activity.compose.ComponentActivityKt.setContent(ComponentActivity.kt:55) 
at androidx.activity.compose.ComponentActivityKt.setContent$default(ComponentActivity.kt:51) 
at io.intercom.android.sdk.m5.IntercomRootActivity.onCreate(IntercomRootActivity.kt:22) 
at android.app.Activity.performCreate(Activity.java:8767) 
at android.app.Activity.performCreate(Activity.java:8745) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1519) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3928) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4126) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:108) 
at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:195) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:157) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:90) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2544) 
at android.os.Handler.dispatchMessage(Handler.java:107) 
at android.os.Looper.loopOnce(Looper.java:232) 
at android.os.Looper.loop(Looper.java:317) 
at android.app.ActivityThread.main(ActivityThread.java:8501) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878) 

 

Userlevel 3
Badge +4

Hi eyeboah,

Please reach out to us via Messenger chat in your workspace to flag this issue to our engineers.

Hi @mateusz.leszkiewicz I am using the latest React Native SDK which is exist in my package.js as 

"@intercom/intercom-react-native": "^7.1.1"


 

Userlevel 3
Badge +4

Hi Roy Paal

As I wrote above this looks like a bigger issue that concerns more than one customer. Please reach out to us via Messenger in your workspace to flag this issue to our engineers to investigate.

hi, I got the same issue, any update?
my version is 7.1.1

any update. I am facing same issue with expo 49.0.23, react native 0.72.10 and intercom 7.1.1 
this is started when I updated intercom from 6.2.0 to 7.1.1

update → I tried intercom sdk 7.1.2 . but while building app it throws error

 

FAILURE: Build failed with an exception.2350* What went wrong:2351Execution failed for task ':app:mergeExtDexDebug'.2352> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.2353   >2354Failed to transform vectordrawable-animated-1.2.0.aar (androidx.vectordrawable:vectordrawable-animated:1.2.0) to match attributes {artifactType=android-dex, asm-transformed-variant=debug, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=26, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.2355      > Execution failed for DexingNoClasspathTransform: /home/expo/.gradle/caches/transforms-3/61fbd2d6bb0af5d5c58be5bdf34d5bba/transformed/vectordrawable-animated-1.2.0-runtime.jar.2356         > Error while dexing.2357   > Failed to transform vectordrawable-1.2.0.aar (androidx.vectordrawable:vectordrawable:1.2.0) to match attributes {artifactType=android-dex, asm-transformed-variant=debug, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=26, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.2358      > Execution failed for DexingNoClasspathTransform: /home/expo/.gradle/caches/transforms-3/50176a6ae802ad8f7d427a38f7d88a26/transformed/vectordrawable-1.2.0-runtime.jar.2359         > Error while dexing.

update→  I have downgraded intercom sdk to 7.0.1 and the error is gone for now

Userlevel 3
Badge +4

Hi Trinh Nguyen & Yogesh Vitekar please reach out to us via Messenger in your workspace to flag this issue for our engineers. 

I got the same issue with intercom-react-native 7.1.3 and the error is gone when using version 7.0.1.

When developing a React Native app for Android, encountering crashes when calling intercom.present() can be frustrating. Here are some steps and potential solutions to troubleshoot and resolve the issue:

Steps to Troubleshoot:

  1. Check Dependencies and Versions: Ensure that all dependencies, including React Native and the Intercom SDK, are compatible. Refer to the official documentation for basketballshoes version compatibility.

  2. Review Configuration: Verify that the Intercom configuration in AndroidManifest.xml and build.gradle is correct. Ensure you have added all required permissions and metadata.

  3. Logs and Error Messages: Check the logcat output for any specific error messages when the crash occurs. This can provide insight into what might be going wrong.

  4. Intercom Initialization: Ensure that Intercom is properly initialized before calling intercom.present(). Initialization should typically be done in your main activity or application class.

  5. Network Issues: Ensure that the device has network connectivity. Intercom requires internet access to function properly.

  6.  

     

    Potential Solutions:

    1. Update Intercom SDK:

    Ensure you are using the latest version of the Intercom SDK. Sometimes, issues are resolved in newer versions.

     

    gradle

    Copy code

    // build.gradle (app level) dependencies { implementation 'io.intercom.android:intercom-sdk:latest_version' }

    Replace latest_version with the actual latest version number.

    2. Proper Initialization:

    Make sure Intercom is initialized correctly in your MainApplication.java or MainActivity.java.

     

    java

    Copy code

    // MainApplication.java import io.intercom.android.sdk.Intercom; public class MainApplication extends Application { @Override public void onCreate() { super.onCreate(); Intercom.initialize(this, "your_android_api_key", "your_app_id"); } }

    Ensure you replace your_android_api_key and your_app_id with your actual Intercom API key and App ID.

    3. Correct Permissions:

    Ensure you have added the required permissions in your AndroidManifest.xml.

     

    xml

    Copy code

    <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <application> <meta-data android:name="io.intercom.android.sdk.ApiKey" android:value="your_android_api_key" /> <meta-data android:name="io.intercom.android.sdk.AppId" android:value="your_app_id" /> </application>

    4. Ensure React Native Link:

    Ensure that the React Native module is properly linked. If you're using React Native 0.60 or higher, auto-linking should handle this, but if you're on an older version, you may need to manually link the library.

     

    sh

    Copy code

    react-native link react-native-intercom

    5. Handle Lifecycle Events:

    Ensure that Intercom's lifecycle methods are handled correctly, especially if you have customized lifecycle methods in your app.

     

    java

    Copy code

    // MainActivity.java import io.intercom.android.sdk.Intercom; public class MainActivity extends ReactActivity { @Override protected void onResume() { super.onResume(); Intercom.client().handlePushMessage(); } }

    6. Check for Conflicting Libraries:

    Sometimes, other libraries can conflict with Intercom. Make sure there are no conflicting dependencies.

    Example of Calling intercom.present():

     

    javascript

    Copy code

    import Intercom from 'react-native-intercom'; // Ensure Intercom is properly initialized and then call present Intercom.presentMessenger();

    Final Note:

    If the issue persists after trying the above steps, consider reaching out to Intercom support with detailed logs and a description of the problem. Additionally, consulting community forums like Stack Overflow or GitHub issues for the react-native-intercom library might provide further insights from other developers who have faced similar issues.

     

     

     

     

    4o

     

Reply