2017-09-06 145 views
0

我最近彈出我的反應原生應用程序到Expokit。我正在嘗試使用react native firebase。按照android installation page上給出的反應原生firebase的設置說明,當我執行'react-native run-android'時,出現錯誤:「找不到com.google.firebase:firebase-core:11.2.0」。請注意,正如在其他網頁上給出的,我已經從Android studio安裝了Google play服務和Google知識庫,但即使這樣做後,我仍然遇到了錯誤。這裏是「反應本地運行的Android」的完整輸出:反應原生無法找到com.google.firebase

Scanning 885 folders for symlinks in /Users/aksheyjawa/Misc/mobiledev/reactNative/SRFYSSapp/node_modules (23ms) 
JS server already running. 
Building and installing the app on the device (cd android && ./gradlew installDebug)... 
NDK is missing a "platforms" directory. 
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /Users/aksheyjawa/Library/Android/sdk/ndk-bundle. 
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning. 

NDK is missing a "platforms" directory. 
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /Users/aksheyjawa/Library/Android/sdk/ndk-bundle. 
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning. 

Incremental java compilation is an incubating feature. 

FAILURE: Build failed with an exception. 

* What went wrong: 
A problem occurred configuring project ':app'. 
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'. 
    > Could not find com.google.firebase:firebase-core:11.2.0. 
    Searched in the following locations: 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-core/11.2.0/firebase-core-11.2.0.pom 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-core/11.2.0/firebase-core-11.2.0.jar 
     file:/Users/aksheyjawa/Misc/mobiledev/reactNative/SRFYSSapp/android/sdk-manager/com/google/firebase/firebase-core/11.2.0/firebase-core-11.2.0.jar 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-core/11.2.0/firebase-core-11.2.0.pom 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-core/11.2.0/firebase-core-11.2.0.jar 
     file:/Users/aksheyjawa/Misc/mobiledev/reactNative/SRFYSSapp/android/sdk-manager/com/google/firebase/firebase-core/11.2.0/firebase-core-11.2.0.jar 
    Required by: 
     project :app 
    > Could not find com.google.android.gms:play-services-base:11.2.0. 
    Searched in the following locations: 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-base/11.2.0/play-services-base-11.2.0.pom 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-base/11.2.0/play-services-base-11.2.0.jar 
     file:/Users/aksheyjawa/Misc/mobiledev/reactNative/SRFYSSapp/android/sdk-manager/com/google/android/gms/play-services-base/11.2.0/play-services-base-11.2.0.jar 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-base/11.2.0/play-services-base-11.2.0.pom 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-base/11.2.0/play-services-base-11.2.0.jar 
     file:/Users/aksheyjawa/Misc/mobiledev/reactNative/SRFYSSapp/android/sdk-manager/com/google/android/gms/play-services-base/11.2.0/play-services-base-11.2.0.jar 
    Required by: 
     project :app 
    > Could not find com.google.firebase:firebase-analytics:11.2.0. 
    Searched in the following locations: 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-analytics/11.2.0/firebase-analytics-11.2.0.pom 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-analytics/11.2.0/firebase-analytics-11.2.0.jar 
     file:/Users/aksheyjawa/Misc/mobiledev/reactNative/SRFYSSapp/android/sdk-manager/com/google/firebase/firebase-analytics/11.2.0/firebase-analytics-11.2.0.jar 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-analytics/11.2.0/firebase-analytics-11.2.0.pom 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-analytics/11.2.0/firebase-analytics-11.2.0.jar 
     file:/Users/aksheyjawa/Misc/mobiledev/reactNative/SRFYSSapp/android/sdk-manager/com/google/firebase/firebase-analytics/11.2.0/firebase-analytics-11.2.0.jar 
    Required by: 
     project :app 
    > Could not find com.google.android.gms:play-services-base:11.2.0. 
    Searched in the following locations: 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-base/11.2.0/play-services-base-11.2.0.pom 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-base/11.2.0/play-services-base-11.2.0.jar 
     file:/Users/aksheyjawa/Misc/mobiledev/reactNative/SRFYSSapp/android/sdk-manager/com/google/android/gms/play-services-base/11.2.0/play-services-base-11.2.0.jar 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-base/11.2.0/play-services-base-11.2.0.pom 
     file:/Users/aksheyjawa/Library/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-base/11.2.0/play-services-base-11.2.0.jar 
     file:/Users/aksheyjawa/Misc/mobiledev/reactNative/SRFYSSapp/android/sdk-manager/com/google/android/gms/play-services-base/11.2.0/play-services-base-11.2.0.jar 
    Required by: 
     project :app > host.exp.exponent:expoview:19.0.0 > com.google.android.gms:play-services-analytics:9.8.0 
     project :app > host.exp.exponent:expoview:19.0.0 > com.google.android.gms:play-services-gcm:9.8.0 
     project :app > host.exp.exponent:expoview:19.0.0 > com.google.android.gms:play-services-location:9.8.0 
     project :app > host.exp.exponent:expoview:19.0.0 > com.google.android.gms:play-services-fitness:9.8.0 
     project :app > host.exp.exponent:expoview:19.0.0 > com.google.android.gms:play-services-auth:9.8.0 
     project :app > host.exp.exponent:expoview:19.0.0 > com.google.android.gms:play-services-ads:9.8.0 
     project :app > host.exp.exponent:expoview:19.0.0 > com.google.android.gms:play-services-maps:9.8.0 
     project :app > host.exp.exponent:expoview:19.0.0 > com.google.android.gms:play-services-analytics:9.8.0 > com.google.android.gms:play-services-analytics-impl:9.8.0 
     project :app > host.exp.exponent:expoview:19.0.0 > com.google.android.gms:play-services-gcm:9.8.0 > com.google.android.gms:play-services-iid:9.8.0 
     project :app > host.exp.exponent:expoview:19.0.0 > com.google.android.gms:play-services-auth:9.8.0 > com.google.android.gms:play-services-auth-base:9.8.0 
     project :app > host.exp.exponent:expoview:19.0.0 > com.google.android.gms:play-services-ads:9.8.0 > com.google.android.gms:play-services-clearcut:9.8.0 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 

BUILD FAILED 

Total time: 52.177 secs 
Could not install the app on the device, read the error above for details. 
Make sure you have an Android emulator running or a device connected and have 
set up your Android development environment: 
https://facebook.github.io/react-native/docs/android-setup.html 

以下是的build.gradle的幾行:

compile(project(':react-native-firebase')) { 
    transitive = false 
} 
compile "com.google.firebase:firebase-core:11.2.0" 
compile "com.google.android.gms:play-services-base:11.2.0" 
compile "com.google.firebase:firebase-analytics:11.2.0" 
apply plugin: 'com.google.gms.google-services' 

回答

相關問題