generateJava无法读取Java目录中的包

时间:2019-05-12 22:14:15

标签: android android-studio

我正在使用android studio 3.3.2和gradle 4.10.1

generateJava中的某些类无法读取包(包Util不存在)

此Util软件包位于项目源代码中

以下是gradle构建

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.pub.lala"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "0.0.5"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["resourcePackageName": android.defaultConfig.applicationId]
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField 'String', 'base_url', '"http://api.dumdum.do"'
        }
        debug {
            buildConfigField 'String', 'base_url', '"http://api.dumdum.do"'
        }
    }
    dataBinding {
        enabled = true
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.jakewharton:butterknife:8.5.1'
    implementation 'com.android.volley:volley:1.1.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.auth0.android:jwtdecode:1.3.0'
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'

我不知道为什么这些生成的Java文件无法读取项目源代码中的包

0 个答案:

没有答案