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

Build fails on 3.1.1 and above #285

Closed
sander121 opened this issue May 31, 2021 · 6 comments
Closed

Build fails on 3.1.1 and above #285

sander121 opened this issue May 31, 2021 · 6 comments

Comments

@sander121
Copy link

When building for android with 3.1.0 everything works fine.
When building with 3.1.1and above I get the error:

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':flutter_reactive_ble'.

class com.android.build.gradle.internal.api.TestVariantImpl_Decorated cannot be cast to class com.android.build.gradle.internal.core.InternalBaseVariant (com.android.build.gradle.internal.api.TestVariantImpl_Decorated is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @5db3
98dd; com.android.build.gradle.internal.core.InternalBaseVariant is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @69421090)

I do not understand enough of gradle to see the problem. Does someone else have this as well and maybe also found a solution? Thank you.

@remonh87
Copy link
Contributor

remonh87 commented May 31, 2021

We needed to update to the latest stable gradle version + wrapper + android dependencies.

If you update tools to classpath 'com.android.tools.build:gradle:4.2.1' and the wrapper version to 6.8.1. The app should build

@sander121
Copy link
Author

sander121 commented May 31, 2021

We needed to update to the latest stable gradle version + wrapper + android dependencies.

If you update tools to classpath 'com.android.tools.build:gradle:4.2.1' and the wrapper version to 6.8.1. The app should build

Thank you for your quick help. This indeed makes the error messages I got before disappear. Unfortunately it causes many more problems, all releated to incompatible kotlin and gradle versions. I will stick to 3.1.0 for now.

@safield
Copy link
Contributor

safield commented Oct 14, 2021

I updated my build tools and wrapper version to the ones listed to resolve this issue.

I now receive the following error. Curious if someone also ran into this problem after following the steps...

* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Android resource linking failed
     ERROR:/home/user/src/myapp/build/app/intermediates/packaged_manifests/release/AndroidManifest.xml:34: AAPT: error: attribute android:usesPermissionFlags not found.

@Edu09campos
Copy link

I updated my build tools and wrapper version to the ones listed to resolve this issue.

I now receive the following error. Curious if someone also ran into this problem after following the steps...

* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Android resource linking failed
     ERROR:/home/user/src/myapp/build/app/intermediates/packaged_manifests/release/AndroidManifest.xml:34: AAPT: error: attribute android:usesPermissionFlags not found.

I too have this error.

@PieterAelse
Copy link
Collaborator

@safield @Edu09campos Please checkout the answer on this other (solved) issue: #410 (comment)

That info has been added to the readme as well.

@farr64
Copy link

farr64 commented Oct 21, 2021

Please see the note I just made at #410 regarding a comment made by @YellowShark about setting the Android SDK to 31.

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

6 participants