crazycodeboy / GitHubPopular

这是一个用来查看GitHub最受欢迎与最热项目的App,它基于React Native支持Android和iOS双平台。#适配RN最新版在这里☞#

Home Page:http://coding.imooc.com/class/304.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

按照步骤,执行run-android报错

Ariel08081214 opened this issue · comments

commented

2017-12-22_20-13-48

commented

请问是什么原因呢?

commented

请问解决了吗

我也是 这个问题

commented

刚开始编译项目的时候,我也遇到了这个问题。我的情况中的解决方案是移除他的签名相关的配置。你可以用Android Studio打开该项目,然后在Terminal中输入gradlew --info,这样你可以获取到更多的输出的错误信息。然后,我发现是他的签名那里出的问题,然后我对代码做了几处修改(全部都是在app下面的build.gradle文件里面):

1.首先把def enableProguardInReleaseBuilds = true修改为false
2.然后移除

def getPassword(String currentUser, String keyChain) {
    def stdout = new ByteArrayOutputStream()
    def stderr = new ByteArrayOutputStream()
    exec {
        commandLine 'security', '-q', 'find-generic-password', '-a', currentUser, '-s', keyChain, '-w'
        standardOutput = stdout
        errorOutput = stderr
        ignoreExitValue true
    }
    //noinspection GroovyAssignabilityCheck
    stdout.toString().trim()
}
def pass = getPassword("jph","jph_android_keystore")

3.再移除

    signingConfigs {//签名配置
        release {
            storeFile file(MYAPP_RELEASE_STORE_FILE)
            storePassword pass
            keyAlias MYAPP_RELEASE_KEY_ALIAS
            keyPassword pass
        }
    }

4.最后把buildTypes中的下面代码移除

            signingConfig signingConfigs.release

再次编译就可以编译通过了

commented

我后来没试过了,楼上的解决方法可以试试 @milk-coffee-tea @1064989385

Follow these steps to solve the problem.

按照这位仁兄@Shouheng88 的方法去做,我的也可以编译了,虽然跑到虚拟机后还是有报错