expo / react-native-appearance

Access operating system appearance information (currently only light/dark mode) on iOS, Android, and web
MIT License
337 stars 40 forks source link

Crash on AppCenter build, but not local #51

Closed djMax closed 4 years ago

djMax commented 4 years ago

Somewhat new to RN, but not new to JS or iOS. So, I can run locally in sim and on device in Debug or Release xcode schemes. But when I run from an AppCenter distribution, I get this exception:

*** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Invariant Violation: Tried to register two views with the same name RNCAppearanceProvider', reason: 'Unhandled JS Exception: Invariant Violation: Tried to register two views with the same name RNCAppearanceProvider, stack:
<unknown>@25:286
<unknown>@181:340
<unknown>@629:385
v@2:1473
<unknown>@616:740
v@2:1473
<unknown>@614:665
v@2:1473
<unknown>@423:201
v@2:1473
<unknown>@6:90
v@2:1473
d@2:875
global code@669:3
'
*** First throw call stack:
(0x1bea715f0 0x1be793bcc 0x102288870 0x10230188c 0x102302298 0x1bea77760 0x1be948b40 0x1be949718 0x1022b7404 0x1022b94f0 0x1022b9254 0x1be7369a8 0x1be737524 0x1be714b3c 0x1be71554c 0x1be71e84c 0x1be788b74 0x1be78b740)

I haven't the foggiest idea where to begin...

djMax commented 4 years ago

I don't know precisely the fix yet, but I do know this is caused by two copies of react-nativea-appearance. I am using a monorepo, which is bleeding edge for RN it seems. So I was using yarn in the root, but then AppCenter was using npm in the RN app directory (blow up part 1). I fixed that, but then AppCenter can't find the react-native-cli, and their build step is not configurable. So I haven't solved that yet. But I think it's fair to say it has little to do with react-native-appearance.