Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Expo SDK 51] [Android] [expo-dev-client] Crash when opening dev build #29047

Closed
frederikocmr opened this issue May 22, 2024 · 2 comments
Closed
Labels
Development Builds needs review Issue is ready to be reviewed by a maintainer

Comments

@frederikocmr
Copy link
Contributor

frederikocmr commented May 22, 2024

Summary

After generating the development apk for Android, as soon as I open it, it crashes with no other information. I don't even get to the point of opening/loading my local project.

Managed or bare workflow?

bare

What platform(s) does this occur on?

Android

Package versions

  "dependencies": {
    "@bam.tech/react-native-image-resizer": "^3.0.9",
    "@expo/config-plugins": "~8.0.0",
    "@expo/prebuild-config": "~7.0.0",
    "@expo/vector-icons": "^14.0.0",
    "@react-native-async-storage/async-storage": "1.23.1",
    "@react-native-community/blur": "^4.4.0",
    "@react-native-community/datetimepicker": "^8.0.1",
    "@react-native-community/netinfo": "11.3.1",
    "@react-native-firebase/analytics": "^19.2.2",
    "@react-native-firebase/app": "^19.2.2",
    "@react-native-firebase/auth": "^19.2.2",
    "@react-native-firebase/crashlytics": "^19.2.2",
    "@react-native-firebase/firestore": "^19.2.2",
    "@react-native-firebase/messaging": "^19.2.2",
    "@react-native-firebase/remote-config": "^19.2.2",
    "@react-native-firebase/storage": "^19.2.2",
    "@react-navigation/bottom-tabs": "^6.5.20",
    "@react-navigation/drawer": "^6.6.15",
    "@react-navigation/material-top-tabs": "^6.6.13",
    "@react-navigation/native": "^6.1.17",
    "@react-navigation/native-stack": "^6.9.26",
    "@reduxjs/toolkit": "^2.2.5",
    "@tanstack/react-query": "^5.36.2",
    "@types/redux-logger": "^3.0.13",
    "algoliasearch": "^4.23.3",
    "axios": "^1.6.8",
    "babel-plugin-module-resolver": "^5.0.2",
    "expo": "^51.0.8",
    "expo-application": "~5.9.1",
    "expo-build-properties": "~0.12.1",
    "expo-camera": "~15.0.9",
    "expo-clipboard": "~6.0.3",
    "expo-constants": "~16.0.1",
    "expo-dev-client": "~4.0.14",
    "expo-device": "~6.0.2",
    "expo-file-system": "~17.0.1",
    "expo-font": "~12.0.5",
    "expo-image-picker": "~15.0.5",
    "expo-jwt": "^1.7.1",
    "expo-linking": "~6.3.1",
    "expo-localization": "~15.0.3",
    "expo-modules-autolinking": "~1.11.0",
    "expo-notifications": "~0.28.3",
    "expo-splash-screen": "~0.27.4",
    "expo-status-bar": "~1.12.1",
    "expo-store-review": "~7.0.2",
    "expo-system-ui": "~3.0.4",
    "expo-tracking-transparency": "~4.0.2",
    "expo-web-browser": "~13.0.3",
    "i18next": "^23.11.4",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-i18next": "^14.1.1",
    "react-instantsearch-core": "^7.8.1",
    "react-native": "0.74.1",
    "react-native-device-info": "^11.1.0",
    "react-native-fbsdk-next": "^13.0.0",
    "react-native-gesture-handler": "~2.16.1",
    "react-native-google-mobile-ads": "^13.3.0",
    "react-native-image-crop-picker": "^0.41.1",
    "react-native-marked": "^6.0.4",
    "react-native-mathjax-html-to-text-svg": "^1.0.14",
    "react-native-pager-view": "6.3.0",
    "react-native-paper": "^5.12.3",
    "react-native-purchases": "7.27.1",
    "react-native-reanimated": "~3.10.1",
    "react-native-render-html": "^6.3.4",
    "react-native-root-siblings": "^5.0.1",
    "react-native-root-toast": "^3.6.0",
    "react-native-safe-area-context": "4.10.1",
    "react-native-screens": "3.31.1",
    "react-native-svg": "15.2.0",
    "react-native-tab-view": "^3.5.2",
    "react-native-web": "~0.19.10",
    "react-redux": "^9.1.2",
    "reactotron-react-native": "^5.1.7",
    "reactotron-redux": "^3.1.9",
    "redux-logger": "^3.0.6",
    "redux-persist": "^6.0.0",
    "rive-react-native": "^7.0.4",
    "rn-emoji-keyboard": "^1.7.0",
    "zustand": "^4.5.2"
  },
  "devDependencies": {
    "@babel/core": "^7.24.0",
    "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
    "@types/react": "~18.2.45",
    "@typescript-eslint/parser": "^7.9.0",
    "eslint": "^9.2.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-config-prettier": "^9.1.0",
    "eslint-import-resolver-typescript": "^3.6.1",
    "eslint-plugin-import": "^2.29.1",
    "eslint-plugin-jsx-a11y": "^6.8.0",
    "eslint-plugin-prettier": "^5.1.3",
    "eslint-plugin-react": "^7.34.1",
    "eslint-plugin-react-hooks": "^4.6.2",
    "jest": "^29.7.0",
    "jest-expo": "~51.0.2",
    "prettier": "^3.2.5",
    "react-test-renderer": "18.3.1",
    "typescript": "~5.3.3"
  },

Environment

  expo-env-info 1.2.0 environment info:
    System:
      OS: macOS 14.5
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 21.7.3 - /usr/local/bin/node
      Yarn: 1.22.19 - ~/.yarn/bin/yarn
      npm: 10.5.0 - /usr/local/bin/npm
      Watchman: 2023.05.01.00 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.15.2 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 23.2, iOS 17.2, macOS 14.2, tvOS 17.2, visionOS 1.0, watchOS 10.2
    IDEs:
      Android Studio: 4.2 AI-202.7660.26.42.7351085
      Xcode: 15.2/15C500b - /usr/bin/xcodebuild
    npmPackages:
      expo: ^51.0.8 => 51.0.8 
      react: 18.2.0 => 18.2.0 
      react-dom: 18.2.0 => 18.2.0 
      react-native: 0.74.1 => 0.74.1 
      react-native-web: ~0.19.10 => 0.19.11 
    npmGlobalPackages:
      eas-cli: 9.0.8
      expo-cli: 6.3.10
    Expo Workflow: bare

Reproducible demo

The APK was build via EAS Build with the following configs:

    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "resourceClass": "large",
      "android": {
        "buildType": "apk"
      },
      "env": {
        "APP_VARIANT": "development"
      }
    },

Based on the logs, I can see that the problem is related to the Koin methods and NoSuchMethodError:
AndroidRuntime: java.lang.NoSuchMethodError: No static method koinApplication(Lkotlin/jvm/functions/Function1;)Lorg/koin/core/KoinApplication; in class Lorg/koin/dsl/KoinApplicationKt; or its super classes (declaration of 'org.koin.dsl.KoinApplicationKt' appears in .

By searching online, I found out this comment:

For 3.5, I've added API check & propose to add the following koinApplication function, in order to let you control eager instance creation:

fun koinApplication(createEagerInstances : Boolean = true, appDeclaration: KoinAppDeclaration? = null): KoinApplication {
    val koinApplication = KoinApplication.init()
    appDeclaration?.invoke(koinApplication)
    if (createEagerInstances) {
        koinApplication.createEagerInstances()
    }
    return koinApplication
}

currently in bbd18de.

@arnaudgiuliani This caused yet another incompatibility that suddenly there is no method with signature org.koin.core.KoinApplication org.koin.dsl.KoinApplicationKt.koinApplication(kotlin.jvm.functions.Function1), causing a java.lang.NoSuchMethodError crash for the SDK I work on.

No need to resolve this issue now. Just wanted you to be aware of this.

Originally posted by @insiderser in InsertKoinIO/koin#1369 (comment)

Stacktrace (if a crash is involved)

05-22 11:43:04.016 11844 11897 D FBAudienceNetwork: SDK dex loading time: 178
05-22 11:43:04.031 11844 11844 W SoLoader: SoLoader initialized: 8
05-22 11:43:04.085 11844 11844 D AndroidRuntime: Shutting down VM
05-22 11:43:04.087 11844 11844 E AndroidRuntime: FATAL EXCEPTION: main
05-22 11:43:04.087 11844 11844 E AndroidRuntime: Process: com.abc.hwai, PID: 11844
05-22 11:43:04.087 11844 11844 E AndroidRuntime: java.lang.NoSuchMethodError: No static method koinApplication(Lkotlin/jvm/functions/Function1;)Lorg/koin/core/KoinApplication; in class Lorg/koin/dsl/KoinApplicationKt; or its super classes (declaration of 'org.koin.dsl.KoinApplicationKt' appears in /data/app/~~auYJ9HPiKil412I0EARfwg==/com.abc.hwai-am4htYjZWhSEdetq1OlIfQ==/base.apk!classes10.dex)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.devlauncher.koin.DevLauncherKoinAppKt$koinAppFactory$1.invoke(DevLauncherKoinApp.kt:29)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.devlauncher.koin.DevLauncherKoinAppKt$koinAppFactory$1.invoke(DevLauncherKoinApp.kt:28)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.devlauncher.koin.DevLauncherKoinContext.<clinit>(DevLauncherKoinApp.kt:35)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.devlauncher.DevLauncherController$Companion.wasInitialized(DevLauncherController.kt:382)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.devlauncher.rncompatibility.DevLauncherReactNativeHostHandler.getUseDeveloperSupport(DevLauncherReactNativeHostHandler.kt:21)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.ReactNativeHostWrapperBase$getUseDeveloperSupport$1.invoke(ReactNativeHostWrapperBase.kt:72)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.ReactNativeHostWrapperBase$getUseDeveloperSupport$1.invoke(ReactNativeHostWrapperBase.kt:72)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:170)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at kotlin.sequences.SequencesKt___SequencesKt.firstOrNull(_Sequences.kt:168)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.ReactNativeHostWrapperBase.getUseDeveloperSupport(ReactNativeHostWrapperBase.kt:73)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.ExpoReactHostFactory.createFromReactNativeHost(ExpoReactHostFactory.kt:93)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.ReactNativeHostWrapper$Companion.createReactHost(ReactNativeHostWrapper.kt:53)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at com.abc.hwai.MainApplication.getReactHost(MainApplication.kt:40)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.devlauncher.DevLauncherController$Companion.initialize(DevLauncherController.kt:430)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.devlauncher.DevLauncherController$Companion.initialize$default(DevLauncherController.kt:429)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.devlauncher.DevLauncherPackageDelegate$createApplicationLifecycleListeners$1.onCreate(DevLauncherPackageDelegate.kt:38)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at expo.modules.ApplicationLifecycleDispatcher.onApplicationCreate(ApplicationLifecycleDispatcher.kt:20)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at com.abc.hwai.MainApplication.onCreate(MainApplication.kt:49)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1211)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6725)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at android.app.ActivityThread.access$1500(ActivityThread.java:247)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7839)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
05-22 11:43:04.087 11844 11844 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
05-22 11:43:04.097 11844 11905 E com.facebook.GraphResponse: {HttpStatus: 400, errorCode: 190, subErrorCode: -1, errorType: OAuthException, errorMessage: Invalid OAuth access token signature.}
05-22 11:43:04.108 11844 11900 E com.facebook.GraphResponse: {HttpStatus: 400, errorCode: 190, subErrorCode: -1, errorType: OAuthException, errorMessage: Invalid OAuth access token signature.}
05-22 11:43:04.122 11844 11904 E com.facebook.GraphResponse: {HttpStatus: 400, errorCode: 190, subErrorCode: -1, errorType: OAuthException, errorMessage: Invalid OAuth access token signature.}
05-22 11:43:04.127 11844 11905 E com.facebook.GraphResponse: {HttpStatus: 400, errorCode: 190, subErrorCode: -1, errorType: OAuthException, errorMessage: Invalid OAuth access token signature.}
05-22 11:43:04.160 11844 11904 E com.facebook.GraphResponse: {HttpStatus: 400, errorCode: 190, subErrorCode: -1, errorType: OAuthException, errorMessage: Invalid OAuth access token signature.}
05-22 11:43:04.201 11844 11885 W FirebaseCrashlytics: Unable to read App Quality Sessions session id.
05-22 11:43:04.228 11844 11885 D libcrashlytics: Initializing libcrashlytics version 3.2.0
05-22 11:43:04.230 11844 11885 D libcrashlytics: Initializing native crash handling successful.
05-22 11:43:04.242  4483 11926 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
05-22 11:43:04.242  4483  4553 W ActivityTaskManager:   Force finishing activity com.abc.hwai/.MainActivity
05-22 11:43:04.246   355 20774 D goldfish-address-space: claimShared: Ask to claim region [0x3f7660000 0x3f7c8c000]
05-22 11:43:04.297  4483  4515 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
05-22 11:43:04.298  4483  4515 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
05-22 11:43:04.298 11844 11844 I Process : Sending signal. PID: 11844 SIG: 9
05-22 11:43:04.344  4483  4517 I libprocessgroup: Successfully killed process cgroup uid 10154 pid 11844 in 0ms
05-22 11:43:04.344  4483  4497 I ActivityManager: Process com.abc.hwai (pid 11844) has died: prcp TOP 
05-22 11:43:04.348  4417  4417 I Zygote  : Process 11844 exited due to signal 9 (Killed)
05-22 11:43:04.349 10099 10099 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms }
05-22 11:43:04.368  4483  4497 W InputManager-JNI: Input channel object '57de802 Splash Screen com.abc.hwai (client)' was disposed without first being removed with the input manager!
@frederikocmr frederikocmr added Development Builds needs validation Issue needs to be validated labels May 22, 2024
@expo-bot expo-bot added needs review Issue is ready to be reviewed by a maintainer and removed needs validation Issue needs to be validated labels May 22, 2024
@frederikocmr frederikocmr changed the title Dev Client crashing when opening [Expo SDK 51] [Android] [expo-dev-client] Crash when opening dev build May 22, 2024
@gfaraj
Copy link

gfaraj commented May 27, 2024

Any workaround for this issue yet? I'm seeing this too.

@frederikocmr
Copy link
Contributor Author

frederikocmr commented Jun 12, 2024

Any workaround for this issue yet? I'm seeing this too.

Hello, I removed every part of my project and added one by one again until I found the problem.

Was related to the Ads Mediation with Admob library, specifically the Unity Ads mediation.
The temporary solution was to remove it completely from my project:

build.gradle:

    - implementation("com.unity3d.ads:unity-ads:4.11.3")
    - implementation("com.google.ads.mediation:unity:4.11.3.0")

AdsAndroidModule.kt:

     - import com.unity3d.ads.metadata.MetaData
... 
     - val gdprMetaData = MetaData(reactContext)
     - gdprMetaData["gdpr.consent"] = consentGiven
     - gdprMetaData.commit()

It happened also on SDK 50. Related to the newest changes to React Native/Kotlin.

Since it's not exactly related to expo, I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development Builds needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants