I'm working on a Flutter consumer app using a premade Flutter WooCommerce app purchased from the Envato Market. When attempting to run the source code, I encounter a build exception specifically related to the permission_handler_android task. Below is the error message I receive:
Execution failed: permission_handler_android:extractDebugAnnotations
In my project structure on Android Studio, I'm using the following SDKs and JDK version: Flutter SDK version: 3.16.0, Dart SDK version: 3.2.1, Android SDK: Android API 34, extension level 7 Platform, Kotlin version: 1.8.0, JDK: jdk-17, compileSdkVersion: 34, targetSdkVersion: 33, permission_handler version: 10.4.3
I have already tried the following steps without success:
- Running flutter clean and flutter pub get to clear caches and fetch dependencies.
- Ensuring that all dependencies in pubspec.yaml are up to date.
- Checking for compatibility issues between the app and my current Flutter SDK version.
- I changed the compileSdkVersion and targetSdkVersion to the same version, such as 34 and 33, but I was facing the same exception each time as mentioned previously.
Expected Outcome: I expected the build process to complete successfully without any exceptions, allowing me to run and test the Flutter consumer app.
There were two issues created. One issue in 2021 which has a similar error. Try updating the
ext.kotlin_versioninandroid/build.gradleto the current version. And another issue which states that thecompileSdkVersionin the same file has to be greater than 32.Maybe an update of the package permission_handler in the
pubspec.yamlcould help.