在Android Annotations之后使用生成文件夹找不到AndroidManifest.xml文件

问题描述 投票:0回答:1

将@EActivity Annotation添加到我的类后,我无法运行我的项目。

这是我的Gradle项目:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

这是我的Gradle模块:应用程序

apply plugin: 'com.android.application'
def AAVersion = '4.2.0'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.tasks"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    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.android.support:support-annotations:28.0.0'

    annotationProcessor "org.androidannotations:androidannotations:$AAVersion"
    implementation "org.androidannotations:androidannotations-api:$AAVersion"
}

在我的Gradle中添加Android Annotations之后,我注意到我的AndroidMannifest没有自动修改(在活动中缺少_),当我手动添加它时,它会以红色突出显示。

如果我正常运行项目(不修改AndroidMannifest或将类更改为Annotations)它将正常运行。

如果我添加注释并修改Manifest,我将收到错误:

错误:使用生成文件夹[C:\ Users \ Asusc \ AndroidStudioProjects \ Tasks \ app \ build \ generated \ source \ apt \ debug]找不到AndroidManifest.xml文件

知道我可能做错了什么吗?

android android-gradle android-annotations
1个回答
4
投票

您应该更新到AndroidAnnotations 4.6.0。这个版本有Android Gradle Plugin 3.3。+支持。

© www.soinside.com 2019 - 2024. All rights reserved.