question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[eas][android] expo-branch cause app crash

See original GitHub issue

Summary

Look like double-linking causes a crash on Android. How I can exclude expo-branch on android?

E AndroidRuntime: FATAL EXCEPTION: create_react_context
E AndroidRuntime: Process: XXXXX PID: 10110
E AndroidRuntime: java.lang.IllegalStateException: Native module RNBranch tried to override RNBranchModule. Check the getPackages() method in MainApplication.java, it might be that module is being created twice. If this was your intention, set canOverrideExistingModule=true. This error may also be present if the package is present only once in getPackages() but is also automatically added later during build time by autolinking. Try removing the existing entry and rebuild.
E AndroidRuntime: 	at com.facebook.react.NativeModuleRegistryBuilder.processPackage(NativeModuleRegistryBuilder.java:55)
E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager.processPackage(ReactInstanceManager.java:1347)
E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager.processPackages(ReactInstanceManager.java:1318)
E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1225)
E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:131)
E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1016)
E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:919)

Can I use this config to exclude? https://github.com/expo/expo/blob/422beec748adabbf0f6be3922e9a7ea6170fb8a2/apps/bare-expo/package.json#L36-L53

Or this config? https://github.com/expo/expo/blob/1e001f80d902303a40e370c7b996b01c3b088119/apps/bare-expo/package.json#L36-L66

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

41.0.0

Environment

EAS build

Reproducible demo or steps to reproduce from a blank project

none,

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:27 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
wodincommented, May 24, 2022

Yes, the presence of android/ios directories means you have a “bare” app, rather than a managed app.

See here: https://forums.expo.dev/t/should-i-exclude-ios/63094/4?u=wodin

1reaction
dmitryamecommented, May 23, 2022

I’m coming to the conclusion that ios/ and android/ folders are only needed on the local box to be able to run the apps on Simulator directly (opposed to Expo go) – there is no need to version control these folders, they will be re-generated on the eas build server (or on local) as needed.

It all finally works! Thank you for your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo Branch crash on Android - Expo SDK - Forums
In my managed app, Android production builds crash on launch. It seems to have something to do with expo-branch, but I'm not sure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found