ext_storage
ext_storage copied to clipboard
Build failed due to gradle issues in plugin
Howdy mate!
I just touched down into your repo and wanted to use the plugin for getting Storage paths. Although unfortunately I ran into build error at gradle stage. Attached is the stacktrace from Flutter.
Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\mhetr\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\ext_storage-1.0.3\android\build.gradle' line: 25
* What went wrong:
A problem occurred evaluating project ':ext_storage'.
> Could not initialize class org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetKt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* Where:
Script 'C:\Users\mhetr\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 326
* What went wrong:
A problem occurred configuring project ':ext_storage'.
> Failed to notify project evaluation listener.
> Could not initialize class org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetKt
> compileSdkVersion is not specified. Please add it to build.gradle
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
I have no good idea of why this happened - being new at Flutter, but maybe you could help fix if plugin issue or give some resolution if an error from my side.
I've added ext_storage: ^1.0.3
to my project, did a flutter get and ran a debug session.
i am also getting same error ...can you help?
Same exact error here too.
Any update or response?
I solved that with a downgrade gradle app. android/build.gradle file : I downgrade 'com.android.tools.build:gradle:4.1.0' ==> 'com.android.tools.build:gradle:3.5.2'
- gradle-wrapper.properties file : I downgrade distributionUrl=https://services.gradle.org/distributions/gradle-6.7-all.zip ==> distributionUrl=https://services.gradle.org/distributions/gradle-5.6.2-all.zip
Same issue reproducible for me:
External Libraries->Flutter Plugins->ext_storage-1.0.3->android->build.gradle
ext.kotlin_version = '1.3.10'->ext.kotlin_version = '1.4.20'