shwenzhang / AndResGuard

proguard resource for Android by wechat team
Apache License 2.0
8.54k stars 1.54k forks source link

Could not find property 'release' on SigningConfig container. #38

Closed tinybright closed 8 years ago

tinybright commented 8 years ago

Could not find property 'release' on SigningConfig container.

simpleton commented 8 years ago

Didn't you set your singingConfig in your build.gradle ? Here is the code snippet:

 signingConfigs {
        release {
            storeFile file("../keystore/release.keystore")
            storePassword "testres"
            keyAlias "testres"
            keyPassword "testres"
        }

        debug {
            storeFile file("../keystore/debug.keystore")
        }
    }
tinybright commented 8 years ago
signingConfigs {
        config1 {

        }
 }

这个应该是取第一个吧。感觉按名字取不靠谱。

pranaysharma commented 8 years ago

I am getting the same error. The regular release is build correctly which I can upload to the play store. My Gradle file is similar to as suggested at : https://github.com/futurice/android-best-practices#gradle-configuration

signingConfigs {
    release {
        try {
            storeFile FILE_PATH
            storePassword KEYSTORE_PASSWORD
            keyAlias KEY_ALIAS
            keyPassword KEY_PASSWORD
        }
        catch (ex) {
            throw new InvalidUserDataException("You should define KEYSTORE_PASSWORD and KEY_PASSWORD in gradle.properties.")
        }
    }
}

These variables are stored in gradle.properties

tinybright commented 8 years ago

You should remove try catch

pranaysharma commented 8 years ago

Thankyou again for your reply. I tried removing the try catch also. Got the below error on console

:app:generate use7zip = true metaName = META-INF keepRoot = false whiteList = [.R.drawable.icon,.R.string.com.crashlytics.] compressFilePattern = [.png, .jpg, .jpeg, *.gif, resources.arsc] zipAlignPath = /Users/user_name/Library/Android/sdk/build-tools/23.0.2/zipalign 7zipPath = /usr/local/bin/7za :app:generate FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:generate'.

    Could not find property 'release' on SigningConfig container.

tinybright commented 8 years ago

Did you rebuild your project?And can you add your cmdline and build.gradle?

simpleton commented 8 years ago

@pranaysharma I guess it cause by the order of variable declare. could you put the andResGuard {...} at the bottom of your build.gradle file?

TigerChain commented 8 years ago

按照你说的修改了还是报这样的错

signingConfigs{
        realase{
            storeFile file(STORE_FILE)
            storePassword STORE_PASSWORD
            keyAlias KEY_ALIAS
            keyPassword KEY_PASSWORD
            try {
                storeFile file(STORE_FILE)
                storePassword STORE_PASSWORD
                keyAlias KEY_ALIAS
                keyPassword KEY_PASSWORD
            } catch (ex) {
                throw new InvalidUserDataException("You should define KEYSTORE_PASSWORD and KEY_PASSWORD in gradle.properties.")
            }
        }
    }

并且 andResGuard放在build.grade最后的

tinybright commented 8 years ago

realase -> release

TigerChain commented 8 years ago

真心太不细心了,就说搞了好久 都不知道 汗

zhuangjiahua commented 8 years ago

如果项目要打多个渠道包,每个包对应不同的签名,那该如何设置?

simpleton commented 8 years ago

使用多productFlavors就可以了,最新版本已经支持了。

On Sun, May 29, 2016 at 10:34 AM, zhuangjiahua notifications@github.com wrote:

如果项目要打多个渠道包,每个包对应不同的签名,那该如何设置?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/shwenzhang/AndResGuard/issues/38#issuecomment-222339302, or mute the thread https://github.com/notifications/unsubscribe/AAbvYkVlf6hDl-ldjkq2t3RHtZCYoDGQks5qGPslgaJpZM4HON__ .