Task :app:transformClassesAndResourcesWithR8ForRelease FAILED React Native - javascript

R8 is the new Android code shrinker. If you experience any issues, please file a bug at
https://issuetracker.google.com, using 'Shrinker (R8)' as component name. You can
disable R8 by updating gradle.properties with 'android.enableR8=false'.
Current version is: 1.4.94 (build 390954928f0db9c3b888a367f7f128ce3bbfb160 from go/r8bot (luci-r8-ci-archive-0-5g74)).
D8: Program type already present: com.oney.WebRTCModule.BuildConfig
What went wrong:
Execution failed for task :app:transformClassesAndResourcesWithR8ForRelease.
com.android.tools.r8.CompilationFailedException: Compilation failed to complete
The android.enableR8=false is as it is but still after running ./gradlew bundleRelease it is showing me this error.

Related

Getting EISDIR error from NodeJS when attempting to start app via Expo (React Native)

I'm getting the old 'directory is not a file' error with Node, and the output does not make it clear what exactly it's trying to parse. I've tried putting logging in and everything to find the issue, and even created a brand new project but the issue persists. Can anyone shed any light on this?
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (fs.js:592:3)
at tryReadSync (fs.js:366:20)
at Object.readFileSync (fs.js:403:19)
at UnableToResolveError.buildCodeFrameMessage (C:\Users\thepo\Applications\WakeMyPC\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:304:17)
at new UnableToResolveError (C:\Users\thepo\Applications\WakeMyPC\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:290:35)
at ModuleResolver.resolveDependency (C:\Users\thepo\Applications\WakeMyPC\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:168:15)
at DependencyGraph.resolveDependency (C:\Users\thepo\Applications\WakeMyPC\node_modules\metro\src\node-haste\DependencyGraph.js:353:43)
at C:\Users\thepo\Applications\WakeMyPC\node_modules\metro\src\lib\transformHelpers.js:271:42
at C:\Users\thepo\Applications\WakeMyPC\node_modules\metro\src\Server.js:1098:37
at Generator.next (<anonymous>)
The problem turned out to be that some of the versions of modules that I installed using npm were not compatible with expo. These were indicated earlier than the error in the output for the 'expo start' command. Because these were info logs, I didn't pay enough attention to them. However, after several hours I decided to fix them and it fixed my problem.
The fix was to follow each individual package named in the output and run 'expo install '.
Make sure the entryPoint key in your app.config.js or app.json file is correctly set.
I had an intermittent error very similar to this and it was related to a bug with remote debugging.
Turning off "Debug Remote JS" in the Expo Go app shake-to-show developer menu avoided this issue for me (logs and errors still show in the Metro console).
Here's the exact error message I was getting (and sometimes the app would just fail silently without any error). It's almost identical to the error in the question with a few different line numbers (maybe from different versions).
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (node:fs:721:3)
at tryReadSync (node:fs:431:20)
at Object.readFileSync (node:fs:477:19)
at UnableToResolveError.buildCodeFrameMessage
As for "why", there's some related discussion on this expo forum thread which in turn links to this React Native bug (claimed to be fixed in Expo CLI 4.13.1 but many users reporting similar issues in recent versions).
It might be related to the reported issues with Reanimated 2 and Expo's remote debugging (see this reanimated issue and the warning note in Expo's documentation) for Reanimated.

How to restrict to make a build of react project if version is not changed/upgraded in package.json file

I want to enable production-level restriction in building to react application. I want that if I do not change the version of react application it should give me an error during the build process with the error message "Change the react version in Package.json file". How do I accomplish this strategy
Call the global process object's exit method
Node.js will normally exit with a 0 status code when no more async operations are pending. The following status codes are used in other cases:
1 Uncaught Fatal Exception: There was an uncaught exception, and it was not handled by a domain or an 'uncaughtException' event handler.
For more information about exit codes you can take a look at process_exit_codes
Note: I did not tried to stop a build but you can try the following:
const REACT_VERSION = React.version;
console.log(REACT_VERSION)
if(REACT_VERSION <= "16.6.3"){
console.log("Change the react version in Package.json file, the current version is smaller than the lastes available!")
process.exit(1);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.4.1/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.4.1/umd/react-dom.production.min.js"></script>

Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'

I am developing a mobile app with using react-native on WebStorm and trying to test it via an Android emulator(Pixel API 28) which I created via using AVD Manager of Android Studio. The problem is when I run the react-native run-android command, I get the following error:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration
':app:debugRuntimeClasspath'.
> Could not resolve com.facebook.react:react-native:+.
Required by:
project :app
> Failed to list versions for com.facebook.react:react-native.
> Unable to load Maven meta-data from
https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
> Could not HEAD
'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/35.158.228.205, jcenter.bintray.com/3.120.47.203] failed: Read timed out
I tried to clean up the cache with using the command below but it did not worked:
npm cache clean --force
I could not find some similar problems on the web and I am not sure what to show related with this problem.
When I try to run one of my previous project which was perfectly running, after getting this error and I saw that it also throws the same error. Similarly, when I create a new react-native project and try to run it, then I also got the same error. How can I solve this?
I am still loking for a solution. Anyone knows how to solve it?
I finally figured out the problem. I was connecting to internet via my school's network and it was restricting some downloads. So, that is why I got this error. For the ones who encountered with the same error, try to connect to the link in the error to if it is forbidden or not.

React native maps Execution failed for task ':react-native-maps:checkDebugManifest'

The maps library works fine in a old project with react native where react-native version is 0.55.3 and react native maps is 0.23.0
In a new project after setting up, Android that is, while building the app I keep getting the following error:
info JS server already running.
info Building and installing the app on the device (cd android && ./gradlew app:installAgroShopDebug)...
> Configure project :app
WARNING: API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getAssemble(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
> Task :react-native-maps:checkDebugManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-maps:checkDebugManifest'.
> Failed to create parent directory '/home/shockwav3/Downloads/mFarming/newRN/mFarming/node_modules/react-native-maps/lib/android/build/intermediates/check_manifest_result' when creating directory '/home/shockwav3/Downloads/mFarming/newRN/mFarming/node_modules/react-native-maps/lib/android/build/intermediates/check_manifest_result/debug/checkDebugManifest/out'
Help would be very much appreciated.
I faced a similar issue when I upgraded react-native. Strangely I fixed it by running metro with sudo

Flow crashing on Windows 10

Version 0.74.0
Crashes on any flow command with error:
Fatal error: exception Unix.Unix_error(62, "socketpair", "")
Other repositories on my machine using flow work fine, as did this project until recently (i.e. I did not change the version)
This issue was caused by a firewall setting.

Categories