Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

Android Run Config does not see MAIN action in intent-filter

$
0
0

I am working on an Android application rewrite where we had to use an activity-alias to maintain the original codename. The problem is that when me added the activity alias it caused the IntelliJ run configuration to complain with an error, saying "The intent-filter of the activity must contain android.intent.action.MAIN action". The error is harmless, though annoying, in that run configuration will work on my device or emulator irregardless but I am constantly prompted wether I wish to continue anyway when launching. Here's an example of a manifest from an example project that illustrates the problem:

 

 

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"          package="com.craig.example.Drawing"          android:versionCode="1"          android:versionName="1.0">    <uses-sdk android:minSdkVersion="10"/>    <application        android:label="@string/app_name"        android:icon="@drawable/ic_launcher">        <activity            android:name=".MainActivity"            android:exported="true"            android:label="@string/app_name">        </activity>        <activity-alias                       android:name="com.craig.example.Main"                       android:targetActivity=".MainActivity">                    <intent-filter>                        <action android:name="android.intent.action.MAIN" />                        <category android:name="android.intent.category.LAUNCHER" />                    </intent-filter>                  </activity-alias>    </application></manifest>

 

In this manifest I alias the ".MainActivity" with a name "com.craig.example.Main". See the attached screenshot which illustrates the run configuration and the error I see.screenshot.tiff

 

Is there a work-around or a way I can mitigate the constant prompting for error correction when launching my app?


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>