When this error occur in react native : transformClassesWithDexBuilderForDebug? - javascript

When i try to install my react native app on device it shows following error :-
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /home/user28/.gradle/caches/transforms-1/files-1.1/exoplayer-core-2.9.1.aar/227c237efe9029fa4a76003d6795431d/jars/classes.jar
And i could not understand how to solve it. My app runs correctly but after installing react-native-video dependency it shows following error.Help me to get out from this.

Add the following to your app/build.gradle file:
android {
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
}
}

Related

How to Fix "Task :*:extractReleaseAnnotations FAILED"?

I created an application using React Native framework.
debug version runs great but extractReleaseAnnotations error occurs when i try to build release version.
Error log for react-native-connectivity-status :
> Task :react-native-connectivity-status:extractReleaseAnnotations FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-connectivity-status:extractReleaseAnnotations'.
> Could not resolve all files for configuration ':react-native-connectivity-status:lintClassPath'.
> Could not find kotlin-compiler-27.2.2.jar (com.android.tools.external.com-intellij:kotlin-compiler:27.2.2).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/27.2.2/kotlin-compiler-27.2.2.jar
VSCode : v1.65.0
React Native : 0.67.2
React JS : 17.0.2
OS : Windows 11.0.22557.1
Any solutions?

couldn't find "libaw_video.so" react-native native android sdk integration

While creating a react-native module for Integrating some native android code and AAR files giving this error and app crashes.
Used this in app-level build.gradle
packagingOptions {
pickFirst '**/*.so'
}
and added all *.so files in jinLibs and write this in build.Gradle(one which is in my module "react-native-test-lib")
sourceSets {
main {
jniLibs.srcDirs = ['src/main/jnilibs']
}
}
The app crashes with the error "couldn't find libaw_video.so"

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>

Task :app:transformClassesAndResourcesWithR8ForRelease FAILED React Native

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.

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

Categories