-
Notifications
You must be signed in to change notification settings - Fork 853
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
feat(android): Add support for AGP 8 in example, add compileOptions to build.gradle #1503
Conversation
As far as I remember the namespace feature didn't work with |
I don't think it's needed because we're checking if if (project.android.hasProperty('namespace')) {
namespace 'xyz.luan.audioplayers'
} |
No, it is not required and not connected with Flutter version. Ideally, users shouldn't be using such old AGP version. In Plus Plugins I decided to not go with compatibility check, like the one suggested in the comment above, but release a major version bump to encourage people to update their projects. |
Hi, any eta on when this will be merged and released? I just upgraded my flutter project to AGP 8 and I believe audioplayers missing the |
@cian-bayer Feel free to use the fork if you don't want to wait. In your audioplayers:
git:
url: https://github.com/Skyost/audioplayers.git
path: packages/audioplayers/ |
Changing AGP version fails, due to flutter/flutter@3a6c4eb is not released yet. Then we also need to move to |
@@ -1,3 +1,6 @@ | |||
org.gradle.jvmargs=-Xmx1536M | |||
android.useAndroidX=true | |||
android.enableJetifier=true | |||
android.defaults.buildfeatures.buildconfig=true | |||
android.nonTransitiveRClass=false | |||
android.nonFinalResIds=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these changes needed? According to the release notes the defaults have changed to improve build performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're not. In fact, they happened when I used the Android Studio migration tool. I can remove them if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that would be nice 😊
There is no need to bump to AGP 8.0 with this PR. The suggested change is only to add a |
@Skyost can you open a second PR with the changes in the example project and just update the audioplayers_android platform here (without the example). Or the other way around. Edit: already started another PR to consider the AGP only without testing it. |
That's okay, thanks ! I'll remove the changes to the gradle.properties file according to #1503 (review). |
I think there is some misunderstanding from your side on what is needed to support AGP 8. Only adding Here is an example of a similar change, but without bumping to AGP 8: https://github.com/fluttercommunity/plus_plugins/pull/1698/files |
According to the following discussion : #1503 (review).
@vbuberen Is there a reason to not upgrade the build gradle tools in
Why should we adding the namespace in the |
Because adding |
I had some build issues with AGP 8 back then. Maybe it is not the case anymore as there were quite a few updates to Flutter and tooling in last 3-4 weeks. And my statement in previous comments meant that adding a |
I think we are discussing two different things. I did not mean to change the AndroidManifest in At some day in the future we should removing the namespace from AndroidManifest in both the example and the audioplayers_android package.
I think the AGP version in audioplayers_android is overriden by the one of the user's app anyways (here example) so it wouldn't matter bumping it, maybe (?), but leaving it for now as done in flutter packages |
FWIW, I tried building for android from @Skyost 's branch like this:
and got this error:
and I made sure to run Flutter doctor:
|
Cherry-pick of #1503 Co-authored-by: Hugo Delaunay <Skyost@users.noreply.github.com>
Description
This PR adds support of namespace property to support Android Gradle Plugin (AGP) 8. Projects with AGP < 4.2 will not supported anymore. It fixes the following error :
See flutter/flutter#125181.
Checklist
fix:
,feat:
,docs:
,chore:
etc).///
, where necessary.Breaking Change
Migration instructions
You can (and you should !) upgrade your Android project to use AGP 8. In your
build.gradle
:Also don't forget to add a namespace in the
android
section ofapp/build.gradle
:Related Issues
namespace
in build.gradle due toNo signature of method: build_[...].android() is applicable for argument types
error with AGP <4.2 flutter/flutter#125621 (comment)