AndroidStudio gradle中singingconfig.properties中路径的语法错误

时间:2018-03-02 05:15:38

标签: android android-gradle

下面是gradle控制台错误语句,signingconfig.properties文件,signedconfig.gradle代码,用于读取文件。我相信这是一个简单的语法错误,如引号。有人可以更正signingconfig.properties文件中的语法吗?

  • 其中: 脚本'/Users/gregmarsh/AndroidStudioProjects/DanceApps1/WCSVidMet/signingconfig.gradle'line:23

  • 出了什么问题: 评估脚本时出现问题。

      

    path和baseDir都不能为null或空字符串。 path ='null'soundir ='/ Users / gregmarsh / AndroidStudioProjects / DanceApps1 / WCSVidMet'

下面的signingconfig.properties文件

debug.store=
release.store=/Users/gregmarsh/AndroidStudioProjects/android.jks
release.storePass=
release.alias=MyAndroidKey
release.pass=

visaconfig.gradle代码,用于读取

下面的文件
def readPasswordFromConsole(prompt) {
    def c = System.console()
    if(c != null) {
        return new String(System.console().readPassword("\n\$ " + prompt + " "))
    }
    return ""
}

android {
    signingConfigs {
        def configPropsFile = file("signingconfig.properties")
        if (configPropsFile.exists()) {
            def props = new Properties()
            props.load(new FileInputStream(configPropsFile))

            debug {
                if(props.debug_store?.trim()) {
                    storeFile file(props.debug_store)
                }
            }

            release {
                storeFile file(props.release_store)
                storePassword(props.release_storePass?.trim() ? props.release_storePass : readPasswordFromConsole("keystore pass:"))
                keyAlias props.release_alias
                keyPassword(props.release_pass?.trim() ? props.release_pass : readPasswordFromConsole("key pass:"))
            }
        } else {
            println "signingconfig.properties file is missing (required for release builds)!"
        }
    }
}

0 个答案:

没有答案