Closed leifcr closed 1 year ago
We should support both old and new version of AGP with something like this:
if (project.android.hasProperty("namespace")) {
namespace 'com.ryanheise.audio_session'
}
See https://github.com/flutter/flutter/issues/125621#issuecomment-1525995461
I think it might be safe to introduce it without the if, as it's supported since gradle 7.3, and since that supports all 7.x projects, it should be for people requiring older build tools. However, it can cause problems for people on gradle 6.x. Gradle 7.x was introduced in 2021.
If you prefer the if statement, I can test a project on Gradle 7.x and 8.x tomorrow and update the PR with comments if they are successful.
https://github.com/flutter/flutter/issues/125621#issuecomment-1525995461 sounds like the approach officially adopted by the Flutter team so I think it's best we follow their approach.
Closing in favour of #96 which implements the recommended approach. Thanks both @leifcr and @daohoangson reporting, informing and contributing.
add namespace to build.gradle ( solves #90 )
However, it should probably be tested against older gradle versions if needed.