react-native-vision-camera icon indicating copy to clipboard operation
react-native-vision-camera copied to clipboard

🐛 [4.5.3] Google Api Error: Invalid request - Your app declares support for 'riscv64' architecture, but the following libraries are missing

Open efstathiosntonas opened this issue 1 year ago • 26 comments

What's happening?

After trying to upload a production release on Google Play Store it throwed this error. Downgrading to 4.5.2 the build was accepted. It seems that [email protected] has some issues with rn?

[!] Google Api Error: Invalid request - Your app declares support for 'riscv64' architecture, but the following libraries are missing:
 [libVisionCamera.so, libandroidlame.so, libanimation-decoder-gif.so, libavcodec.so, libavdevice.so, libavfilter.so, libavformat.so, libavif_android.so, libavutil.so, libbarhopper_v3.so, libbugsnag-ndk.so, libbugsnag-plugin-android-anr.so, libbugsnag-root-detection.so, libc++_shared.so, libcrsqlite.so, libcrypto.so, libexpo-av.so, libexpo-modules-core.so, libfabricjni.so, libfbjni.so, libffmpegkit.so, libffmpegkit_abidetect.so, libfolly_runtime.so, libgifimage.so, libglog.so, libhermes.so, libhermes_executor.so, libhermesinstancejni.so, libimagepipeline.so, libjscinstance.so, libjsi.so, libjsijniprofiler.so, libjsinspector.so, libmapbox-common.so, libmapbox-maps.so, libmapbufferjni.so, libnative-filters.so, libnative-imagetranscoder.so, libop-sqlite.so, libreact-native-keys.so, libreact_codegen_rncore.so, libreact_debug.so, libreact_devsupportjni.so, libreact_featureflags.so, libreact_featureflagsjni.so, libreact_nativemodule_core.so, libreact_nativemodule_defaults.so, libreact_nativemodule_dom.so, libreact_nativemodule_featureflags.so, libreact_nativemodule_microtasks.so, libreact_newarchdefaults.so, libreact_performance_timeline.so, libreact_render_componentregistry.so, libreact_render_consistency.so, libreact_render_core.so, libreact_render_debug.so, libreact_render_graphics.so, libreact_render_imagemanager.so, libreact_render_mapbuffer.so, libreact_render_observers_events.so, libreact_render_uimanager_consistency.so, libreact_utils.so, libreactnativeblob.so, libreactnativejni.so, libreanimated.so, librninstance.so, librnscreens.so, librrc_image.so, librrc_legacyviewmanagerinterop.so, librrc_textinput.so, librrc_view.so, libruntimeexecutor.so, libsqlite_vec.so, libstatic-webp.so, libswresample.so, libswscale.so, libturbomodulejsijni.so, libucrop.so, libuimanagerjni.so, libunistyles.so, libworklets.so, libyoga.so, libavcodec_neon.so, libavdevice_neon.so, libavfilter_neon.so, libavformat_neon.so, libavutil_neon.so, libffmpegkit_armv7a_neon.so, libswresample_neon.so, libswscale_neon.so].

 Update your app to rely on libraries that support 'riscv64' architecture.

I'm at [email protected] with expo-modules-core @ expo 51

Probably related:

  • https://github.com/expo/expo/issues/31370

related:

  • https://github.com/facebook/react-native/issues/46397

Reproduceable Code

no repro, just try to upload a release build on Play Store.

Relevant log output

no logs

Camera Device

not needed

Device

Android

VisionCamera Version

4.5.3

Can you reproduce this issue in the VisionCamera Example app?

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

Additional information

efstathiosntonas avatar Sep 09 '24 13:09 efstathiosntonas

Guten Tag, Hans here! 🍻

Thanks for reporting the issue. It seems like a challenge with ze 'riscv64' architecture support and your logs are quite missing. To help mrousavy diagnose, could you please provide any relevant adb logs from your Android device? You can use adb logcat in your terminal while trying to upload ze release again.

Also, make sure to test ze issue with ze VisionCamera Example app, as that might help narrow down ze problem. If you need more guidance, check ze documentation, bitte.

Looking forward to your update!

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

maintenance-hans[bot] avatar Sep 09 '24 13:09 maintenance-hans[bot]

@efstathiosntonas https://github.com/expo/expo/issues/31370 its related, but its closed bc it was without the Minimal reproducible example. I created another one: https://github.com/expo/expo/issues/31371

And ps: I'm not using the 4.5.3

srgoogle23 avatar Sep 09 '24 23:09 srgoogle23

I'm getting the same issue as well with 4.5.3, now testing to downgrade to 4.5.2 to see if that works.

Jonnboy91 avatar Sep 10 '24 05:09 Jonnboy91

@Jonnboy91 is that working with version 4.5.2

SKHRAPP avatar Sep 10 '24 08:09 SKHRAPP

Yeah 4.5.2 went through. 👌 I had this kind of error message on production build for android when using version 4.5.3:

* 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'.

Jonnboy91 avatar Sep 10 '24 10:09 Jonnboy91

@Jonnboy91 did you solve this issue.i want create production build for android getting this error

SKHRAPP avatar Sep 11 '24 05:09 SKHRAPP

As mentioned in the earlier comment, the version 4.5.2 works 👌

Jonnboy91 avatar Sep 11 '24 06:09 Jonnboy91

@Jonnboy91 how did you solve this issue

* 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'.

SKHRAPP avatar Sep 11 '24 07:09 SKHRAPP

That was the issue that came with 4.5.3 version 😅 So I solved it by downgrading to 4.5.2 as mentioned earlier.

Jonnboy91 avatar Sep 11 '24 07:09 Jonnboy91

@Jonnboy91 me also downgraded from 4.5.3 to 4.5.2 still getting error for creating production Build

SKHRAPP avatar Sep 11 '24 07:09 SKHRAPP

do you gradlew clean before production builds when downgrading from 4.5.3 to 4.5.2?

cd android &&./gradlew clean

efstathiosntonas avatar Sep 11 '24 08:09 efstathiosntonas

@efstathiosntonas yes

SKHRAPP avatar Sep 11 '24 09:09 SKHRAPP

still facing this issue with 4.5.3 and 4.5.2 but not in build but when trying to push the app to play store any help @efstathiosntonas , @SKHRAPP

amir-ibrahim avatar Sep 11 '24 17:09 amir-ibrahim

same

Amurmurmur avatar Sep 11 '24 18:09 Amurmurmur

so we solved the issue by using version 4.5.2 and removing the ^ from the version @Amurmurmur

Screenshot 2024-09-12 at 9 53 26 AM

amir-ibrahim avatar Sep 12 '24 07:09 amir-ibrahim

so we solved the issue by using version 4.5.2 and removing the ^ from the version @Amurmurmur

Screenshot 2024-09-12 at 9 53 26 AM

Worked with me

MahmoudHemaid avatar Sep 12 '24 11:09 MahmoudHemaid

I am pretty sure this is not a VisionCamera issue, but rather an issue of adopting support for a new architecture. CameraX is just already ready for RISCv64, while some other native libs (like RN) are not.

Add this to your app's build.gradle to temporarily remove riscv64:

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

mrousavy avatar Sep 12 '24 11:09 mrousavy

Yeah fair enough @mrousavy, but just wondering since this is for React-native why are you updating cameraX to alpha (that brings the RISCv64 "issue") that has something that RN is not supporting/ready for yet, since it's done for it. Was there some other bugs/features that were more important than this "nuisance" so to speak 😅

Jonnboy91 avatar Sep 12 '24 11:09 Jonnboy91

Yea, stability improvements.

I just removed riscv64 from my app and everything works fine. I don't think I should throttle down development speed just because the ecosystem isn't fully ready yet

mrousavy avatar Sep 12 '24 11:09 mrousavy

Alright fair enough! Just was interested in hearing the reasons 💪

Jonnboy91 avatar Sep 12 '24 12:09 Jonnboy91

No worries - yea I was also surprised to find out that this simply breaks the build. I guess we have to be extra careful about such things.

mrousavy avatar Sep 12 '24 15:09 mrousavy

Following...i also have this issue after upgrading to:

"expo": "^51.0.0",
"react-native": "0.74.5",
"react-native-vision-camera": "^4.5.3",

Add this to your app's build.gradle to temporarily remove riscv64:

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

Will riscv64 be removed from RNVC in a future release? I use expo & EAS so I don't plan to edit the build.gradle.

I downgraded back to RNVC 4.5.1 and my build also worked fine now.

lucksp avatar Sep 23 '24 03:09 lucksp

Following...i also have this issue after upgrading to:

"expo": "^51.0.0",
"react-native": "0.74.5",
"react-native-vision-camera": "^4.5.3",

Add this to your app's build.gradle to temporarily remove riscv64:

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

Will riscv64 be removed from RNVC in a future release? I use expo & EAS so I don't plan to edit the build.gradle.

I downgraded back to RNVC 4.5.1 and my build also worked fine now.

4.5.2 should work

JoaoPauloCMarra avatar Sep 23 '24 12:09 JoaoPauloCMarra

Yes, 4.5.2 should work but for now, however that might be the limit to upgrade version if riscv64 remains enabled in 4.5.3 and above

lucksp avatar Sep 23 '24 12:09 lucksp

in case anyone using expo wants to keep with latest version, this plugin adds the abiFilters that @mrousavy mentioned

const { withAppBuildGradle, withPlugins } = require('@expo/config-plugins');

const withCustomBuildGradle = (config) => withAppBuildGradle(config, (config) => {
  let buildGradle = config.modResults.contents;

  const ndkBlockInDefaultConfigRegex = /defaultConfig\s*{[^}]*ndk\s*{[^}]*abiFilters[^}]*}[^}]*}/s;
  if (!ndkBlockInDefaultConfigRegex.test(buildGradle)) {
    const defaultConfigStartRegex = /(defaultConfig\s*{)/;
    buildGradle = buildGradle.replace(
      defaultConfigStartRegex,
      `$1
        ndk {
            abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
        }`,
    );
  }

  config.modResults.contents = buildGradle;
  return config;
});

module.exports = function withAndroidNdkAbiFilters(config) {
  return withPlugins(config, [withCustomBuildGradle]);
};

it now builds with eas build --profile production using "react-native-vision-camera": "^4.5.3"

rieg-ec avatar Sep 24 '24 00:09 rieg-ec

For those who are using splits. You need to exclude riscv as following:

android {
    // ...
    packagingOptions {
        exclude "lib/riscv64/**"  // Exclude riscv64 libraries
    }
}

patlux avatar Oct 01 '24 10:10 patlux