【问题标题】:Android dagger 2 not generating in android studio 4.1Android dagger 2 未在 android studio 4.1 中生成
【发布时间】:2020-10-29 12:18:59
【问题描述】:

粗体:这是我尝试使用 android 模拟器构建项目时的 Gradle 配置,而不是捕获对我来说非常烦人的错误处理器我也这样做,但问题仍然没有解决。我正在使用 android studio 4.1 试图找出注释处理器选项,但运气不好,所以请帮助解决这个问题,感谢很多开源社区。​​p>

click here for image

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'


android {

    compileSdkVersion 28
    defaultConfig {
        applicationId "org.rtspplr.app"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 106
        // Previous version svn+ssh://svn@52.0.53.255/RTSP/projects/android/MediaPlayer
        // last version which published on PlayMarket 4.4.3
        versionName "4.4.49"
        setProperty("archivesBaseName", "VXG_RTSPPlayer_$versionName-vc$versionCode")

        ndk {
            abiFilters 'x86', 'x86_64' , 'armeabi-v7a', 'arm64-v8a'
        }
        
    }

    signingConfigs {
        debug {
            storeFile file("../../signing_key/Debug/debug.keystore.jks") // need for develop google map
            keyAlias 'alias_name'
            keyPassword 'remember.me.again'
            storePassword 'remember.me'
        }
        release {
            storeFile project.file("../../signing_key/RTSPPlayer/sign/rtspplayer-release-key.keystore")
            storePassword 'remember.me'
            keyAlias 'alias_name'
            keyPassword 'remember.me.again'
            v1SigningEnabled true
            v2SigningEnabled true
        }
    }

    buildTypes {
        debug {
            buildConfigField "boolean", "IS_DEBUG", "true" // Had issues with BuildConfig.DEBUG, created IS_DEBUG to ensure functionality behaved as expected.
            minifyEnabled false
            multiDexEnabled true
            debuggable true
        }

        release {
            buildConfigField "boolean", "IS_DEBUG", "false"
            minifyEnabled false
            multiDexEnabled true
            debuggable false
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

/*  
    splits {
        abi {
            enable true
            reset()
            include 'armeabi-v7a'
            universalApk false
        }
    }
*/


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'com.google.android.gms:play-services-ads:17.0.0'
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha03'
    implementation 'com.google.android.material:material:1.1.0-alpha04'
    implementation 'com.jakewharton:butterknife:10.0.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
    implementation 'androidx.annotation:annotation:1.1.0-alpha02'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'

    androidTestImplementation 'androidx.test:runner:1.1.2-alpha02'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0-alpha02'
    implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha03'
    implementation project(':data')
    implementation project(':logic')
    implementation project(':add_cloud_camera')
    implementation project(':textinputs')
    implementation 'com.google.dagger:dagger:2.28'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.28'
    implementation 'com.vxg.cloudsdk:cloudsdk:2.0.202'

    implementation 'com.github.bumptech.glide:glide:4.11.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    //implementation project(':CloudSDK')
    //implementation 'io.vxg.media:components:2.0.112-alpha01'


    //implementation 'androidx.cardview:cardview:1.0.0'

    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation "io.reactivex.rxjava2:rxjava:2.1.9"
    implementation 'com.google.code.gson:gson:2.8.5'

    implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'com.google.android.gms:play-services-location:17.0.0'
    implementation 'com.google.maps.android:android-maps-utils:0.4.4'
    //implementation 'commons-validator:commons-validator:1.6'
    implementation 'com.google.firebase:firebase-core:17.4.2'
    implementation 'com.google.firebase:firebase-messaging:20.2.0'
    implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

}
repositories {
    mavenCentral()
}

【问题讨论】:

  • 你应该使用kapt(Kotlin注解处理器)而不是annotationProcessor
  • 我已经用过kapt还是同样的错误。
  • 有解决办法吗?

标签: android android-studio dagger-2


【解决方案1】:

文件 -> 项目结构 -> SDK 位置 -> JDK 位置 -> 选择本地 jdk 而不是位于 android studio 中的 jre。

【讨论】:

    猜你喜欢
    • 2015-06-24
    • 1970-01-01
    • 2017-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-29
    • 1970-01-01
    • 2023-04-09
    相关资源
    最近更新 更多