[英]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.