1

I have been facing an issue with running my app on android due to some crashlytics error. The following is the error I am getting

enter image description here

I checked my app level build.gradle and still unable to figure out the issue. Can someone help me with it. The following is my build.gradle for reference.

enter image description here

Any help would be appreciated.

UPDATE: I have added the following code into my build.gradle and it fixed the crashlytics error.

buildscript {
    // buildscript config

    dependencies {
        // Other dependencies
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.0'
    }
}

Now I am getting this new error while running. It's some shrinker error. The following are the screenshot of the error.

enter image description here

enter image description here

Please help me out with this error.

UPDATE 2:

enter image description here enter image description here

UPDATE 3

enter image description here

UPDATE 4:

enter image description here

UPDATE 5

enter image description here

Lakshya Jain
  • 186
  • 1
  • 11

1 Answers1

1

In android folder add classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.0' line to dependencies block:

buildscript {
    // buildscript config

    dependencies {
        // Other dependencies
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.0'
    }
}
fartem
  • 2,361
  • 2
  • 8
  • 20
  • I added that and it fixed the crashlytics error but now I am getting this shrinker error. Please check the updated question for error screenshots and help me out with it. – Lakshya Jain Feb 21 '21 at 16:56
  • https://stackoverflow.com/questions/48249633/errorcannot-fit-requested-classes-in-a-single-dex-file-try-supplying-a-main-dex – fartem Feb 22 '21 at 05:21
  • I followed what it said in that thread but after changing my minSDK to 21 my app is stuck at ✓ Built build/app/outputs/flutter-apk/app-debug.apk. for the past 30-45 mins – Lakshya Jain Feb 22 '21 at 06:46
  • Try building it again. It might take a while, but shouldn't be that long. – Apps 247 Feb 22 '21 at 08:04
  • @Apps247 I did but what it does is that it launches the app for a few seconds and after that it just closes down and is stuck on ✓ Built build/app/outputs/flutter-apk/app-debug.apk. and doesn't do anything after that – Lakshya Jain Feb 22 '21 at 16:29
  • @Apps247 Does targetSDK version affect it? – Lakshya Jain Feb 22 '21 at 17:24
  • @LakshyaJain Can you add an error from console output? – fartem Feb 23 '21 at 07:43
  • @fartem The second error is updated in the question and the built app one as well please check the question – Lakshya Jain Feb 23 '21 at 09:50
  • Can you add an error from app? Run the app and wait for crash, in output Flutter must show tue error in runtime. – fartem Feb 23 '21 at 10:02
  • @fartem There is nothing on the output screen, The output screen is blank tho the emulator shows an alert dialog on the home page which says "App Keeps Stopping" Check app info or Close the App I get these two buttons. But I uninstalled the app from emulator and reinstalled and got this new thing in debug console it is updated as UPDATE 3 In the question please check it. The blue text in debug console comes right after the ✓ Built build/app/outputs/flutter-apk/app-debug.apk. and the app still crashes and there is no admob services installed either in the app at the moment. – Lakshya Jain Feb 24 '21 at 03:47
  • https://stackoverflow.com/questions/52786963/unable-to-get-provider-com-google-android-gms-ads-mobileadsinitprovider-java-la – fartem Feb 24 '21 at 03:58
  • @fartem But I dont have admob or any adservice there in either android nor iOS or any code related to that – Lakshya Jain Feb 24 '21 at 11:56
  • Can you post your `pubspec.yaml` file? – fartem Feb 24 '21 at 13:50
  • @fartem Check Update 4 in the above question – Lakshya Jain Feb 24 '21 at 16:03
  • You are using some Android libraries that implementing in `build.gradle`? – fartem Feb 24 '21 at 18:16
  • @fartem yeah like the firebase staff some of it use the build.gradle but today I upgraded flutter it and ran the app again it didnt show the built thing or the admob sdk issue this time it was something else please check update 5 for the new error. It may give you more clarity on what the error is. – Lakshya Jain Feb 25 '21 at 03:57
  • What version of Flutter do you using? – fartem Feb 25 '21 at 04:46
  • @fartem not sure the one I was using before but I just upgraded my flutter and at 1.22.6 and at stable channel this time. Somehow I was at master channel and then now running the app is back to UPDATE 3 – Lakshya Jain Feb 25 '21 at 05:03
  • Can you run `flutter clean` from project folder and try to run app again? – fartem Feb 25 '21 at 05:44
  • Still facing the same exact thing. After that 10 more in the last line in UPDATE 3 it just stops right there – Lakshya Jain Feb 25 '21 at 06:39
  • Run `./gradlew app:dependencies` from `android` folder, it prints all dependencies on Android side in your project. Try to find `AdMob` and who implements it. – fartem Feb 25 '21 at 08:07
  • @fartem so I just checked and It apparently doesn't have anything related to ads or admob – Lakshya Jain Feb 25 '21 at 18:17
  • Create new question with this problem. – fartem Feb 26 '21 at 05:50