sohanoor
sohanoor

Reputation: 129

File 'root/AndroidManifest.xml' uses reserved file or directory name 'AndroidManifest.xml'

My android studio version is 3.4.0. Gradle version is 3.4.0. I try to clean project, re-install Android Studio, modified Project Setting Build option. So far no luck. Actually, I have no idea what is my actual error. Just getting this error message in build log.

Update

Here is my error log, after applying all of your suggestions
[1]: https://i.sstatic.net/D8Esc.png

While building my android app, I am getting this error.

File 'root/AndroidManifest.xml' uses reserved file or directory name 'AndroidManifest.xml'.

Here is my build.gradle file


   android {
       compileSdkVersion 28
       buildToolsVersion "28.0.3"
       defaultConfig {
           applicationId "------------"
           minSdkVersion 21
           targetSdkVersion 28
           versionCode 15
           versionName "2.4.1"
           testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
           multiDexEnabled true
       }
       buildTypes {
           release {
               minifyEnabled false
               multiDexKeepFile file('multidex-config.txt')
               proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
               multiDexEnabled = true
               manifestPlaceholders = [googleMapsKey: 'AIza------2k']
           }
           debug {
               minifyEnabled false
               multiDexKeepFile file('multidex-config.txt')
               proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
           }
       }
       testOptions {
           unitTests.returnDefaultValues = true
       }

       compileOptions {
           sourceCompatibility JavaVersion.VERSION_1_8
           targetCompatibility JavaVersion.VERSION_1_8
       }

       lintOptions {
           checkReleaseBuilds false
           abortOnError false
       }

       packagingOptions {
           exclude 'AndroidManifest.xml'
       }
   }

   repositories {
       mavenCentral()
   }

   dependencies {
       implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
       implementation 'com.android.support:appcompat-v7:28.0.0'
       implementation 'com.android.support:recyclerview-v7:28.0.0'
       implementation 'com.android.support:support-vector-drawable:28.0.0'
       implementation 'com.android.support:design: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'
       androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'

       implementation 'com.android.volley:volley:1.1.1'
       implementation 'com.squareup.picasso:picasso:2.5.2'
       implementation 'com.github.bumptech.glide:glide:4.5.0'
       implementation 'com.github.tommykw:TagView:0.0.1'
       implementation 'com.airbnb.android:lottie:2.5.1'
       annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'
       implementation 'com.google.android.gms:play-services-maps:16.0.0'
       implementation 'com.google.android.gms:play-services-auth:16.0.0'
       implementation 'com.github.ornolfr:rating-view:0.1.2@aar'
       implementation 'com.appyvet:materialrangebar:1.4.4'
       //calendar
       implementation 'com.wdullaer:materialdatetimepicker:3.6.3'

       implementation 'com.facebook.android:facebook-login:5.0.1'

       implementation project(':YouTubeAndroidPlayerApi')

       //multiple image selection
       implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'

       //make initials icon (SR)
       implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
       implementation 'org.apache.directory.studio:org.apache.commons.codec:1.8'

       implementation 'com.twitter.sdk.android:twitter-core:3.3.0'
       implementation 'com.twitter.sdk.android:tweet-ui:3.3.0'

   }

Upvotes: 1

Views: 2548

Answers (3)

Liu Tao
Liu Tao

Reputation: 2193

The version 5.0 of facebook library audience-network-sdk has the issue. If you download the aar file from maven respository, then drag it into Android Studio and expand the classes.jar, you would find there is a AndroidManifest.xml inside the classes.jar. That's the cause.

Upvotes: 0

Itamar Kerbel
Itamar Kerbel

Reputation: 2568

The problem might be because of the facebook library. Try updating it. I think the latest one is:

implementation 'com.facebook.android:facebook-login:[5,6)'

Upvotes: 1

Manohar
Manohar

Reputation: 23404

This error will happen if AndroidManifest.xml file is at wrong path . Check the path of you manifest file , it should be inside main folder.

If this is caused by library you can fix it by adding this inside android block of build.gradle

packagingOptions {
  exclude 'AndroidManifest.xml'
  }

Upvotes: 0

Related Questions