Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android studio 升级到2.2之后,使用gradle 2.2.0 版本,不能识别assembleRelease和assembleDebug #18

Open
fantianwen opened this issue Oct 11, 2016 · 5 comments

Comments

@fantianwen
Copy link

Could not get unknown property 'assembleRelease' for project

翻查了一下解决方法,这个:http://stackoverflow.com/questions/39602587/could-not-get-unknown-property-assemblerelease-for-project/39969649#39969649

使用这样的方法是可以的,已经测试通过了。

@fantianwen fantianwen changed the title android studio 升级到2.2之后,不能识别assembleRelease和assembleDebug android studio 升级到2.2之后,使用gradle 2.2.0 版本,不能识别assembleRelease和assembleDebug Oct 11, 2016
@pzl237
Copy link

pzl237 commented Oct 23, 2016

@fantianwen 在gradle 2.2.0之后版本,你修复了编译问题,能否把修改后的贴出来参考?

@fantianwen
Copy link
Author

@pzl237

把这两个task像这样写就行了~

task copySkinFileDebug {
    println("====================begin copy skin file.=========================")

    def dir = new File(TARGET_SKIN_DIR)
    if (!dir.exists()) {
        dir.mkdirs()
    }

    def f = new File(TARGET_SKIN_DIR + SAMPLE_NAME)
    if (f.exists()) {
        f.delete()
    }

    copy {
        from('build/outputs/apk')
        into(TARGET_SKIN_DIR)
        include '*.apk'
        exclude '**/*-unaligned.apk'
        rename ('android-skin-loader-sample-debug.apk', SAMPLE_NAME)
    }

    println("====================skin file copyed .=====================")

}

copySkinFileDebug.dependsOn('assembleDebug')

@zxp0505
Copy link

zxp0505 commented Oct 25, 2016

我看见这两个task操作都是一样的 是重复操作吗?

@fantianwen
Copy link
Author

@pzl237
Copy link

pzl237 commented Oct 25, 2016

@fantianwen 谢谢啊,按照你的修改方法编译通过了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants