wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.58k stars 540 forks source link

error when i try to install react-native-pdf #625

Open belafdil opened 2 years ago

belafdil commented 2 years ago

hello friends when i try to install react-native-pdf i got this error

Task :app:checkDebugAarMetadata FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings 10 actionable tasks: 2 executed, 8 up-to-date

FAILURE: Build failed with an exception.

BUILD FAILED in 2m 5s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

BUILD FAILED in 2m 5s

at makeError (C:\Users\Bel\Desktop\Nouveau dossier (3)\umtapp\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\Bel\Desktop\Nouveau dossier (3)\umtapp\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Users\Bel\Desktop\Nouveau dossier (3)\umtapp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\Bel\Desktop\Nouveau dossier (3)\umtapp\node_modules\@react-native-community\cli\build\index.js:192:9)

info Run CLI with --verbose flag for more details.

roryabraham commented 2 years ago

I'm not sure, but you might try adding maven { url 'https://www.jitpack.io' } in android/build.gradle under allprojects -> repositories. Like we have here

mateus-azevedo commented 2 years ago

Hey @roryabraham a tried your solution and this https://github.com/wonday/react-native-pdf/issues/530#issuecomment-756931303 but no success.

Do you have any other ideas of what it could be?

Biplovkumar commented 2 years ago

any update ?

shiroze commented 2 years ago

Try this I think the problem because this https://github.com/wonday/react-native-pdf#android-installation

ils-anwarshah commented 3 months ago

I had the same issues, downgrading the version working fine for me

yarn add react-native-pdf@6.6.2

and added android/app/build.gradle android{ packagingOptions { pickFirst 'lib/x86/libc++_shared.so' pickFirst 'lib/x86_64/libjsc.so' pickFirst 'lib/arm64-v8a/libjsc.so' pickFirst 'lib/arm64-v8a/libc++_shared.so' pickFirst 'lib/x86_64/libc++_shared.so' pickFirst 'lib/armeabi-v7a/libc++_shared.so' } }

vaivai130 commented 3 months ago

Can confirm @ils-anwarshah suggestion has fixed it for me.