ext_storage icon indicating copy to clipboard operation
ext_storage copied to clipboard

Build failed due to gradle issues in plugin

Open vaishnavmhetre opened this issue 4 years ago • 6 comments

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.

vaishnavmhetre avatar Jan 09 '21 15:01 vaishnavmhetre

i am also getting same error ...can you help?

HetalGohil avatar Jan 12 '21 07:01 HetalGohil

Same exact error here too.

Aperico-com avatar Mar 04 '21 06:03 Aperico-com

Any update or response?

chitgoks avatar Mar 20 '21 12:03 chitgoks

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

pmaAdvensyn avatar Mar 23 '21 07:03 pmaAdvensyn

Same issue reproducible for me:

image

Yuiry-IV avatar Jun 18 '21 11:06 Yuiry-IV

External Libraries->Flutter Plugins->ext_storage-1.0.3->android->build.gradle

ext.kotlin_version = '1.3.10'->ext.kotlin_version = '1.4.20'

once10301 avatar Jul 02 '21 10:07 once10301