youlookwhat / CloudReader

🗡️ 云阅:一款基于网易云音乐UI,使用玩Android Api,Retrofit2 + RxJava2 + Room + MVVM-databinding架构开发的Android客户端
https://youlookwhat.github.io/CloudReader
Apache License 2.0
4.94k stars 1.33k forks source link

app build.gradle 提示 unknown property 'pToken' #63

Closed freesonfish closed 6 years ago

freesonfish commented 6 years ago

完整提示:Error:(21, 0) Could not get unknown property 'pToken' for BuildType_Decorated{name=release, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}} of type com.android.build.gradle.internal.dsl.BuildType.

freesonfish commented 6 years ago

还有 app build.gradle 一堆变量都没见有定义 pStoreFile、pStorePassword、pKeyAlias、pKeyPassword

youlookwhat commented 6 years ago

建议直接把build.gradle的相关代码删掉,

buildTypes {
        // 将pToken使用 "" 代替!
        release {
            buildConfigField "String", "UPDATE_TOKEN", pToken
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            buildConfigField "String", "UPDATE_TOKEN", pToken
        }
    }

    //signing files settings
    signingConfigs {
        if (propertyHaveSigningConfigs) {
            debug {
                storeFile file(pStoreFile)
                storePassword pStorePassword
                keyAlias pKeyAlias
                keyPassword pKeyPassword
            }

            release {
                storeFile file(pStoreFile)
                storePassword pStorePassword
                keyAlias pKeyAlias
                keyPassword pKeyPassword
            }
        }
    }

都删掉。 因为是个人秘钥和token,所以做处理了。

youlookwhat commented 6 years ago

变量在一个本地可忽略的配置文件里,因为上传忽略了,所以克隆下来看不见,把关于签名的部分删掉,把pToken用空字符串代替就好了

youlookwhat commented 6 years ago

@freesonfish 项目根目录新建 gradle.properties 文件,里面添加pToken = "xx"

youlookwhat commented 6 years ago

@freesonfish 已更正,下载最新的包即可!