Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

kotlin

I wanted to give Kotlin a shot. I converted my java classes to Kotlin and corrected some errors. If I try to build, the following error comes up:

Error:Execution failed for task ':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!

like image 984
M. Doe Avatar asked May 20 '17 14:05

M. Doe


People also ask

How do I fix error manifest merger failed?

The initial process would be to open the manifest application known as the AndroidManifest. xml and then click on the Merged Manifest tab below your edit pane. Following which, Click on the merged manifest option. An Error would be visible at the right column and then one must try to solve the error.

How do I find merged manifests on Android?

Inspect the merged manifest and find conflicts Even before you build your app, you can see a preview of what your merged manifest looks by opening your AndroidManifest. xml file in Android Studio, and then clicking the Merged Manifest tab at the bottom of the editor.

How do I merge manifest files on Android?

Your APK file can contain just one AndroidManifest. xml file, but your Android Studio project may contain several—provided by the main source set, build variants, and imported libraries. So when building your app, the Gradle build merges all manifest files into a single manifest file that's packaged into your APK.


1 Answers

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. I’ve found that selecting Build -> Clean Project solves the problem for me.

like image 84
Joey deVilla Avatar answered Sep 24 '22 10:09

Joey deVilla