Hi to everyone, It is my first time here.
Here’s the issue:
I first wanted to build My app in release mode, after I updated my app Flutter version.
Flutter doctor output:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.2, on macOS 13.0.1 22A400 darwin-arm64, locale en-IT)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.81.1)
[✓] Connected device (2 available)
[✓] Network resources
• No issues found!
but I got an error with the ext.kotlin_version that was too old (1.6.10) so I updated it
Now is : ext.kotlin_version = '1.8.22'
and here’s the dependencies:
dependencies {
classpath 'com.android.tools.build:gradle:8.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
}
I’ve also updated the gradle-wrapper.properties from distributionUrl=https://services.gradle.org/distributions/gradle-7.4-all.zip
to:
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
After I run flutter build apk I got an error telling me to put my package name “com.example.namespace” inside android{ in android/app/build.gradle and I did so. And also removed it from AndroidManifest.xml
The error has disappeared, but now the situation is this, if i run “flutter build apk”
I get this:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':audio_session'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
> Namespace not specified. Please specify a namespace in the module's build.gradle file like so:
android {
namespace 'com.example.namespace'
}
If the package attribute is specified in the source AndroidManifest.xml, it can be migrated automatically to the namespace value in the build.gradle file using the AGP Upgrade Assistant; please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.
* 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.
Please Help me, I don’t kow how to fix it, I don’t find a audio_session module, It is an external dependency I think… and If in Android studio I try to click on Tools/AGP Upgrade Assistant, nothing happens.
Thanks in advance.