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

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

Open
3 of 5 tasks
efstathiosntonas opened this issue Sep 9, 2024 · 26 comments
Labels
🐛 bug Something isn't working

Comments

@efstathiosntonas
Copy link

efstathiosntonas commented Sep 9, 2024

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:

related:

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 efstathiosntonas added the 🐛 bug Something isn't working label Sep 9, 2024
Copy link

maintenance-hans bot commented Sep 9, 2024

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.

@srgoogle23
Copy link

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

And ps: I'm not using the 4.5.3

@Jonnboy91
Copy link

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.

@SKHRAPP
Copy link

SKHRAPP commented Sep 10, 2024

@Jonnboy91 is that working with version 4.5.2

@Jonnboy91
Copy link

Jonnboy91 commented Sep 10, 2024

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

@SKHRAPP
Copy link

SKHRAPP commented Sep 11, 2024

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

@Jonnboy91
Copy link

Jonnboy91 commented Sep 11, 2024

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

@SKHRAPP
Copy link

SKHRAPP commented Sep 11, 2024

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

@Jonnboy91
Copy link

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

@SKHRAPP
Copy link

SKHRAPP commented Sep 11, 2024

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

@efstathiosntonas
Copy link
Author

efstathiosntonas commented Sep 11, 2024

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

cd android &&./gradlew clean

@SKHRAPP
Copy link

SKHRAPP commented Sep 11, 2024

@efstathiosntonas yes

@amir-ibrahim
Copy link

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

@Amurmurmur

This comment was marked as spam.

@amir-ibrahim
Copy link

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

@MahmoudHemaid
Copy link

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

@mrousavy
Copy link
Owner

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"
      }

@Jonnboy91
Copy link

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 😅

@mrousavy
Copy link
Owner

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

@Jonnboy91
Copy link

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

@mrousavy
Copy link
Owner

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.

@lucksp
Copy link

lucksp commented Sep 23, 2024

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.

@JoaoPauloCMarra
Copy link

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

@lucksp
Copy link

lucksp commented Sep 23, 2024 via email

@rieg-ec
Copy link

rieg-ec commented Sep 24, 2024

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"

@patlux
Copy link

patlux commented Oct 1, 2024

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests