Android“mainMergedManifest"不存在 [英] Android "mainMergedManifest" does not exist

查看:62
本文介绍了Android“mainMergedManifest"不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了以下错误代码的构建问题:

发现任务':app:processDebugManifest'(类型'ProcessMultiApkApplicationManifest')的配置有问题.

<块引用>

为属性mainMergedManifest"指定的文件E:\DK\app\build\intermediates\merged_manifest\debug\out\AndroidManifest.xml"不存在.

build.gradle

应用插件:'com.android.application'安卓 {compileSdkVersion 29buildToolsVersion "29.0.2";默认配置{applicationIdcom.example.sample"minSdk 版本 21目标SDK版本29版本代码 1版本名称1.0"testInstrumentationRunnerandroidx.test.runner.AndroidJUnitRunner"}构建类型{释放 {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'}}编译选项{sourceCompatibility JavaVersion.VERSION_1_8targetCompatibility JavaVersion.VERSION_1_8}}依赖{//为 Firebase 平台导入 BoM实现平台('com.google.firebase:firebase-bom:26.1.0')//声明 Firebase 身份验证库的依赖项//使用 BoM 时,不要在 Firebase 库依赖项中指定版本实现 'com.google.firebase:firebase-auth'实现 'com.google.android.material:material:1.2.1'实现文件树(目录:'libs',包括:['*.jar'])实现 'androidx.appcompat:appcompat:1.2.0'实现 'androidx.constraintlayout:constraintlayout:2.0.4'实现 'com.google.firebase:firebase-auth:16.0.5'testImplementation 'junit:junit:4.12'androidTestImplementation 'androidx.test.ext:junit:1.1.2'androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'实现 'com.google.firebase:firebase-database:19.5.1'实现 'com.google.firebase:firebase-storage:19.2.0'实现 'com.github.bumptech.glide:glide:4.11.0'实施 'com.google.gms:google-services:4.3.4'实现 'androidx.browser:browser:1.2.0'}应用插件:'com.google.gms.google-services'

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android";package=com.example.sample"><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";/><申请android:allowBackup="true";android:icon="@drawable/logo";android:label="@string/app_name";android:roundIcon="@mipmap/ic_launcher_round";android:supportsRtl="true";android:theme="@style/AppTheme"><活动android:name=".Activities.SplashActivity";android:theme="@style/AppTheme.Launcher";android:windowSoftInputMode="adjustPan";android:screenOrientation="肖像"android:configChanges="orientation"><意图过滤器><action android:name="android.intent.action.MAIN";/><action android:name="android.intent.action.VIEW";/><category android:name="android.intent.category.LAUNCHER";/></意图过滤器></活动><activity android:name=".Activities.LoginActivity";android:screenOrientation="肖像"android:configChanges="orientation"/><activity android:name=".Activities.MainActivity";android:windowSoftInputMode="adjustPan";android:screenOrientation="肖像"android:configChanges="orientation"/><activity android:name=".Activities.SignUpActivity";android:screenOrientation="肖像"android:configChanges="orientation"/><activity android:name=".Activities.DebugActivity";android:screenOrientation="肖像"android:configChanges="orientation"/></应用程序>

我是新手,我似乎无法弄清楚可能是什么问题.我们正在共同开发一个应用程序,似乎没有人知道这个问题.我们是初学者,几乎没有经验.

解决方案

在你的 build.gradle 中,你有以下两行:

compileSdkVersion 29

targetSdkVersion 29

如果未安装该 sdk 版本或与虚拟设备上的 API 版本不匹配(假设您使用的是模拟器),则会出现您显示的错误.

有两件事需要检查:

工具->SDK 管理器中,检查安装的 SDK 版本.您的项目正在为 SDK 版本 29 编译,因此如果您没有安装 29 并且想要使用它,请安装它.或者,如果您安装了 30 版,只需将 build.gradle 中的这两行从29"更改为到30".

工具->AVD 管理器中,检查您的虚拟设备的 API 级别.匹配吗?如果没有,请创建一个匹配的新设备,或者只是简单地安装匹配的 API 或如上所述更改 2 行代码.

另外,对于这一行:

minSdkVersion 21

确保也安装了 SDK 版本 21.

I am having a build issue with the following error code:

A problem was found with the configuration of task ':app:processDebugManifest' (type 'ProcessMultiApkApplicationManifest').

File 'E:\DK\app\build\intermediates\merged_manifest\debug\out\AndroidManifest.xml' specified for property 'mainMergedManifest' does not exist.

build.gradle

apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
    applicationId "com.example.sample"
    minSdkVersion 21
    targetSdkVersion 29
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:26.1.0')

// Declare the dependency for the Firebase Authentication library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-auth'

implementation 'com.google.android.material:material:1.2.1'

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.firebase:firebase-auth:16.0.5'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.firebase:firebase-database:19.5.1'
implementation 'com.google.firebase:firebase-storage:19.2.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.google.gms:google-services:4.3.4'
    implementation 'androidx.browser:browser:1.2.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"
package="com.example.sample">
<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" />

<application
    android:allowBackup="true"
    android:icon="@drawable/logo"
    android:label="@string/app_name"

    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".Activities.SplashActivity"
        android:theme="@style/AppTheme.Launcher"
        android:windowSoftInputMode="adjustPan"
        android:screenOrientation="portrait"
        android:configChanges="orientation">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".Activities.LoginActivity"
        android:screenOrientation="portrait"
        android:configChanges="orientation"/>
    <activity android:name=".Activities.MainActivity"
        android:windowSoftInputMode="adjustPan"
        android:screenOrientation="portrait"
        android:configChanges="orientation"/>
    <activity android:name=".Activities.SignUpActivity"
        android:screenOrientation="portrait"
        android:configChanges="orientation"/>
    <activity android:name=".Activities.DebugActivity"
        android:screenOrientation="portrait"
        android:configChanges="orientation"/>
</application>

I am new to this and I can't seem to figure out what the issue may be. We are working on an application together and noone seems to know the issue. We are beginners, with little to no experience.

解决方案

In your build.gradle, you have these 2 lines:

compileSdkVersion 29

and

targetSdkVersion 29

The error you have shown occurs when that sdk version is not installed or does not match that of the API version on the virtual device (assuming you are using the emulator).

There are 2 things to check:

In Tools->SDK Manager, check what SDK version is installed. Your project is compiling for SDK version 29, so if you don't have 29 installed and want to use that, install it. Or if you have version 30 installed, simply change those 2 lines in your build.gradle from "29" to "30".

In Tools->AVD Manager, check the API level of your virtual device. Does it match? If not, create a new device that matches, or just simply install the matching API or change the 2 lines of code as described above.

Also, for this line:

minSdkVersion 21

Make sure SDK version 21 is installed too.

这篇关于Android“mainMergedManifest"不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆