Add conditional namespace to support gradle 8#65
Add conditional namespace to support gradle 8#65egonm12 wants to merge 2 commits intoByneappLLC:masterfrom
Conversation
|
Thanks for the PR, this saved me a lot of time. Hopefully the repo maintainer can merge this. In the mean time, install like this in your pubspec: |
|
@edTheGuy00 Could we merge this? |
|
@kev-techi @kevinetore I recommend changing to Be aware of the problems with |
|
I would actually recommend not using this approach at all actually and just going with the standard way of defining env variables for each platform:
This is the type of dependency which can stop you from being able to build your app if you open up the project 6 months later after an XCode or iOS update. |
|
@kev-techi The downside is that you don't have a single source of truth for your environment variable value (in case Android and iOS variable values are the same). With the provided workaround this still works, you have to point your .plist key to the variable generated by Flutter. The same works for Android. SomeGeneratedFile.xcconfig Info.plist |
|
I would say that the amount of time wasted with extra packages like this one is not worth it. Especially when they introduce bugs and random dependencies that have nothing to do with the core of your project. Easier to just use native configuration files where needed. Locally you do it once and in your CI/CD, it's easy to set up. But it's just a personal preferences. 🤷 , do whatever works best for your scenario. |
A breaking change was introduced in gradle 8. You must set the namespace in the module-level build.gradle.kts file, rather than the manifest file. More info: https://developer.android.com/build/releases/past-releases/agp-8-0-0-release-notes#namespace-dsl
Setting it conditionally for backwards compatibility: flutter/flutter#125621