react-native-pdf: Android build error on latest version react-native-pdf@6.7.5

What react-native version are you using? 0.72.12

What react-native-pdf version are you using? 6.7.5

What react-native-blob-util version are you using? 0.19.9

What platform does your issue occur on? (android/ios/both) android

Describe your issue as precisely as possible :

  1. Steps to reproduce the issue or to explain in which case you get the issue
yarn add react-native-pdf react-native-blob-util
yarn android
  1. Interesting logs
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkStagingDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
 > 2 issues were found when checking AAR metadata:
   
     1.  Dependency 'androidx.core:core-ktx:1.12.0' requires libraries and applications that
         depend on it to compile against version 34 or later of the
         Android APIs.
   
         :app is currently compiled against android-33.
   
         Also, the maximum recommended compile SDK version for Android Gradle
         plugin 7.4.2 is 33.
   
         Recommended action: Update this project's version of the Android Gradle
         plugin to one that supports 34, then update this project to use
         compileSdkVerion of at least 34.
   
         Note that updating a library or application's compileSdkVersion (which
         allows newer APIs to be used) can be done separately from updating
         targetSdkVersion (which opts the app in to new runtime behavior) and
         minSdkVersion (which determines which devices the app can be installed
         on).
   
     2.  Dependency 'androidx.core:core:1.12.0' requires libraries and applications that
         depend on it to compile against version 34 or later of the
         Android APIs.
   
         :app is currently compiled against android-33.
   
         Also, the maximum recommended compile SDK version for Android Gradle
         plugin 7.4.2 is 33.
   
         Recommended action: Update this project's version of the Android Gradle
         plugin to one that supports 34, then update this project to use
         compileSdkVerion of at least 34.
   
         Note that updating a library or application's compileSdkVersion (which
         allows newer APIs to be used) can be done separately from updating
         targetSdkVersion (which opts the app in to new runtime behavior) and
         minSdkVersion (which determines which devices the app can be installed
         on).

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 11
  • Comments: 29

Most upvoted comments

I am also facing the same issue. Any resolution made?

after removing react-native-pdf and react-native-blob-util from package.json and run npm i after app build successful without errors

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

it worked!! ty so much

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

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

This works for me which changing amy other config. my RN ver is: 0.72.7

the build succeed when i change minSdk to 24, but i don’t want to change I changed it to 24, but some other functions failed. Is there any final solution @Kaung-Htet-Hein