I am trying to use the dependency https://pub.dev/packages/pdftron_flutter pdf tron to show pdf files in flutter app, when I try to build the android app, I get the error
C:UsersUSERAppDataLocalPubCachehostedpub.devpdftron_flutter-1.0.1- 32androidsrcmainjavacompdftronpdftronflutterhelpersPluginUtils.java:987: error: cannot find symbol stringRes != R.string.document_save_error_toast_message; ^ symbol: variable string location: class R
this is the flutter doctor output
[√] Flutter (Channel stable, 3.22.3, on Microsoft Windows [Version 10.0.22621.3447], locale en-US) [√] Windows Version (Installed version of Windows is version 10 or higher) [!] Android toolchain - develop for Android devices (Android SDK version 34.0.0) X cmdline-tools component is missing Run
path/to/sdkmanager –install "cmdline-tools;latest"See https://developer.android.com/studio/command-line for more details. X Android license status unknown. Run
flutter doctor –android-licenses to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/windows#android-setup for more details. [√] Chrome - develop for the web [√] Visual Studio - develop Windows apps (Visual Studio Community 2019 16.11.34) [!] Android Studio (version 2022.3) X Unable to determine bundled Java version. [√] Android Studio (version 2023.3) [√] VS Code (version 1.92.1) [√] Connected device (4 available) [√] Network resources
I tried to implement all the solutions in the link "error: cannot find symbol" when building for Android in flutter
Like running flutter clean
and changing compileSdkVersion, minSdkVersion targetSdkVersion
to 34,21,34 respectively but it did not work
2
Answers
I solved this answer by downgrading
com.android.application
version from8.3.0
to7.3.0
This issue was resolved by downgrading Gradle to 7.3.0