मैंने आज डैगर 2 के साथ एक मौजूदा प्रोजेक्ट में कोटलिन प्लगइन स्थापित किया है। कोटलिन स्थापित होने से पहले मुझे डैगर के साथ कोई समस्या नहीं थी। हालांकि, अब संकलक शिकायत:एंड्रॉइड कोटलिन: त्रुटि अनसुलझा संदर्भ: DaggerAppComponent
Error:(5, 32) Unresolved reference: DaggerAppComponent
Error:Execution failed for task ':app:compileDebugKotlinAfterJava'.
> Compilation error. See log for more details
Error:(12, 21) Unresolved reference: DaggerAppComponent
परियोजना Gradle:
ext.kotlin_version = '1.1.1'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
मॉड्यूल Gradle:
kapt {
generateStubs = true
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
testCompile 'junit:junit:4.12'
compile 'com.google.dagger:dagger:2.7'
kapt 'com.google.dagger:dagger-compiler:2.7'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
DaggerAppComponent फ़ाइल ऑटो उत्पन्न होता है, तो मैं क्यों के रूप में उलझन में हूँ एक हल संकल्प संदर्भ त्रुटि फेंक दिया गया है।
आप समस्या हल करते हैं? गलती क्या थी? –
ओपन 'ग्रैडल कंसोल' खोलें और अधिक लॉग दिखाने के लिए 'स्टैकट्रैस के साथ चलाएं' पर क्लिक करें (त्रुटि के बारे में अधिक जानकारी) – Sally