Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to create android build due to cmake debug|arm64-v8a : com.google.prefab.api.NoMatchingLibraryException: No compatible library found for //ReactAndroid/hermestooling. Rejected the following libraries #2591

Open
Muhammad-Hassam opened this issue Dec 27, 2024 · 13 comments
Assignees
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android

Comments

@Muhammad-Hassam
Copy link

Muhammad-Hassam commented Dec 27, 2024

Description

i've updated react native version from 0.73.4 to 0.76.5 using react native upgrade helper and update other libraries also. IOS build is successfully running but giving error on android

Task :app:compileDebugKotlin FAILED

Task :react-native-screens:configureCMakeDebug[arm64-v8a] FAILED
C/C++: /Users/Downloads/node_modules/react-native-screens/android/CMakeLists.txt debug|arm64-v8a : com.google.prefab.api.NoMatchingLibraryException: No compatible library found for //ReactAndroid/hermestooling. Rejected the following libraries:
425 actionable tasks: 44 executed, 381 up-to-date

Steps to reproduce

  1. install react-native-screen^4.4.0
  2. cd android && ./gradlew --stop
  3. yarn android

Snack or a link to a repository

https://github.com/

Screens version

^4.4.0

React Native version

0.76.5

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

None

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added the Missing repro This issue need minimum repro scenario label Dec 27, 2024
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@github-actions github-actions bot added the Platform: Android This issue is specific to Android label Dec 27, 2024
@fynally
Copy link

fynally commented Dec 28, 2024

react-native-screens:buildCMakeDebug[arm64-v8a] FAILED I keep getting this very issue no matter the version of react native i use.

@atifaziz1
Copy link

I am getting below error even for new project as well.

`2 files found with path 'lib/arm64-v8a/libfbjni.so' from inputs:

  • /Users/userName/Documents/sme/SmeApp/node_modules/react-native-screens/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libfbjni.so

  • /Users/userName/.gradle/caches/8.10.2/transforms/95f6f58ffe80f07573bbc4f1f4f0ecd0/transformed/jetified-react-android-0.76.5-debug/jni/arm64-v8a/libfbjni.so`

@kkafar
Copy link
Member

kkafar commented Dec 30, 2024

@Muhammad-Hassam Thanks for the report, however in current state it indicates some environment misconfiguration rather than a library issue, moreover you haven't posted a reproduction what indicates to me, that this does not happen on clean projects, but rather only in your specific environment. I'll mark the ticket as stale - tag me in case you have a reproduction / more information Right now, with this little of diagnostic information I won't be able to provide you with any more help.

One thing to do is to nuke the caches as I indicate below 👇🏻 It's always worth a shot.

@atifaziz1, you should just clear the gradle caches, build caches and run clean build.

rm -fr ~/.gradle/caches/ node_modules android/build androida/app/build android/app/.cxx. Reinstall the node modules, sync the gradle project & it should work.

@kkafar kkafar self-assigned this Dec 30, 2024
@kkafar kkafar added the Close when stale This issue is going to be closed when there is no activity for a while label Dec 30, 2024
@Muhammad-Hassam
Copy link
Author

Muhammad-Hassam commented Dec 31, 2024

@kkafar i was running my project on react native version 0.73.5 at this time i was using react-native-screens version ^3.29.0 it was working fine now i have updated my react native to 0.76.5 so i got this error and with react native i also updated the react-native-screens version to 4.4.0. just i clean the build and caches also and run the android command.

using
distributionUrl=https://services.gradle.org/distributions/gradle-8.10.2-all.zip before it was 8.3

i also checked newArchEnabled=false but still got same error

BUILD FAILED in 11s
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':react-native-screens:configureCMakeDebug[arm64-v8a]'.

[CXX1214] /Users/Downloads/node_modules/react-native-screens/android/CMakeLists.txt debug|arm64-v8a : User has minSdkVersion 22 but library was built for 24 [//ReactAndroid/hermestooling] * Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org. BUILD FAILED in 11s.

i also set minSdkVersion=24

System:
OS: macOS 14.6.1
CPU: (8) arm64 Apple M3
Memory: 84.05 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.11.0
path: ~/.nvm/versions/node/v20.11.0/bin/node
Yarn:
version: 1.22.21
path: /opt/homebrew/bin/yarn
npm:
version: 10.8.1
path: ~/.nvm/versions/node/v20.11.0/bin/npm
Watchman:
version: 2024.12.02.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.16.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.2
- iOS 18.2
- macOS 15.2
- tvOS 18.2
- visionOS 2.2
- watchOS 11.2
Android SDK: Not Found
IDEs:
Android Studio: 2023.1 AI-231.9392.1.2311.11330709
Xcode:
version: 16.2/16C5032a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.10
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 15.1.3
wanted: 15.1.3
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.76.5
wanted: 0.76.5
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false

iOS:
hermesEnabled: true
newArchEnabled: true

Screenshot 2024-12-31 at 12 14 34 PM

let me know if i'm doing wrong anything thank you

@github-actions github-actions bot removed the Close when stale This issue is going to be closed when there is no activity for a while label Dec 31, 2024
@atifaziz1
Copy link

Dear @kkafar,

I follow your steps but still i am facing same issue.

@fynally
Copy link

fynally commented Jan 1, 2025

react-native-screens:buildCMakeDebug[arm64-v8a] FAILED

This is really frustrating.
2 weeks now still getting this same error even in brand new project.
I have changed my java version, android studio, and many things.. still not resolved

@Muhammad-Hassam
Copy link
Author

Muhammad-Hassam commented Jan 1, 2025

@kkafar @fynally i found a solution for react-native-screens:buildCMakeDebug[arm64-v8a] FAILED. i just updated NDK version from 26.1.10909125 to 27.0.12077973 and did newArchEnabled=false now android build is successfully running on react native 0.76.5 version.

@atifaziz1
Copy link

Dear @Muhammad-Hassam, you don't need to update NDK version if newArchEnabled is false. The problem is with enabling new architecture. I am still facing same issue.

@Muhammad-Hassam
Copy link
Author

@atifaziz1 i checked it without upgrading ndk version i changed newArchEnabled=false got the same error when i upgraded ndk version so i found solution may be depend on system architecture. But yup we need solution for newArchEnabled=true.

@kkafar
Copy link
Member

kkafar commented Jan 1, 2025

@fynally @Muhammad-Hassam @atifaziz1 is anyone able to provide a reproduction?

@sahilkakwani9
Copy link

@kkafar The issue happens even with the new react-native-cli bare workflow app. Below are two errors I'm facing.

FAILURE: Build failed with an exception.

Task :app:configureCMakeDebug[arm64-v8a]
C/C++: /Users/sahil/Web-Projects/Web3/wallet/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/CMakeLists.txt debug|arm64-v8a : com.google.prefab.api.NoMatchingLibraryException: No compatible library found for //ReactAndroid/hermestooling. Rejected the following libraries:

  • What went wrong:
    Execution failed for task ':app:configureCMakeDebug[arm64-v8a]'.

[CXX1214] /Users/Web-Projects/Web3/wallet/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/CMakeLists.txt debug|arm64-v8a: User has minSdkVersion 22 but library was built for 24 [//ReactAndroid/hermestooling]

@kkafar
Copy link
Member

kkafar commented Jan 9, 2025

@sahilkakwani9 could you provide me with exact steps of how do you create fresh app to get these errors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android
Projects
None yet
Development

No branches or pull requests

5 participants