3

I am trying to build apk but it is not getting build as following error occurs i am using flutter_cached_pdfview: ^0.4.1 package

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':flutter_pdfview:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action Android resource linking failed ERROR:/.gradle/caches/transforms-3/ed0b2394dac74ba9b6328f7c86f4ee30/transformed/core-1.7.0/res/values/values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.

app got debugged without any error but building apk is throwing errors Thanks

2 Answers2

0

Please add below content in bottom of top level build.gradle file

configurations.all {
   resolutionStrategy {
       force 'androidx.core:core-ktx:1.6.0'
    }
}

Then open android folder with Android studio and run with release mode

Saranya Subramanian
  • 417
  • 1
  • 5
  • 19
  • Sorry but this is not working i added the mentioned line in Android/build.gradle file and tried to build apk by flutter run --release . SO do i did as you advised ? – sudhanshu shaurya May 08 '23 at 12:17
  • 1
    @sudhanshushaurya Please open the Android folder in Android studio and change the build variant as release , then run – Saranya Subramanian May 17 '23 at 05:44
0

The error occurs because build versions of flutter_pdfview. To solve this override version 1.2.9 of flutter_pdfview in pubspec.yml

dependency_overrides:
  flutter_pdfview: 1.2.9

Then do flutter clean followed by flutter pub get

Happy coding

vinchuli
  • 409
  • 5
  • 6