I am trying to run a react native app. In the terminal I ran npx react-native init rn8
, then I open android Studio to upgrade AGP to version 7.1.3 and I also set distributionUrl=https://services.gradle.org/distributions/gradle-7.4.2-all.zip
in the file rn8androidgradlewrappergradle-wrapper.properties
. So I run npm run android
and I have this warning:
Task :app:stripDebugDebugSymbols
Unable to strip the following libraries, packaging them as they are: libbutter.so, libc++_shared.so, libevent-2.1.so, libevent_core-2.1.so, libevent_extra-2.1.so, libfabricjni.so, libfb.so, libfbjni.so, libflipper.so, libfolly_futures.so, libfolly_json.so, libglog.so, libglog_init.so, libimagepipeline.so, libjsc.so, libjscexecutor.so, libjsi.so, libjsijniprofiler.so, libjsinspector.so, liblogger.so, libmapbufferjni.so, libnative-filters.so, libnative-imagetranscoder.so, libreact_codegen_rncore.so, libreact_config.so, libreact_debug.so, libreact_nativemodule_core.so, libreact_render_animations.so, libreact_render_attributedstring.so, libreact_render_componentregistry.so, libreact_render_core.so, libreact_render_debug.so, libreact_render_graphics.so, libreact_render_imagemanager.so, libreact_render_leakchecker.so, libreact_render_mapbuffer.so, libreact_render_mounting.so, libreact_render_runtimescheduler.so, libreact_render_scheduler.so, libreact_render_telemetry.so, libreact_render_templateprocessor.so, libreact_render_textlayoutmanager.so, libreact_render_uimanager.so, libreact_utils.so, libreactnativeblob.so, libreactnativejni.so, libreactnativeutilsjni.so, libreactperfloggerjni.so, librrc_image.so, librrc_root.so, librrc_text.so, librrc_unimplementedview.so, librrc_view.so, libruntimeexecutor.so, libturbomodulejsijni.so, libyoga.so.
The build is successfull and the app works, but when I build the apk with command ./gradlew assembleRelease
in android folder, I have this warning:
Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Welcome to Metro!
Fast - Scalable - Integrated
info Writing bundle output to:, C:UsersemanuApprn8androidappbuildgeneratedassetsreactreleaseindex.android.bundle
info Writing sourcemap output to:, C:UsersemanuApprn8androidappbuildgeneratedsourcemapsreactreleaseindex.android.bundle.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 1 asset files
info Done copying assets
> Task :app:processReleaseMainManifest
Execution optimizations have been disabled for task ':app:processReleaseMainManifest' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:UsersemanuApprn8androidappbuildintermediatesnavigation_jsonreleasenavigation.json'. Reason: Task ':app:processReleaseMainManifest' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
[androidx.vectordrawable:vectordrawable-animated:1.0.0] C:Usersemanu.gradlecachestransforms-360134c6b86acadc5685250a34382945dtransformedvectordrawable-animated-1.0.0AndroidManifest.xml Warning:
Package name 'androidx.vectordrawable' used in: androidx.vectordrawable:vectordrawable-animated:1.0.0, androidx.vectordrawable:vectordrawable:1.0.1.
> Task :app:processReleaseManifest
Execution optimizations have been disabled for task ':app:processReleaseManifest' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:UsersemanuApprn8androidappbuildintermediatescompatible_screen_manifestrelease'. Reason: Task ':app:processReleaseManifest' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: 'C:UsersemanuApprn8androidappbuildintermediatesmerged_manifestreleaseAndroidManifest.xml'. Reason: Task ':app:processReleaseManifest' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:compressReleaseAssets
Execution optimizations have been disabled for task ':app:compressReleaseAssets' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:UsersemanuApprn8androidappbuildintermediatesassetsreleasemergeReleaseAssets'. Reason: Task ':app:compressReleaseAssets' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:sdkReleaseDependencyData
Execution optimizations have been disabled for task ':app:sdkReleaseDependencyData' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:UsersemanuApprn8androidappbuildintermediatesmetadata_library_dependencies_reportreleasedependencies.pb'. Reason: Task ':app:sdkReleaseDependencyData' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:mergeReleaseJavaResource
Execution optimizations have been disabled for task ':app:mergeReleaseJavaResource' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:UsersemanuApprn8androidappbuildintermediatesjava_resreleaseout'. Reason: Task ':app:mergeReleaseJavaResource' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:processReleaseManifestForPackage
Execution optimizations have been disabled for task ':app:processReleaseManifestForPackage' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:UsersemanuApprn8androidappbuildintermediatesmerged_manifestsrelease'. Reason: Task ':app:processReleaseManifestForPackage' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:mergeReleaseNativeLibs
Execution optimizations have been disabled for task ':app:mergeReleaseNativeLibs' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:UsersemanuApprn8androidappbuildintermediatesmerged_jni_libsreleaseout'. Reason: Task ':app:mergeReleaseNativeLibs' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:stripReleaseDebugSymbols
Execution optimizations have been disabled for task ':app:stripReleaseDebugSymbols' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseout'. Reason: Task ':app:stripReleaseDebugSymbols' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
Unable to strip the following libraries, packaging them as they are: libbutter.so, libc++_shared.so, libfabricjni.so, libfb.so, libfbjni.so, libfolly_futures.so, libfolly_json.so, libglog.so, libglog_init.so, libimagepipeline.so, libjsc.so, libjscexecutor.so, libjsi.so, libjsijniprofiler.so, libjsinspector.so, liblogger.so, libmapbufferjni.so, libnative-filters.so, libnative-imagetranscoder.so, libreact_codegen_rncore.so, libreact_config.so, libreact_debug.so, libreact_nativemodule_core.so, libreact_render_animations.so, libreact_render_attributedstring.so, libreact_render_componentregistry.so, libreact_render_core.so, libreact_render_debug.so, libreact_render_graphics.so, libreact_render_imagemanager.so, libreact_render_leakchecker.so, libreact_render_mapbuffer.so, libreact_render_mounting.so, libreact_render_runtimescheduler.so, libreact_render_scheduler.so, libreact_render_telemetry.so, libreact_render_templateprocessor.so, libreact_render_textlayoutmanager.so, libreact_render_uimanager.so, libreact_utils.so, libreactnativeblob.so, libreactnativejni.so, libreactnativeutilsjni.so, libreactperfloggerjni.so, librrc_image.so, librrc_root.so, librrc_text.so, librrc_unimplementedview.so, librrc_view.so, libruntimeexecutor.so, libturbomodulejsijni.so, libyoga.so.
> Task :app:extractReleaseNativeSymbolTables
Execution optimizations have been disabled for task ':app:extractReleaseNativeSymbolTables' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseout'. Reason: Task ':app:extractReleaseNativeSymbolTables' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: 'C:UsersemanuApprn8androidappbuildintermediatesstripped_native_libsreleaseout'. Reason: Task ':app:extractReleaseNativeSymbolTables' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibarm64-v8alibbutter.so because unable to locate the objcopy executable for the arm64-v8a ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibarm64-v8alibc++_shared.so because unable to locate the objcopy executable for the arm64-v8a ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibarm64-v8alibfabricjni.so because unable to locate the objcopy executable for the arm64-v8a ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibarm64-v8alibfb.so because unable to locate the objcopy executable for the arm64-v8a ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibarm64-v8alibfbjni.so because unable to locate the objcopy executable for the arm64-v8a ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibarm64-v8alibfolly_futures.so because unable to locate the objcopy executable for the arm64-v8a ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibarm64-v8alibfolly_json.so because unable to locate the objcopy executable for the arm64-v8a ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibarm64-v8alibglog.so because unable to locate the objcopy executable for the arm64-v8a ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreactnativeutilsjni.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreactperfloggerjni.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_codegen_rncore.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_config.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_debug.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_nativemodule_core.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_animations.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_attributedstring.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_componentregistry.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_core.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_debug.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_graphics.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_imagemanager.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_leakchecker.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_mapbuffer.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_mounting.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_runtimescheduler.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_scheduler.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_telemetry.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_templateprocessor.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_textlayoutmanager.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_render_uimanager.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libreact_utils.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64librrc_image.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64librrc_root.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64librrc_text.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64librrc_unimplementedview.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64librrc_view.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libruntimeexecutor.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libturbomodulejsijni.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from C:UsersemanuApprn8androidappbuildintermediatesmerged_native_libsreleaseoutlibx86_64libyoga.so because unable to locate the objcopy executable for the x86_64 ABI.
> Task :app:lintVitalAnalyzeRelease
w: Runtime JAR files in the classpath have the version 1.4, which is older than the API version 1.5. Consider using the runtime of version 1.5, or pass '-api-version 1.4' explicitly to restrict the available APIs to the runtime of version 1.4. You can also pass '-language-version 1.4' instead, which will restrict not only the APIs to the specified version, but also the language features
w: C:Usersemanu.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.4.10998caa30623f73223194a8b657abd2baec4880eakotlin-stdlib-jdk8-1.4.10.jar: Runtime JAR file has version 1.4 which is older than required for API version 1.5
w: C:Usersemanu.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.4.1030e46450b0bb3dbf43898d2f461be4a942784780kotlin-stdlib-jdk7-1.4.10.jar: Runtime JAR file has version 1.4 which is older than required for API version 1.5
w: C:Usersemanu.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.4.10ea29e063d2bbe695be13e9d044dcfb0c7add398ekotlin-stdlib-1.4.10.jar: Runtime JAR file has version 1.4 which is older than required for API version 1.5
w: C:Usersemanu.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.4.106229be3465805c99db1142ad75e6c6ddeac0b04ckotlin-stdlib-common-1.4.10.jar: Runtime JAR file has version 1.4 which is older than required for API version 1.5
> Task :app:lintVitalReportRelease
w: Runtime JAR files in the classpath have the version 1.4, which is older than the API version 1.5. Consider using the runtime of version 1.5, or pass '-api-version 1.4' explicitly to restrict the available APIs to the runtime of version 1.4. You can also pass '-language-version 1.4' instead, which will restrict not only the APIs to the specified version, but also the language features
w: C:Usersemanu.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.4.10998caa30623f73223194a8b657abd2baec4880eakotlin-stdlib-jdk8-1.4.10.jar: Runtime JAR file has version 1.4 which is older than required for API version 1.5
w: C:Usersemanu.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.4.1030e46450b0bb3dbf43898d2f461be4a942784780kotlin-stdlib-jdk7-1.4.10.jar: Runtime JAR file has version 1.4 which is older than required for API version 1.5
w: C:Usersemanu.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.4.10ea29e063d2bbe695be13e9d044dcfb0c7add398ekotlin-stdlib-1.4.10.jar: Runtime JAR file has version 1.4 which is older than required for API version 1.5
w: C:Usersemanu.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.4.106229be3465805c99db1142ad75e6c6ddeac0b04ckotlin-stdlib-common-1.4.10.jar: Runtime JAR file has version 1.4 which is older than required for API version 1.5
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
The build is successfull and the apk is created, but when I install the apk in the device and start app, this crash imediatally
I don’t know how fix it.
I am using v16.15.0 of nodejs, and this is the output when I run java -version
openjdk version "11.0.14.1" 2022-02-08
OpenJDK Runtime Environment 18.9 (build 11.0.14.1+1)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.14.1+1, mixed mode)
react-native version: 0.68.1
any help is welcome! Thanks
2
Answers
Try to clean the gradlew folder before building your app.
Run following command on your terminal inside the root directory of your project.
If it’s not working you might forgot to link your dependencies to android folder, run the following command on your terminal inside your root directory of your app:
this helped me to solve the problem
https://github.com/facebook/react-native/issues/29398#issuecomment-708545702
https://github.com/facebook/react-native/issues/29398
https://github.com/facebook/react-native/pull/30177
https://github.com/facebook/react-native/commit/53f55001afbf07494de0df064a92dfdd42f37c98