在舊版本中,我們可以通過 android/app/build.gradle 更改它。現在,當我們更改它時,它會出錯。
defaultConfig {
applicationId "com.example.manuel"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
有些人通過 local.properties 解決了這個問題,但這種方法也不起作用。
sdk.dir=C:/Users/user/AppData/Local/Android/Sdk
flutter.sdk=C:\\src\\flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
uj5u.com熱心網友回復:
您還需要build.gradle在新版本中編輯該檔案。如下;
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.manuel"
minSdkVersion 16 // <--- There minSdkVersion Content
targetSdkVersion 27 <--- There targetSdkVersion (is actually Max Sdk Version) Content
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
然后重建專案并再次構建它。
我希望這會很有用。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/388550.html
