मैं 4 मॉड्यूल के साथ परियोजना:गूगल सेवाओं प्लगइन com.google.android.gms या com.google.firebase के लिए किसी भी संस्करण का पता नहीं लगा सकता है - अजीब व्यवहार
- एप्लिकेशन (मुख्य)
- आम -lib
- सी
- डी
मैं सही ढंग से के रूप में स्थापित किया है firebase यहाँ कहा गया है: https://firebase.google.com/docs/android/setup
मेरी एप्लिकेशन मॉड्यूल में मैं किसी भी अतिरिक्त पुस्तकालयों, केवल मॉड्यूल निर्भरता का उपयोग नहीं करते:
dependencies {
debugCompile project(path: ':common-lib', configuration: 'debug')
releaseCompile project(path: ':common-lib', configuration: 'release')
}
मेरी आम-लिब मॉड्यूल मैं उपयोग firebase पुस्तकालयों में:
dependencies {
(...)
compile 'com.google.firebase:firebase-core:11.2.0'
compile 'com.google.firebase:firebase-crash:11.2.0'
compile 'com.google.firebase:firebase-messaging:11.2.0'
compile 'com.google.firebase:firebase-config:11.2.0'
compile 'com.google.firebase:firebase-ads:11.2.0'
}
में यह स्थिति प्रोजेक्ट संकलित करता है लेकिन मुझे संदेश मिला:
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.
दिलचस्प है जब मैं अपने ऐप मॉड्यूल में आम-lib firebase निर्भरताओं की प्रतिलिपि बनाता हूं तो संदेश गायब हो जाता है।
क्या यह एक बग है? क्या मैंने कुछ गलत किया? क्या मेरी एप्लिकेशन आउटपुट फ़ाइल में फायरबेस पुस्तकालयों का उचित 11.2.0 संस्करण है या संदेश 9.0.0 कहते हैं?
संपादित
परियोजना build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
// Alternative URL is 'https://dl.google.com/dl/android/maven2/'
}
maven { url 'https://jitpack.io' }
}
}
एप्लिकेशन मॉड्यूल build.gradle
apply plugin: 'com.android.application'
android {
(...)
}
dependencies {
debugCompile project(path: ':common-lib', configuration: 'debug')
debugTestCompile project(path: ':common-lib', configuration: 'debugTest')
releaseCompile project(path: ':common-lib', configuration: 'release')
}
apply plugin: 'com.google.gms.google-services'
आम-लिब moudle build.gradle
apply plugin: 'com.android.library'
android {
(...)
}
dependencies {
(...)
//firebase
compile 'com.google.firebase:firebase-core:11.2.0'
compile 'com.google.firebase:firebase-crash:11.2.0'
compile 'com.google.firebase:firebase-messaging:11.2.0'
compile 'com.google.firebase:firebase-config:11.2.0'
compile 'com.google.firebase:firebase-ads:11.2.0'
}
ओह, मुझे लगता है कि आपको इसे सामान्य-lib पर रखना चाहिए। या किसी भी वास्तव में फ़ायरबेस निर्भरता –
@ cricket_007 जब मैं जोड़ रहा हूं "प्लगइन लागू करें: 'com.google.gms.google-services'" मेरे सामान्य-lib में, मुझे त्रुटि मिलती है: "अज्ञात संपत्ति नहीं मिल सका 'लाइब्रेरी वेरिएंट 'com.android.build.gradle.LibraryExtension टाइप ऑब्जेक्ट के लिए। " – AppiDevo
@AppiDevo क्या आपने ग्रेडल ऐप का उपयोग करके ग्रेडल डिप्लेेंसी पेड़ देखने की कोशिश की है: निर्भरता कमांड? –