I developed an app in flutter with Visual Studio code on Mac. I ran the application without any kind of problem on IOS. I also installed it on a physical device and it works perfectly, but I have a problem generating the Android project study and its APK on with flutter.
Message:
flutter build appbundle
[!] Your app isn't using AndroidX.
To avoid potential build failures, you can quickly migrate your app by following the
steps on ...
Running Gradle task 'bundleRelease'...
Note: Some input files use unchecked or unsafe operations.
Running Gradle task 'bundleRelease'... Note: Recompile with -Xlint:unchecked for details.
Running Gradle task 'bundleRelease'...
Running Gradle task 'bundleRelease'... Done 217,9s (!)
Gradle build failed to produce an .aab file. It's likely that this file was generated under
/Users/riccardo/Desktop/QuoteFlutter/quote/build, but the tool couldn't find it.
AndroidX is a redesigned library to make package names more clear. So from now on, the Android hierarchy will only be for Android default classes that come with the Android operating system. Other library/dependencies will be part of AndroidX and all new development will be updated in AndroidX.
If you have a multi-root workspace, you can open any file in the Flutter project so the extension will find the correct files. Next, open the Command Palette ( Ctrl+Shift+P or Cmd+Shift+P on Mac) and search for 'androidx' to find the command "Convert Flutter Project to AndroidX".
in my own case my gradle.properties was missing. I Just created a new gradle.properties file inside the android folder, with the below parameter
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
The error description clearly states that
Your app isn't using AndroidX. To avoid potential build failures, you can quickly migrate your app by following the steps on ...
Follow this detailed documentation.
you should go to
YourAppName=> android => gradle.properties
inside gradle.properties add these two lines
android.useAndroidX=true
android.enableJetifier=true
dat should solve it.
I had an old project using Firestore, that I was trying to open, and got this message. I could not find any easy way to fix it.
These were the steps I took to migrate it, hope it helps someone.
Create a new folder.
Then run this command in Terminal, in the folder:
flutter create --org com.yourdomain your_app_name
Copy the files from lib folder, (and any other modifications from android or ios folders).
Copy google-services.json to android\app folder.
Modify pubspec.yaml and copy the dependencies under dependencies:
Change android\app\build.gradle change version to:
minSdkVersion 21
Add the plugins needed in android\app\build.gradle:
apply plugin: 'com.google.gms.google-services'
In Android\build.gradle file: Add the dependency (with your version):
classpath 'com.google.gms:google-services:4.3.3'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With