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

后端 未结 5 724
庸人自扰
庸人自扰 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条回答
  •  独厮守ぢ
    2021-01-06 02:07

    I had similar issues, and after spending a few good hours on it, to find out the problem is Kotlin, that I created the project without Kotlin and Swift support. The Dart part of the code works fine, but the Android app would crash on launch with Kotlin code but works fine with Java.

    To create Flutter project with Kotlin/Swift support from command:

    flutter create --org co.uk.sample -i swift -a kotlin --description 'Your Project Description' sample_app

    Where --org defines the project path, -i enables Swift, -a enables Kotlin, followed by your app name at the end.

提交回复
热议问题