Upgrading to react-native v0.59.9.
Receive Cannot find module '../#react-native-community/cli' at /node_modules/react-native/cli.js:12:11 when attempting to build release version with command node node_modules/react-native/cli.js bundle --platform android --dev false --reset-cache --entry-file index.js --bundle-output /var/lib/jenkins/jobs/Build-Deploy-Mobile-App-Android/workspace/src/mobile/Tresta/android/app/build/generated/assets/react/release/index.android.bundle --assets-dest /var/lib/jenkins/jobs/Build-Deploy-Mobile-App-Android/workspace/src/mobile/Tresta/android/app/build/generated/res/react/release
Deleted node_modules directory to solve different problem, and did an npm install.
Can execute react-native run-android locally.
The line is var cli = require('#react-native-community/cli');
#react-native-community is at same directory level at react-native.
I do not see anything in the #react-native-community/cli directory that require could load :
jest.config.js node_modules package.json README.md setup_env.sh testSetup.js```
react-native info
info
React Native Environment Info:
System:
OS: macOS 10.14.5
CPU: (8) x64 Intel(R) Core(TM) i7-4850HQ CPU # 2.30GHz
Memory: 118.64 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.15.0 - ~/.nvm/versions/node/v8.15.0/bin/node
npm: 6.9.0 - ~/.nvm/versions/node/v8.15.0/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28
Build Tools: 23.0.1, 23.0.3, 25.0.0, 25.0.2, 26.0.1, 27.0.3, 28.0.3
System Images: android-24 | Google Play Intel x86 Atom, android-25 | Intel x86 Atom_64, android-25 | Google APIs ARM 64 v8a, android-25 | Google APIs Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64
IDEs:
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.59.9 => 0.59.9
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
react-native: 0.59.9
My mistake. Was told to .gitignore build directories. Obviously react-native-community/cli needs its build directory.
Related
Environment
OS: macOS Mojave 10.14.6
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU # 2.60GHz
Memory: 140.81 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.4.0 - /var/folders/vb/yvc825yd15ldmskwnwtrpsnjdgvdj0/T/yarn--1596208558025-0.4815624974976791/node
Yarn: 1.19.0 - /var/folders/vb/yvc825yd15ldmskwnwtrpsnjdgvdj0/T/yarn--1596208558025-0.4815624974976791/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.1, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
Android SDK:
API Levels: 28, 29
Build Tools: 27.0.3, 28.0.3, 29.0.1, 29.0.2
System Images: android-19 | Intel x86 Atom, android-19 | Google APIs Intel x86 Atom, android-21 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6392135
Xcode: 11.1/11A1027 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
npmGlobalPackages:
react-native-cli: 2.0.1
Upgrading version
From 0.59.5 to 0.61.5
Description
Duplicate Resources error while generating release APK
Upgraded react-from 0.59.5 to 0.61.5 version. After upgrade tried to generate release APK for the application but build failed with an exception stating duplicate resources for the assets. Tried a workaround by updating the below code in react.gradle file.
doLast {
def moveFunc = { resSuffix ->
File originalDir = file("$buildDir/generated/res/react/release/${resSuffix}");
if (originalDir.exists()) {
File destDir = file("$buildDir/../src/main/res/${resSuffix}");
ant.move(file: originalDir, tofile: destDir);
}
}
moveFunc.curry("drawable-ldpi").call()
moveFunc.curry("drawable-mdpi").call()
moveFunc.curry("drawable-hdpi").call()
moveFunc.curry("drawable-xhdpi").call()
moveFunc.curry("drawable-xxhdpi").call()
moveFunc.curry("drawable-xxxhdpi").call()
moveFunc.curry("raw").call()
}
Now after the above workaround we are able to generate release APK successfully but in the generated APK none of the images are present since they get removed but we need to use those images.
Reproducible demo
Run ./gradlew assembleRelease to get this error.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
[drawable-mdpi-v4/toasset] /path/toasset.png
Why we created a new issue?
React Native : Error: Duplicate resources - Android - provides step to overcome the build failure by removing the images but we need those images to be in the final bundle.
This was a bug in canary versions of AGP 4.1. It has been fixed now and the fix will be included in 4.1-RC1.
It was because AGP tried to generate too many PNGs for vector drawables. To save yourself pain in the future, as well as improve your build speed and reduce APK size you can use the support library to instead handle vector drawables at runtime. You can use this feature by changing your build.gradle file:
android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
You can find more info about vector drawable support in support library in the documentation.
My project suddenly crashing on my Android 4.4 emulator and show this error at the end of
react-native run-android command. Build was successfully build and it's installed in my emulator. But immediately it crashes and shows below error.
BUILD SUCCESSFUL in 21s
65 actionable tasks: 65 executed
info Connecting to the development server...
adb: error: closed
warn Failed to connect to development server using "adb reverse": Command failed: /Users/samsudeenfaslurajan/Library/Android/sdk/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081
info Starting the app on "emulator-5554"...
Starting: Intent { cmp=com.royalvideoplayerlite/.MainActivity }
So I tried to open a new project using react-native init MYNEWPROJECT and tested again. Same crash happened again.
It's working fine with Android API Level 28
I can build APKs and install in any version of emulator. But Its working without crashing in API Level above 21 only.
I don't know what is the error.
info Fetching system and libraries information...
System:
OS: macOS 10.15.5
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU # 2.30GHz
Memory: 76.48 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.18.1 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 18, 19, 27, 28, 29, 30
Build Tools: 28.0.3, 29.0.2, 30.0.0
System Images: android-18 | Google APIs Intel x86 Atom, android-19 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6514223
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_252 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
#react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.0 => 0.63.0
npmGlobalPackages:
*react-native*: Not Found
Description
Executing npm i and react-native run-android in an existing rn project(iOSnormally), ran successfully but error produced with red screen:
undefined is not an object (evaluating 'warnings.filter')
React Native version:
React Native Environment Info:
System:
OS: macOS 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i3-8100B CPU # 3.60GHz
Memory: 43.46 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 12.10.0 - /usr/local/bin/node
Yarn: 1.17.3 - ~/.yarn/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 23, 26, 27, 28
Build Tools: 23.0.1, 26.0.1, 27.0.3, 28.0.2, 28.0.3
System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-27 | Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.3.1/11C505 - /usr/bin/xcodebuild
npmPackages:
react: ^16.6.0-alpha.8af6728 => 16.13.1
react-native: 0.57.4 => 0.57.4
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-demo-for-npm: 1.0.16
react-native-update-cli: 0.1.0
Steps To Reproduce
Execute npm i in an existing project
run react-native run-android
Expected Results
Run Android successfully without any errors.
I have alredy searched many solutions for this issue, but unfortunately, no any solutions finally. Any help for this is appreciated. Thanks a lot in advance.
I think you should find the warnings variable in your codebase. If it is exists then maybe the error occured from that part. It could be an undefined so you should change code like
warnings && warnings.filter...
or
if(warnings) {
warnings.filter..
}
Hi I am getting following error. PFA
Error while updating property 'accessibilityRole' of a view managed by:RCTView
null
Invalid accessibility role value:tab
React Native Environment Info:
System:
OS: macOS 10.15.2
CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU # 1.80GHz
Memory: 53.47 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.6010548
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: ^0.59.10 => 0.59.10
Use exact version of
"native-base":"2.13.12"
"#react-native-community/toolbar-android": "0.1.0-rc.2",
delete node_module and npm install
Try the following.
cd android
gradlew clean
delete the following folders (if any of them exists)
/android/.gradle,
/android/build,
/android/app/build,
I want to use react-native on windows 10 which is newly installed.
I followed all instructions on https://facebook.github.io/react-native/docs/getting-started (React Native CLI Quickstart).
But when I use npx react-native run-android the JS server closed immediately!
How can I solve it?
My system info:
OS: Windows 10 10.0.18363
CPU: (8) x64 Intel(R) Core(TM) i7-4810MQ CPU # 2.80GHz
Memory: 9.97 GB / 15.88 GB
Binaries:
Node: 13.3.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 19, 23, 26, 27, 28, 29
Build Tools: 23.0.1, 26.0.3, 27.0.3, 28.0.3, 29.0.2
System Images: android-28 | Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.6010548
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
Have you installed Android Studio? Also, are you using the Expo version or Pure React Native version? One last thing is can you try to run this command; npm start or expo start?