expo: [Expo 42] Bare app build failing
Edit Due to a mix of different underlying causes, we have locked this issue. Please read through this comment to find out how you can resolve this issue.
Summary
Android app fails to build on Task :unimodules-react-native-adapter:compileDebugJavaWithJavac
Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!
bare
What platform(s) does this occur on?
Android
SDK Version (managed workflow only)
No response
Environment
Expo CLI 4.7.2 environment info: System: OS: Windows 10 10.0.19043 Binaries: Node: 14.17.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD SDKs: Android SDK: API Levels: 26, 29, 30 Build Tools: 29.0.2, 30.0.3 System Images: android-28 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-S | Google Play Intel x86 Atom_64 IDEs: Android Studio: Version 4.2.0.0 AI-202.7660.26.42.7351085 npmPackages: expo: ~42.0.0 => 42.0.0 react: 16.13.1 => 16.13.1 react-dom: 16.13.1 => 16.13.1 react-native: ~0.63.4 => 0.63.4 react-native-web: ~0.13.12 => 0.13.18 Expo Workflow: bare
Reproducible demo or steps to reproduce from a blank project
Initialize a new Expo Bare App
Setup typescript (only creating the tsconfig.json and installing the deps when prompted by expo start)
Add eslint (config universe/native and the plugin simple-import-sort)
Try to yarn android and it shoud fail on the task mentioned above
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 30 (8 by maintainers)
Unfortunately, its still failing. Getting this below error.
Hey all! I’m sorry for this issue and I can confirm this happens on Windows. I created a patch to fix this, I hope we can roll this out asap. If you absolutely need this to work, including on CI, you can work with
patch-packageuntil it is released.You’ll need to create a file in
patches/@unimodules+react-native-adapter+6.3.1.patch, with this content:Here is a short guide to set that up:
yarn add --dev patch-packagepackage.json"scripts": { "postinstall": "patch-package" }patchesmkdir patchespatches/@unimodules+react-native-adapter+6.3.1.patchyarnto apply the patchIf you commit the patch and changes in your
package.json, this is applied in CI, classic build, and on EAS.Hope this helps!
I knew this was happening. Solved it one hour after updating my unimodules. Tried to make a pull request, but too much burocracy.
at node_modules/@unimodules/react-native-adapter/scripts/autolinking.gradle , at line 97:
'require("expo-modules-autolinking")(process.argv.slice(1))',switch the quotes like this:
"require('expo-modules-autolinking')(process.argv.slice(1))",I’ve also made the changes mentioned in this commit about the unimodules implementation, but I don’t know if this is needed for it to build, since I’ve found out the solution above later:
[ios][android] New autolinking implementation in TypeScript (#11593)
I guess it is the undocumented “new way” to implement unimodules?
oh yep I missed that…🙉
Are there any more details on the build failure? I was having an issue specifically with
symbol not found ExpoModulesPackageListand it turns out thatexpo-modules-autolinkingrequires Node 14. I was on Node 12 and it’s fixed it by updating to 14.I can confirm that it’s still a problem. Similar configuration as @kalvin807
@unimodules/react-native-adapter@6.3.2v14.17.0Update: Tried it now on another Mac, cloned the project anew and the build fails with the same error.
Patch has been released! Please use
@unimodules/react-native-adapter@6.3.2(latest). If you want to check your local version:$ yarn why @unimodules/react-native-adapter$ npm list @unimodules/react-native-adapterIt should be installed automatically, but if it doesn’t make sure to regenerate your lockfile.
I finally made it work by the following steps, it will help anyone who come across this. Thanks for everyone advice!
Running
expo upgradedoes nothing, instead, it downgradesreact-native-unimodulesfrom 0.14.3 to 0.14.2 The lock file still shows"@unimodules/react-native-adapter" "~6.3.1"even afterexpo upgradeunderreact-native-unimodules@~0.14.3andexpo@^42.0.0:And of course the build is failing, you have more info in the log I posted yesterdayMy yarn.lock file:
Manually changing those to “@unimodules/react-native-adapter” “~6.3.2” does nothing, build still fails on AppCenter CI
Upgrading node from v12 to v14 and applying that patch worked for me, thanks @valascus & @byCedric!