0
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
def keystoreProperties=new Properties()
def keystorePropertiesFile=rootProject.file('key.properties')

if(keystorePropertiesFile.exists()){
  keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

if (localPropertiesFile.exists()) {
  localPropertiesFile.withReader('UTF-8') { reader ->
     localProperties.load(reader)
 }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
   throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the 
   local.properties file.")
 }

 def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
 if (flutterVersionCode == null) {
    flutterVersionCode = '1'
  }

 def flutterVersionName = localProperties.getProperty('flutter.versionName')

 if (flutterVersionName == null) {
   flutterVersionName = '1.0'
  }

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'kotlin-android'
android {
  compileSdkVersion 29

  lintOptions {
     disable 'InvalidPackage'
   }

defaultConfig {
    applicationId "com.name.nameapp"
    minSdkVersion 16
    targetSdkVersion 29
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    multiDexEnabled=true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs{
    release{
        keyAlias keystoreProperties['keyAlias']
        keyPassword keystoreProperties['keyPassword']
        storeFile file(keystoreProperties['storeFile'])
        storePassword keystoreProperties['storePassword']
    }
}

buildTypes {
    release {

        minifyEnabled true
        useProguard true

        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.release

    }
    debug{
        signingConfig signingConfigs.debug
    }
  }
}

flutter {
   source '../..'
}

dependencies {
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

  implementation 'com.google.firebase:firebase-ads:18.2.0'

  implementation 'com.google.firebase:firebase-analytics:17.0.1'
   // Check for v11.4.2 or higher
  implementation 'com.google.firebase:firebase-core:17.0.1'

  // Add dependency
  implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
  }
 apply plugin: 'io.fabric'
 apply plugin: 'com.google.gms.google-services'
  • I tried to do the flutter clean,
  • I saw in the manifest if the package was the same.
  • I did build apk and it did it well.
  • I saw if the main folders were com.name.nameapp and it is ok.

Before I updated flutter, everything worked fine. I'm sure there is some conflict in the libraries, but how can I get out of it?

Nikos Hidalgo
  • 3,666
  • 9
  • 25
  • 39
AlexPad
  • 10,364
  • 3
  • 38
  • 48
  • After many hours I found the solution I posted it here: https://stackoverflow.com/questions/50297571/dart-flutter-application-crashes-on-startup/60398960#60398960 – AlexPad Feb 25 '20 at 16:19

1 Answers1

-1

run gradlew clean in your android folder this should help

Yoram
  • 1
  • 1