2016-11-08 2 views
0

Я пытаюсь установить андроид толчок уведомление, как это: react-native-push-notificationКак установить оповещение для Android в ответ на собственный проект?

Но когда я пытаюсь построить мое приложение с react-native run-android, я получаю эту ошибку:

BUILD FAILED 

Total time: 2.666 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 


D:\react\react-WriteNow>run 
JS server already running. 
Running C:\Program Files (x86)\Android\android-sdk/platform-tools/adb -s ce051605a9626a3304 reverse tcp:8081 tcp:8081 
Building and installing the app on the device (cd android && gradlew.bat installDebug... 
please apply google-services plugin at the bottom of the build file. 
google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used. 
please apply google-services plugin at the bottom of the build file. 

FAILURE: Build failed with an exception. 

* What went wrong: 
A problem occurred configuring root project 'WriteNow'. 
> java.lang.NullPointerException (no error message) 

мои файлы: Android/приложение /build.gradle:

dependencies { 
    // compile ('com.google.android.gms:play-services-gcm:9.0.0') { 
    //  force = true; 
    // } 

    compile fileTree(dir: "libs", include: ["*.jar"]) 
    compile "com.android.support:appcompat-v7:23.0.1" 
    compile "com.facebook.react:react-native:+" // From node_modules 
     compile "com.facebook.android:facebook-android-sdk:4.8.+" 
    compile "com.android.support:support-v13:23+" 
    compile ('com.google.android.gms:play-services-gcm:8.4.0') { 
     force = true; 
    } 
    compile project(':react-native-push-notification') 
    compile project(':react-native-sqlite-storage') 
    compile project(':react-native-image-picker') 
    compile project(':react-native-vector-icons') 
    compile project(':react-native-contacts') 


} 
apply plugin: "com.google.gms.google-services" 

андроида/settings.gradle

buildscript { 
    repositories { 
     mavenCentral() 
     jcenter() 

    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.2' 
     classpath 'com.google.gms:google-services:3.0.0' 
    } 
} 

allprojects { 
    repositories { 
     mavenLocal() 
     jcenter() 
     maven { 
      url "$rootDir/../node_modules/react-native/android" 
     } 
    } 
} 
apply plugin: "com.google.gms.google-services" 

enter image description here

Любая идея, почему она не работает?

ответ

0

Эта команда решить проблему:

android update sdk -u -a -t

Смежные вопросы