简体   繁体   English

关于android的Kotlin:找不到主要的合并清单。 导致此错误的原因是什么?

[英]Kotlin on android: Cannot find main merged manifest. What is causing this error?

I wanted to give Kotlin a shot. 我想给Kotlin一个机会。 I converted my java classes to Kotlin and corrected some errors. 我将我的java类转换为Kotlin并纠正了一些错误。 If I try to build, the following error comes up: 如果我尝试构建,则会出现以下错误:

Error:Execution failed for task ':app:generateDebugInstantRunAppInfo'. 错误:任务':app:generateDebugInstantRunAppInfo'的执行失败。 Cannot find main merged manifest. 找不到主合并清单。

This is the manifest file: 这是清单文件:

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

    <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">
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar"
            android:windowSoftInputMode="adjustPan">

        </activity>
        <activity android:name=".Setup_Activity"
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

Thanks for your help! 谢谢你的帮助!

I've been experimenting with Kotlin development in the just-released Android Studio 3.0 Canary 1 and get the “Cannot find merged manifest” error every now and again. 我一直在刚刚发布的Android Studio 3.0 Canary 1中尝试Kotlin开发,并且一次又一次地获得“找不到合并清单”错误。 I've found that selecting Build -> Clean Project solves the problem for me. 我发现选择Build - > Clean Project可以解决我的问题。

Clean Project适用于Android Studio 3.0 canary版本

在我的情况下,我正在使用Android studio 3.0 Canary 2,首先我尝试Build - > Clean Project仍然没有为我解决问题,然后我关闭项目并再次打开它,Alhamdulillah它解决了这个问题

I tried both cleaning the project and close-opening it, but they don't work in my case. 我尝试了清理项目并关闭它,但它们在我的情况下不起作用。 After editing the manifest (not a functional change) now project runs. 编辑清单(不是功能更改)后,现在项目运行。

Because Build -> Clean Project , restarting Android Studio or reinstalling app may not work, the simplest solution was to change AndroidManifest.xml, eg add or delete white space. 由于Build - > Clean Project ,重启Android Studio或重新安装应用程序可能无法正常工作,最简单的解决方案是更改AndroidManifest.xml,例如添加或删除空白区域。

Here is reported issue: https://issuetracker.google.com/issues/62336754 . 报告的问题如下: https//issuetracker.google.com/issues/62336754

As mentioned there, it will be fixed in Android Gradle Plugin 3.0.0-alpha5 . 如前所述,它将在Android Gradle Plugin 3.0.0-alpha5修复。

您可以通过卸载当前正在使用的应用并在Android Studio上再次运行来解决此问题。

Tried the given solutions but wasn't successful. 尝试了给定的解决方案,但没有成功。 So for the mean time until this bug gets fixed I am going for the commandline 因此,对于这个错误得到修复的平均时间,我将使用命令行

./gradlew clean install<your_build_variant>

Example: 例:

./gradlew clean installDevDebug

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android合并了清单错误 - Android merged manifest error Android:解析清单时解析错误。停止安装 - Android: Parse error when parsing manifest. Discontinuing installation 错误:无法执行应用程序和处理清单。 - Error: Failed to execute app and processing manifest. 错误:“清单中未找到版本代码。” - Error: "Version code not found in manifest." Android 未编译,因为清单“错误:找不到符号类清单” - Android not compiling because manifest 'error: cannot find symbol class Manifest' Android Studio增量混淆导致错误:找不到符号类 - Android Studio incremental obfuscation causing error: cannot find symbol class android studio“错误:找不到或加载主类”在Kotlin文件的主要方法中 - android studio “error: can't find or load main class” in Kotlin file's main method Android Room库错误:无法找到字段的setter。 (科特林) - Android Room library error: Cannot find setter for field. (Kotlin) Google Play 说由于清单问题,我的应用与平板电脑的某些运营商型号不兼容。 什么? - Google Play says my app is incompatible with some carrier models of a tablet due to manifest. What? 我开始找不到清单中列出的主要活动 - am start cannot find main activity listed in manifest
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM