“当我gradlew assembleDebug

时间:2017-04-26 15:07:28

标签: firebase react-native

我克隆了react-native-hackathon-starter repo,写了我自己的小应用程序并试图使用gradle assembleDebug构建一个apk for debug,但是我得到了这个例外:

  

路径\到\项目\机器人\构建\中间体\分解-AAR \ com.google.android.gms \玩服务基\ 10.2.1 \ RES \抽拉\ common_google_signin_btn_icon_dark_normal.xml:3:29-91 :找不到与给定名称匹配的资源(在'drawable'处,值为'@ drawable / common_google_signin_btn_icon_dark_normal_background')。   path \ to \ project \ android \ build \ intermediates \ explosion-aar \ com.google.android.gms \ play-services-base \ 10.2.1 \ res \ drawable \ common_google_signin_btn_icon_light_normal.xml:3:29-92:No resource发现它匹配给定的名称('drawable'与值'@ drawable / common_google_signin_btn_icon_light_normal_background')。   path \ to \ project \ android \ build \ intermediates \ explosion-aar \ com.google.android.gms \ play-services-base \ 10.2.1 \ res \ drawable \ common_google_signin_btn_text_dark_normal.xml:3:29-91:没有资源发现它匹配给定的名称('drawable'与值'@ drawable / common_google_signin_btn_text_dark_normal_background')。   path \ to \ project \ android \ build \ intermediates \ explosion-aar \ com.google.android.gms \ play-services-base \ 10.2.1 \ res \ drawable \ common_google_signin_btn_text_light_normal.xml:3:29-92:No resource发现它匹配给定的名称('drawable'与值'@ drawable / common_google_signin_btn_text_light_normal_background')。

FAILED

失败:构建因异常而失败。

  • 出了什么问题: 任务':react-native-firestack:processReleaseResources'执行失败。

      

    com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:处理'命令'C:\ Users \ my_user \ AppData \ Local \ Android \ android-sdk \ build-tools \ 23.0.1 \ aapt.exe''以非零退出值1结束

  • 尝试: 使用--info或--debug选项运行以获得更多日志输出。

  • 例外情况是: org.gradle.api.tasks.TaskExecutionException:任务执行失败':react-native-firestack:processReleaseResources'。

据我所知,它缺少一些图形资源。我在组装之前尝试过gradlew clean,它仍然无法解决问题。

其他人和我一样issue

我的package.json:

{
"name": "HackathonStarter",
"version": "0.0.2",
"private": true,
"scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
},
"dependencies": {
    "firebase": "^3.6.7",
    "native-base": "^2.1.0",
    "react-addons-update": "^15.4.2",
    "react-native-easy-grid": "^0.1.8",
    "react-native-firestack": "^2.3.9",
    "react-native-router-flux": "^3.37.0",
    "react-native-svg": "^5.1.7",
    "redux-thunk": "^2.2.0",
    "jest-react-native": "^18.0.0",
    "lodash": "^4.17.4",
    "react": "~15.5.4",
    "react-native": "0.43.4",
    "react-native-elements": "^0.11.2",
    "react-native-vector-icons": "^4.0.0",
    "react-redux": "^5.0.1",
    "redux": "^3.6.0"
},
"devDependencies": {
    "babel-jest": "19.0.0",
    "babel-preset-react-native": "1.9.1",
    "jest": "19.0.2",
    "react-test-renderer": "~15.5.4"
},
"jest": {
    "preset": "react-native"
}

}

有没有人知道如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

删除node_modules文件夹后,再执行一次npm安装,删除node_modules / react-native-router-flux / react-native并编辑

  

compile' com.google.android.gms:play-services-base:+

来自node_modules / react-native-firestack / android / build.gradle,因为它在我的根build.gradle中导致了对gms依赖的干扰,我能够做一个gradlew assembleDebug和assembleRelease。

我认为firestack包存在问题,没有正确捆绑资产或其他什么。一切都很好。