【发布时间】:2019-12-16 05:56:47
【问题描述】:
我正在准备在 Playstore 中发布我的颤振应用程序,它给了我这个错误:
错误:
* Where:
Build file 'C:\Users\svesp\Desktop\Vlad Esplana\syncshop_webview\android\app\build.gradle' line: 60
* What went wrong:
A problem occurred evaluating project ':app'.
> path may not be null or empty string. path='null'
我的key.properties:
storePassword=hidden
keyPassword=hidden
keyAlias=random
storeFile=C:/Users/svesp/key.jks
我的应用级别build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.hivemanila.syncshop_webview"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
signingConfigs {
release {
keyAlias keystoreProperties['hidden']
keyPassword keystoreProperties['hidden']
storeFile file(keystoreProperties['C:/Users/svesp/key.jks'])
storePassword keystoreProperties['hidden']
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}
【问题讨论】:
-
android\app\build.gradle' line: 60那条线是什么样子的? -
你检查过 line: 60 吗?可能是找不到路径。请检查 gradle 路径。
-
嗨@pskink 它的
storeFile file(keystoreProperties['C:/Users/svesp/key.jks']) -
我绝对确定该文件存在,因为我可以在我设置的路径中看到它
-
将存储的文件路径 C:/Users/svesp/key.jks 更改为 C:\Users\svesp\Desktop\Vlad Esplana\syncshop_webview\android\app\key.jks
标签: android flutter flutter-layout flutter-dependencies