构建提供FileUsesReservedNameException

时间:2019-06-10 09:51:13

标签: android build android-bundle

失败:生成失败,发生异常。 * 什么地方出了错: 任务':app:packageDebugBundle'的执行失败。

  

工人提出了1个例外:     com.android.tools.build.bundletool.exceptions.BundleFileTypesException $ FileUsesReservedNameException:文件'root / AndroidManifest.xml'使用保留文件或目录名称'AndroidManifest.xml'。

我已经尝试了StackOverflow herehere上给出的所有答案,但是没有用。 我可以使用给定的配置创建APK文件。

  

sinch-android-rtc-3.13.0.aar已添加到app-> libs包下。

也尝试过

  1. 清理并构建项目
  2. 在AndroidManifest.xml文件中的应用程序标记下添加android:fullBackupContent="false"
  3. 将构建库更改为implementation 'com.facebook.android:facebook-login:5.0.1'

build.gradle

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.xyz.yz"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    repositories {
        maven { url "https://jitpack.io" }
        jcenter()
        flatDir {
            dirs 'libs'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
//    implementation(name: 'sinch-android-rtc', version: '+', ext: 'aar')
    implementation files('libs/sinch-android-rtc-3.13.0.aar')

    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'com.squareup.okhttp3:okhttp:3.12.0'
    implementation 'com.wang.avi:library:2.1.3'
    implementation 'com.facebook.android:facebook-login:[5,6)'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation "com.google.android.gms:play-services-location:16.0.0"
    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation 'com.google.firebase:firebase-messaging:18.0.0'
    implementation 'com.github.krokyze:ucropnedit:2.2.3'
    implementation 'androidx.exifinterface:exifinterface:1.0.0'
    implementation 'com.fxn769:pix:1.4.4'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.google.android:flexbox:1.0.0'
    implementation 'com.stripe:stripe-android:8.7.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}

apply plugin: 'com.google.gms.google-services'

AndroidManifest.xml

<?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.xyz.xyz">

    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <!--<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />-->
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:resizeable="true"
        android:smallScreens="true"
        android:xlargeScreens="true" />

    <!--
    TODO: largeheap removed
      android:largeHeap="true"
    -->
    <application
        android:name=".xyz"
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="false"
        android:fullBackupContent="false"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true"
        tools:replace="android:supportsRtl">

        <service
            android:name=".call.SinchService"
            android:exported="false" />

        <uses-library
            android:name="org.apache.http.legacy"
            android:required="false" />

        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />

        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths" />
        </provider>

        <!-- Set custom default icon. This is used when no icon is set for incoming notification messages. -->
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/logo_white" />
        <!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
             notification message. -->
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_color"
            android:resource="@color/buttonColor" />

        <meta-data
            android:name="com.google.firebase.messaging.default_notification_channel_id"
            android:value="@string/default_notification_channel_id" />

        <service android:name=".fcm.MyFirebaseMessagingService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <service
            android:name=".helpers.ForegroundService"
            android:enabled="true"
            android:exported="false" />

        <activity
            android:name=".Splash"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".classes.WebLink"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
        <activity
            android:name=".classes.LoginActivity"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />

        <activity
            android:name=".classes.TabBarActivity"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />

        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name" />
        <activity
            android:name="com.facebook.CustomTabActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="@string/fb_login_protocol_scheme" />
            </intent-filter>
        </activity>
        <activity
            android:name=".classes.SignupActivity"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
        <activity
            android:name=".classes.ForgotPassword"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
        <activity
            android:name=".classes.PasswordMessageSuccess"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
        <activity
            android:name=".classes.ResetPassword"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />

        <activity
            android:name=".call.AudioCallActivity"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />

        <activity
            android:name=".call.AudioCallIncomingActivity"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />

        <activity
            android:name=".call.VideoCallActivity"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />

        <activity
            android:name=".call.VideoCallIncoming"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />

        <activity
            android:name=".call.VideoCallRecieved"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />

        <activity
            android:name=".classes.TransferInitiated"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />

        <activity
            android:name="com.yalantis.ucrop.UCropActivity"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
    </application>

</manifest>

1 个答案:

答案 0 :(得分:0)

我比较了我们共有的依赖关系-我们这边的罪魁祸首是sinch-android-rtc。 它与{3.13}兼容update与应用程序包兼容。 现在,可以在我们的项目和应用程序捆绑包中更新该库,而不会出现问题。

可以找到最新的lib aar here