में बहु स्वाद पुस्तकालय के आधार पर एकल स्वाद मॉड्यूल मैं एक बहु स्वाद app
पर काम कर रहा हूं। (Gradle नीचे फ़ाइलें)ग्रैडल
यह एक पुस्तकालय tracker
है कि एक ही जायके का पालन बुलाया का उपयोग करता internal
और external
अब मुश्किल भाग के लिए, feature
नामक एक नए मॉड्यूल आते हैं, यह एक कोई स्वाद है, लेकिन यह tracker
की जरूरत है निर्भरता के रूप में
app.gradle:
android {
buildTypes {
debug {
}
release {
}
}
flavorDimensions "target"
productFlavors {
internal {
dimension "target"
}
external {
dimension "target"
}
}
}
tracker.gradle:
android {
publishNonDefault true
buildTypes {
release {
}
debug {
}
}
flavorDimensions 'target'
productFlavors {
internal {
dimension "target"
}
external {
dimension "target"
}
}
}
feature.gradle: जब मैं करने के लिए Gradle सिंक कोशिश
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath false
}
}
}
}
}
dependencies {
implementation(
[...]
project(':tracker')
)
}
यहाँ errors
हैं:
Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve project :tracker.
Could not resolve project :tracker.
Required by:
project :feature
> Project :feature declares a dependency from configuration 'implementation' to configuration 'externalRelease' which is not declared in the descriptor for project :tracker.
Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve project :tracker.
Could not resolve project :tracker.
[...]
इस कोशिश : 'ट्रैकर', कॉन्फ़िगरेशन: 'बाहरी रिलीज') ' –
> प्रोजेक्ट: फीचर कॉन्फ़िगरेशन 'कार्यान्वयन' से कॉन्फ़िगरेशन 'बाहरी रिलीज' पर निर्भरता घोषित करता है जिसे प्रोजेक्ट के लिए वर्णक में घोषित नहीं किया गया है टी: ट्रैकर। –
इस ब्लॉग को पढ़ें https://medium.com/mindorks/implementation-vs-api-in-gradle-3-0-494c817a6fa –