将@EActivity注释添加到班级后,我无法运行我的项目。
这是我的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模块:app
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注释后,我注意到我的AndroidMannifest并没有自动修改(在活动中缺少_),当我手动添加时,它会以红色突出显示。
如果我正常运行项目(无需修改AndroidMannifest或将类更改为Annotations),它将正常运行。
如果添加注释并修改清单,我将收到错误消息:
错误:使用生成文件夹[C:\\ Users \\ Asusc \\ AndroidStudioProjects \\ Tasks \\ app \\ build \\ Generated \\ source \\ apt \\ debug]找不到AndroidManifest.xml文件)
知道我可能做错了什么吗?