Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle task assembledebug failed with exit code 1 #16

Open
ghost opened this issue Aug 20, 2020 · 2 comments
Open

gradle task assembledebug failed with exit code 1 #16

ghost opened this issue Aug 20, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 20, 2020

Your Flutter application is created using an older version of the Android embedding. It's being deprecated in favor of Android embedding v2. Follow the steps on https://flutter.dev/go/android-project-migration to migrate your project.
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':path_provider:parseDebugLibraryResources'.

Could not resolve all files for configuration ':path_provider:androidApis'.
Failed to transform file 'android.jar' to match attributes {artifactType=android-platform-attr, org.gradle.usage=java-runtime-jars}
> Execution failed for PlatformAttrTransform: C:\Users\hp\AppData\Local\Android\Sdk\platforms\android-28\android.jar.
> C:\Users\hp\AppData\Local\Android\Sdk\platforms\android-28\android.jar (The system cannot find the file specified)

  • 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 18s
Exception: Gradle task assembleDebug failed with exit code 1

please reply how to solve this problem............

@wuwz98
Copy link

wuwz98 commented Jan 29, 2021

Receiving the same problems this morning, done some research.

In my case, I directly pulled the project from GIT they provided and then received the usual 'Your Flutter application is created using an older version of the Android embedding. It's being deprecated in favor of Android embedding v2. Follow the steps on
https://flutter.dev/go/android-project-migration to migrate your project.'
problem, after amending this bug and add the code, I received the same problem as you posted.

The reason this happens might related to SDK version and their source code from git were in an older version of dart and flutter, after following the steps on https://www.youtube.com/watch?v=nqY2kdEED5w, it dosen't change the default SDK version.

Got a few insights from https://stackoverflow.com/questions/37293082/uses-sdkminsdkversion-15-cannot-be-smaller-than-version-16-declared-in-library.

Solution 1: find build.gradle and change the minSdkVersion along with the targetSdkVersion to a new version, for example: 28 and 30 respectively.

Solution 2: if you could copy all the assets and configuration files from the begining in a new flutter apps you created yourself instead of cloning from GIT, this won't be a problem.

Feel free for to follow up if you have more questions.

@chikakow
Copy link

chikakow commented Mar 25, 2022

I was getting the same error. In my case, I created an app new from the android studio and just added the assets. But the way I was referencing from the yaml file was wrong and was getting this error.

Below is wrong

assets:
  - assets

Below is right

assets:
  - assets/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants