error: Could not find the Androidmanifest.xml file, using Generation Folder after installing android Annotations

Asked

Viewed 116 times

0

I started getting this error after creating my classes with Android Annotations and running the project in emulator.

This is my gradddle Project

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

buildscript {

    repositories {
        google()
        jcenter()
        mavenCentral()
    }

    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
    }
}

repositories {
    mavenCentral()
    mavenLocal()
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

My graddle Module:app

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

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

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    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"
}

And this is my Androidmannifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.asuscomputer.surf">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="GoogleAppIndexingWarning">

        <activity android:name=".Login_">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity android:name=".Inicial_" />

        <activity android:name=".EsqueceuSenha_" />

    </application>

</manifest>

Any idea what’s going wrong? The project gives Syn normally but when it comes to build I get this error in :app:compileDebugJavawithJavac

org.gradle.api.internal.tasks.compile.Compilationfailedexception: Compilation failed; see the Compiler error output for Details

and this in Javacompiler

error: Could not find the Androidmanifest.xml file, using Generation Folder [C: Users Asusc Androidstudioprojects Surf app build generated source apt debug])

1 answer

-1

add this code to Gradle

android {
   ...
   defaultConfig {
       ...
       javaCompileOptions {
            annotationProcessorOptions {
            arguments = ["androidManifestFile": "$projectDir/src/main/AndroidManifest.xml".toString()]
            }
        }
    }
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.