Flutter android app crashes upon startup if I include a certain package

后端 未结 5 726
庸人自扰
庸人自扰 2021-01-06 01:33

A problem has suddenly recently arisen such that simply by including the dependency in \'location\' in pubspec.yaml like e.g.

dependencies:
  flutter:
             


        
5条回答
  •  萌比男神i
    2021-01-06 02:07

    I was facing the same issue. What I did was insert the line multiDexEnabled true in my build.gradle of app. Like this:

        defaultConfig {
            // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
            applicationId "com.example"
            minSdkVersion 16
            targetSdkVersion 27
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    
            multiDexEnabled true //Insert this line
        }
    

    Try this and run the commands flutter clean, flutter build apk and flutter run. It must solve your problem.

提交回复
热议问题