im trying to build a new android apk from flutter project, the minSdkVersion was 19 and the apk generated successfully, but not work on all android devices, some devices work with minSdkVersion 16, so when I changed the mindsVersion to 16 I cannot generate it cause I still get an error uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [com.google.firebase:firebase-core:20.0.0]
I'm trying to downgrade the Firebase Core but I cannot and still get this output.
here's my app/build.gradle
....
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-analytics'
implementation platform('com.google.firebase:firebase-bom:28.4.2')
}
apply plugin: 'com.google.gms.google-services'
and here's my android/gradle
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
}
}
can any one help me with this issue?
CodePudding user response:
For me using minSdkVersion 26 is the sweet spot.
defaultConfig {
applicationId "com.example.app"
minSdkVersion 26
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
implementation "androidx.browser:browser:1.2.0"
implementation platform('com.google.firebase:firebase-bom:29.0.0')
implementation 'com.google.firebase:firebase-perf'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'
}
android/gradle
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.8'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.0'
classpath 'com.google.firebase:perf-plugin:1.4.0'
}
CodePudding user response:
You should downgrade flutter firebase_core too.