我已遵循官方指南为Flutter应用程序创建不同口味。 当我在模拟器上构建两种口味时,
flutter build apk --flavor a -t lib/main-a.dart
flutter install
该应用程序成功构建,但在启动时立即崩溃。我看过其他解决方案,但似乎都没有用。
android / app / src / main / AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutterclient">
android / app / build.gradle
defaultConfig {
minSdkVersion 19
targetSdkVersion 27
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
flavorDimensions "app"
productFlavors {
a {
dimension "app"
applicationId "com.example.flutterclient"
versionCode 1
versionName "1.0"
}
b {
dimension "app"
applicationId "com.example.flutterclient"
versionCode 1
versionName "1.0"
}
}
app / src / main / java / com / example / flutterclient / MainActivity.java
package com.example.flutterclient;
感谢您的帮助!