2016-07-20 21 views
7

Tôi nhận được sau Lỗi khi thêm Firebse từ xa Config SDK trong Gradle nộpKhông thể giải quyết: biên dịch 'com.google.firebase: căn cứ hỏa lực-config: 9.2.1'

compile 'com.google.firebase:firebase-config:9.2.1' 

Nó sẽ hiển thị lỗi của Lỗi : (25, 13) Không thể giải quyết: com.google.firebase: căn cứ hỏa lực-config: 9.2.1 Show vào file
hiện trong hộp thoại cấu trúc dự án

Gradle file:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 24 
    buildToolsVersion "24.0.0" 

    defaultConfig { 
     applicationId "com.bazingalabs.firebaseremoteconfig" 
     minSdkVersion 15 
     targetSdkVersion 24 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:24.0.0' 
    compile 'com.google.firebase:firebase-config:9.2.1' 


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

Lỗi ảnh enter image description here

+0

Bạn đã thêm classpath 'com.google.gms: google-services: 3.0.0' vào tệp gốc build.gradle của bạn –

+0

bạn có thể gửi chính xác nơi bạn thêm dòng này không? chúng ta cần đảm bảo rằng ở đúng vị trí. –

+0

Đăng cấu trúc * gradle * của bạn. –

Trả lời

18

@RiyazAhamed Cảm ơn bạn. Giải pháp đã được cập nhật 'Google Play Services' và 'Google Repository' từ người quản lý sdk và khởi động lại Android studio.

0

Thêm dưới đây phụ thuộc của bạn:

apply plugin: 'com.google.gms.google-services' 
+0

Đã thêm vẫn hiển thị lỗi , Ngoài ra classpath 'com.google.gms: google-services: 3.0.0' được thêm vào tệp gradle cấp dự án –

+0

cố gắng cập nhật trình quản lý sdk của bạn – Dharmaraj

0

Có một lỗi trong việc này:

Thêm phần này vào tập tin gradle của bạn.

packagingOptions { 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/LICENSE-FIREBASE.txt' 
    exclude 'META-INF/notice' 
} 

Tôi đã sử dụng căn cứ hỏa lực Tin nhắn

Nó sẽ giống như

Gradle này: App

apply plugin: 'com.google.gms.google-services' //Usually they put this at the bottom (below dependencies {} 
               // but it worked for me at the top also 

android { 
    defaultConfig { ... } 
    buildTypes { .... } 

    packagingOptions { 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE-FIREBASE.txt' 
     exclude 'META-INF/notice' 
    } 
} 

dependencies { 
     compile fileTree(include: ['*.jar'], dir: 'libs') 
     testCompile 'junit:junit:4.12' 
     compile 'com.google.firebase:firebase-core:9.2.1' 
     compile 'com.firebaseui:firebase-ui:0.3.1' 
     compile 'com.google.firebase:firebase-messaging:9.2.1' 
} 

Gradle: Dự án

dependencies { 
    ... 
    classpath 'com.google.gms:google-services:3.0.0' 

} 
Các vấn đề liên quan