2

首先,我仔細查看並嘗試了各種找不到資源的帖子,但仍未找到工作修正對於這些我不確定爲什麼會出現的錯誤,考慮到上次啓動應用程序時,它的構建正常。錯誤:找不到與給定名稱匹配的資源(在'src'中,值爲'@ drawable/googleg_standard_color_18')

enter image description here

錯誤:(16,30)沒有資源發現在給定的名字相匹配(在 'SRC',值爲 '@繪製/ googleg_disabled_color_18')。

錯誤:(9,30)找不到與給定名稱匹配的資源(位於'src',值爲'@ drawable/googleg_standard_color_18')。

這裏的gradle這個樣子

android { 
compileSdkVersion 25 
buildToolsVersion '25.0.0' 

defaultConfig { 
    applicationId "com.moveapps" 
    minSdkVersion 16 
    targetSdkVersion 23 
    multiDexEnabled true 
    versionCode 1 
    versionName "1.1.0" 
    ndk { 
     abiFilters "armeabi-v7a", "x86" 
    } 
} 

任何幫助或建議,將不勝感激!提前致謝!

這個問題的更多核心是我不太瞭解這裏的問題,所以如果任何人都可以指出我可以在哪裏閱讀更多關於這類問題的信息,我很樂意學習修復背後的原因。

乾杯,

編輯:添加的package.json文件

{ 
    "name": "moveapp", 
    "version": "0.0.1", 
    "private": true, 
    "scripts": { 
    "start": "node node_modules/react-native/local-cli/cli.js start", 
"test": "jest" 
}, 
"dependencies": { 
"async": "^2.4.0", 
"firebase": "^3.9.0", 
"images": "^3.0.0", 
"lodash": "^4.17.4", 
"moment": "^2.18.1", 
"react": "15.4.1", 
"react-native": "^0.41.2", 
"react-native-app-intro": "^1.1.5", 
"react-native-apple-healthkit-rn0.40": "^0.2.1-2", 
"react-native-chart": "git+https://[email protected]/robcalcroft/react-native-chart.git", 
"react-native-communications": "^2.2.1", 
"react-native-confetti": "0.0.4", 
"react-native-fbsdk": "^0.5.0", 
"react-native-fcm": "^6.2.3", 
"react-native-firestack": "^2.3.9", 
"react-native-google-fit": "^0.2.0", 
"react-native-modal-picker": "0.0.16", 
"react-native-progress": "^3.2.0", 
"react-native-router-flux": "3.37.0", 
"react-native-scrollable-tab-view": "^0.7.2", 
"react-native-search-bar": "^3.0.0", 
"react-native-searchbar": "^1.10.0", 
"react-native-vector-icons": "^4.1.1", 
"react-redux": "^5.0.2", 
"redux": "^3.6.0", 
"redux-persist": "^4.7.1", 
"redux-thunk": "^2.2.0", 
"tipsi-stripe": "^3.7.0", 
"uuid": "^3.0.1" 
    }, 
"devDependencies": { 
"babel-jest": "18.0.0", 
"babel-preset-react-native": "1.9.1", 
"eslint-config-rallycoding": "^3.2.0", 
"jest": "18.1.0", 
"react-test-renderer": "15.4.1" 
    }, 
"jest": { 
"preset": "react-native" 
} 
} 
+0

難道這些圖像或顏色您設置我的示例代碼? – NeoVe

+0

看起來像這些已經改變,或已被刪除,但它只是一個猜測 – NeoVe

+0

添加你的package.json請 –

回答

0

通常這個錯誤發生在你沒有SDK構建具有相同版本的工具安裝,所以你需要安裝buildToolsVersion '25 0.0 0.0' ,但根據您的package.json的依賴,你需要改變你的​​是這樣

android { 

    compileSdkVersion 23 
    buildToolsVersion "23.0.1" 

    defaultConfig { 
    applicationId "com.moveapps" 
    minSdkVersion 16 
    targetSdkVersion 22 
    multiDexEnabled true 
    versionCode 1 
    versionName "1.1.0" 
    ndk { 
     abiFilters "armeabi-v7a", "x86" 
    } 
} 

android/build.gradle是這樣

buildscript { 

    dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.3' // this is the correct version for build tool 

    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
    //  classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' 
    } 
} 

也是不建議更新反應原生的Android項目投Android的工作室,因爲它會區分錯誤到底

+0

感謝Mohamed,我試過以前的版本,並且Gradle無法同步爲錯誤信息:Error:SDK Build Tools revision(23.0.1)is項目':app'太低。最低要求是25.0.0 Update Build Tools version and sync project
Open File xclearner

+0

所以我降級到你建議的設置,然後gradle以及2.2.3。這樣做似乎暗示我的Google服務依賴關係可能存在一些衝突,所以我要調查一下......謝謝! – xclearner

+0

看到這個更新 –

0

所以,下面@mohamed卡希爾的建議下,我降級構建工具版本從25降低到23.0.1。以及從25編譯SDK到23。然而這導致了谷歌服務之間的其他依賴關係錯誤。

首先,我強制所有的谷歌播放服務和firebase版本,我發現它們是依賴於我使用的庫(fcm等)到10.0.1,但它仍然產生了衝突錯誤。這是唯一的,直到我發現這個介質後:

https://medium.com/@suchydan/how-to-solve-google-play-services-version-collision-in-gradle-dependencies-ef086ae5c75f

這表明通過所有的gradle這個設置,在那裏我發現,衝突是在播放服務地圖,發揮服務錢包,併發揮去 - 服務 - 身份(即使我沒有真正使用這個)。一旦我強制這三個版本的編譯,應用程序沒有任何問題。

所以,謝謝穆罕默德幫助我恢復正確的方向!

下面是我添加

` android { 
    - compileSdkVersion 25 
    - buildToolsVersion '25.0.0' 
    + compileSdkVersion 23 
    + buildToolsVersion '23.0.1' 

    defaultConfig { 
     applicationId "com.moveapps" 
     minSdkVersion 16 
    -  targetSdkVersion 23 
    +  targetSdkVersion 22 
     multiDexEnabled true 
     versionCode 1 
     versionName "1.1.0" 
    @@ -149,20 +149,70 @@ repositories { 

    dependencies { 
    compile project(':tipsi-stripe') 
- compile project(':react-native-google-fit') 
    compile project(':react-native-fbsdk') 
- compile project(':react-native-fcm') 
- compile project(':react-native-firestack') 
+ 
+ compile(project(':react-native-google-fit')){ 
+  exclude group: 'com.google.android.gms', module: 'play-services-auth' 
+  exclude group: 'com.google.android.gms', module: 'play-services-fitness' 
+ } 
+ 
+ compile(project(':react-native-fcm')){ 
+  exclude group: 'com.google.firebase', module: 'firebase-messaging' 
+  exclude group: 'com.google.firebase', module: 'firebase-core' 
+ } 
+ 
+ compile(project(':react-native-firestack')){ 
+  exclude group: 'com.google.firebase', module: 'firebase-messaging' 
+  exclude group: 'com.google.firebase', module: 'firebase-core' 
+  exclude group: 'com.google.firebase', module: 'firebase-auth' 
+  exclude group: 'com.google.firebase', module: 'firebase-analytics' 
+  exclude group: 'com.google.firebase', module: 'firebase-storage' 
+ 
+  exclude group: 'com.google.android.gms', module: 'play-services-base' 
+  exclude group: 'com.google.android.gms', module: 'play-services-gcm' 
+ } 
+ 
+ compile('com.google.android.gms:play-services-auth:10.0.1') { 
+  force = true; 
+ } 
+ compile('com.google.android.gms:play-services-fitness:10.0.1') { 
+  force = true; 
+ } 
+ 
+ compile('com.google.android.gms:play-services-base:10.0.1') { 
+  force = true; 
+ } 
+ 
+ compile('com.google.android.gms:play-services-gcm:10.0.1') { 
+  force = true; 
+ } 
+ 
+ compile('com.google.android.gms:play-services-identity:10.0.1') { 
+  force = true; 
+ } 
+ 
+ compile('com.google.android.gms:play-services-maps:10.0.1') { 
+  force = true; 
+ } 
+ 
+ compile('com.google.android.gms:play-services-wallet:10.0.1') { 
+  force = true; 
+ } 
+ 
    compile('com.google.firebase:firebase-core:10.0.1') { 
     force = true; 
    } 
    compile('com.google.firebase:firebase-messaging:10.0.1') { 
     force = true; 
    } 
- compile('com.google.android.gms:play-services-gcm:10.0.1') { 
+ 
+ compile('com.google.firebase:firebase-auth:10.0.1') { 
     force = true; 
    } 
- compile('com.google.android.gms:play-services-base:10.0.1') { 
+ compile('com.google.firebase:firebase-analytics:10.0.1') { 
+  force = true; 
+ } 
+ compile('com.google.firebase:firebase-storage:10.0.1') { 
     force = true; 
    }` 
相關問題