mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.57k stars 1.1k forks source link

🔧 v4.5.3 fails to build on Android - jetified-camera-core-1.5.0-alpha01/jni/riscv64/libimage_processing_util_jni.so is not an ABI #3181

Closed interstates21 closed 2 months ago

interstates21 commented 2 months ago

How were you trying to build the app?

I updated react-native-vision-camera to v4.5.3 the app crashes at a build time on android.

Downgrading to v4.5.1 solves the issue

Full build logs

Execution failed for task ':app:mergeDebugNativeLibs'. > jni extracted from path /Users/oleksiikupin/.gradle/caches/transforms-3//transformed/jetified-camera-core-1.5.0-alpha01/jni/riscv64/libimage_processing_util_jni.so is not an ABI

Project dependencies

"react-native-vision-camera": "4.5.3",

VisionCamera Version

4.5.3

Target platforms

Android

Operating system

MacOS

Can you build the VisionCamera Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

maintenance-hans[bot] commented 2 months ago

Guten Tag, Hans here! 🍻

Thank you for reporting ze issue. It looks like you encountered a build error after updating to v4.5.3. However, I need to ask you to try building ze VisionCamera Example app to see if ze issue persists there. It helps us understand if it's related to our library or your specific setup.

Also, please provide ze full build logs in case this happens again, so mrousavy can better diagnose ze problem. To capture logs, you can use adb logcat for Android.

If you find this repository helpful and want ze issue to get more attention, consider sponsoring mrousavy here. Your support is always appreciated!

Note: If you think I made a mistake, please ping @mrousavy to take a look.

DragonDare commented 2 months ago

Even I am facing this issue with 4.5.3. Switching to 4.5.1 and modifying camerax_version from 1.5.0-alpha01 to 1.4.0-rc01 helped me build my app.

SKHRAPP commented 2 months ago

@DragonDare please help to modifying camerax_version where this page located and please share screen

getting error when make production build

* What went wrong:
Execution failed for task ':app:packageStagingReleaseBundle'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.PackageBundleTask$BundleToolWorkAction
   > Unrecognized native architecture for directory 'lib/riscv64'.

i downgraded library from 4.5.3 to 4.5.2

amir-ibrahim commented 2 months ago

i face this error when trying to upload the app to Play Store v4.5.2 and v4.5.3 the error is : 'riscv64' architecture is only supported for application targeting WearOS.

DragonDare commented 2 months ago

@DragonDare please help to modifying camerax_version where this page located and please share screen

getting error when make production build

* What went wrong:
Execution failed for task ':app:packageStagingReleaseBundle'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.PackageBundleTask$BundleToolWorkAction
   > Unrecognized native architecture for directory 'lib/riscv64'.

i downgraded library from 4.5.3 to 4.5.2

Steps:

  1. "react-native-vision-camera": "4.5.1". Change version to 4.5.1 in package.json.
  2. yarn/npm install.
  3. Go to node_modules\react-native-vision-camera\android\build.gradle and change line 185 to def camerax_version = "1.4.0-beta02".

Gradle clean and try to build again. should work

LeXuanKhanh commented 2 months ago

go to your cache folder /Users/oleksiikupin/.gradle/caches/transforms-3//transformed/jetified-camera-core-1.5.0-alpha01/ and delete the riscv64 folder in jni folder another way is using target ABI when build but I haven't tried it yet source and explanation: https://stackoverflow.com/questions/78609800/agp-8-0-so-is-not-an-abi-for-3rd-party-library https://stackoverflow.com/questions/76753627/how-to-fix-android-project-build-failing-with-so-is-not-an-abi https://issuetracker.google.com/issues/279516850

mrousavy commented 2 months ago

I am pretty sure this is not a VisionCamera issue. CameraX is just already ready for RISCv64, while some other native libs (like RN) are not.

Add this to your app's build.gradle:

android {
  // ..
    defaultConfig {
      // ..
      ndk {
        abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
      }
muhammadhuzaifakhalilhnhtechsolutions commented 2 months ago

@DragonDare please help to modifying camerax_version where this page located and please share screen getting error when make production build

* What went wrong:
Execution failed for task ':app:packageStagingReleaseBundle'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.PackageBundleTask$BundleToolWorkAction
   > Unrecognized native architecture for directory 'lib/riscv64'.

i downgraded library from 4.5.3 to 4.5.2

Steps:

  1. "react-native-vision-camera": "4.5.1". Change version to 4.5.1 in package.json.
  2. yarn/npm install.
  3. Go to node_modules\react-native-vision-camera\android\build.gradle and change line 185 to def camerax_version = "1.4.0-beta02".

Gradle clean and try to build again. should work

Thanks it's work for me ❤️

Rossella-Mascia-Neosyn commented 2 months ago

i have the same problem

DragonDare commented 2 months ago

I am pretty sure this is not a VisionCamera issue. CameraX is just already ready for RISCv64, while some other native libs (like RN) are not.

Add this to your app's build.gradle:

android {
  // ..
    defaultConfig {
      // ..
      ndk {
        abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
      }

This didn't work. Still getting the `

jni extracted from path E:.gradle\caches\transforms-3\59932ef85550e6bd54309370421ab708\transformed\jetified-camera-core-1.5.0-alpha01\jni\riscv64\libimage_processing_util_jni.so is not an ABI` error

DragonDare commented 2 months ago

go to your cache folder /Users/oleksiikupin/.gradle/caches/transforms-3//transformed/jetified-camera-core-1.5.0-alpha01/ and delete the riscv64 folder in jni file another is using target ABI when build but I haven't tried it yet source and explanation: https://stackoverflow.com/questions/78609800/agp-8-0-so-is-not-an-abi-for-3rd-party-library https://stackoverflow.com/questions/76753627/how-to-fix-android-project-build-failing-with-so-is-not-an-abi https://issuetracker.google.com/issues/279516850

This, however worked! Thank You! Now I can use the latest version of vision camera (4.5.3) as well.

ersincakmak commented 2 months ago

I am pretty sure this is not a VisionCamera issue. CameraX is just already ready for RISCv64, while some other native libs (like RN) are not.

Add this to your app's build.gradle:

android {
  // ..
    defaultConfig {
      // ..
      ndk {
        abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
      }

it didn't work for me either

rinusah commented 1 month ago

@DragonDare please help to modifying camerax_version where this page located and please share screen getting error when make production build

* What went wrong:
Execution failed for task ':app:packageStagingReleaseBundle'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.PackageBundleTask$BundleToolWorkAction
   > Unrecognized native architecture for directory 'lib/riscv64'.

i downgraded library from 4.5.3 to 4.5.2

Steps:

  1. "react-native-vision-camera": "4.5.1". Change version to 4.5.1 in package.json.
  2. yarn/npm install.
  3. Go to node_modules\react-native-vision-camera\android\build.gradle and change line 185 to def camerax_version = "1.4.0-beta02".

Gradle clean and try to build again. should work

Indeed! This solution works. It is extremely effective.

chiragramimi commented 1 month ago

i have the same problem

bhawyaicodelabs commented 1 month ago

@DragonDare please help to modifying camerax_version where this page located and please share screen getting error when make production build

* What went wrong:
Execution failed for task ':app:packageStagingReleaseBundle'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.PackageBundleTask$BundleToolWorkAction
   > Unrecognized native architecture for directory 'lib/riscv64'.

i downgraded library from 4.5.3 to 4.5.2

Steps:

  1. "react-native-vision-camera": "4.5.1". Change version to 4.5.1 in package.json.
  2. yarn/npm install.
  3. Go to node_modules\react-native-vision-camera\android\build.gradle and change line 185 to def camerax_version = "1.4.0-beta02".

Gradle clean and try to build again. should work

Indeed! This solution works. It is extremely effective.

Oh!!, Thankss It Workedd for me.

mddmey commented 1 month ago

go to your cache folder /Users/oleksiikupin/.gradle/caches/transforms-3//transformed/jetified-camera-core-1.5.0-alpha01/ and delete the riscv64 folder in jni folder another way is using target ABI when build but I haven't tried it yet source and explanation: https://stackoverflow.com/questions/78609800/agp-8-0-so-is-not-an-abi-for-3rd-party-library https://stackoverflow.com/questions/76753627/how-to-fix-android-project-build-failing-with-so-is-not-an-abi https://issuetracker.google.com/issues/279516850

Thankss.

leonardosilva97 commented 3 weeks ago

I'm facing an issue when trying to build my Expo project using EAS. The build works fine locally after applying a solution suggested by @DragonDare , but when I try to submit the project to EAS, I encounter the following error:

`FAILURE: Build failed with an exception.

BUILD FAILED in 9m 26s

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

1109 actionable tasks: 1109 executed Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information. `

devofthings commented 3 weeks ago

If someone also don't want to manually change the build.gradle file. Version 4.3.2works for me without any flaws and it seems to be the last version where node_modules\react-native-vision-camera\android\build.gradle has def camerax_version = "1.4.0-beta02". Thanks for finding the fix @DragonDare ✌🏼

illia-port commented 3 weeks ago

Thanks, guys, downgrading from "react-native-vision-camera": "^4.5.3" to 4.5.1 worked without any additional changes.