I was building a simple application using Kotlin, which has three activities (Main, Menu, and Game). I added some fragments (and all their related files suggested by Android Studio). Then I realized that fragment is not a good choice so I manually deleted the fragment files (maybe I couldn't delete them all). Later when I built the project, the compiler generated two binding files (ActivityMainBinding and ActivityMainBinding 2) for Menu and Game, which caused duplication.
How do I fix this? Are there any file or configuration that I need to change?
AndroidManifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" >
<application
android:allowBackup="true"
android:dataExtractionRules="#xml/data_extraction_rules"
android:fullBackupContent="#xml/backup_rules"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.xxx"
tools:targetApi="31" >
<activity
android:name=".GameActivity"
android:exported="false" >
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".MenuActivity"
android:exported="false" >
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".MainActivity"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
</application>
</manifest>
Related
I have developed an app everything was working ok but when I sent to Google Play Store and I tried to install the app from store, the icon doesn't show in the screen. Now when I run it from emulator the icon doesn't show again.
This is the manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
<application
android:allowBackup="true"
android:dataExtractionRules="#xml/data_extraction_rules"
android:fullBackupContent="#xml/backup_rules"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.myAppName"
tools:targetApi="31">
<activity
android:theme="#style/Theme.AppCompat.NoActionBar"
android:name=".luces"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:theme="#style/Theme.AppCompat.NoActionBar"
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
</application>
I tried to reupload the icon using File > New Image Asset but it didn't worked
This is my android.manifest file. I searched a lot of things here but my problem is not solved yet. What can I do?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.e_healthcareapp" >
<application
android:allowBackup="true"
android:dataExtractionRules="#xml/data_extraction_rules"
android:fullBackupContent="#xml/backup_rules"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.EHealthcareApp"
tools:targetApi="31" >
<activity
android:name=".MainActivity"
android:exported="false"
android:label="#string/title_activity_register_option" />
<activity
android:name=".Login_options"
android:exported="false"
android:parentActivityName=".MainActivity" />
<activity
android:name=".Registration"
android:exported="false"
android:label="Registration Form"
android:parentActivityName=".Registration" />
<activity
android:name=".MainActivity2"
android:exported="false"
android:label="Log in Form"
android:parentActivityName=".MainActivity2" /> <!-- back button values -->
<activity
android:name=".MainActivity"
android:exported="true"
tools:ignore="DuplicateActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
this is my build.gradle(module:appname)
In your Manifest, you can choose between Text and Merged Manifest (in Android Studio below your Manifest).
Click on Merged Manifest and there is a detailed description of your error.
I can't open the app on my phone because it says it doesn't have a launch activity so I can open it.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.frases.coquinha">
<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/Theme.Coquinha">
<activity
android:name=".MainActivity"
android:exported="false" />
<activity
android:name=".tela2"
android:exported="false" />
<meta-data
android:name="preloaded_fonts"
android:resource="#array/preloaded_fonts" />
</application>
</manifest>
You do not have a suitable <intent-filter> for that on either of your <activity> elements.
You need this <intent-filter> in whichever of your <activity> elements represents your launcher activity:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
And, you would need to switch to android:exported="true" for that <activity> element.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.loginpage">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:testOnly="true"
android:theme="#style/Theme.LoginPage" >
<activity
android:name=".MainActivity"
android:exported="true" >
<intent-filter android:exported="true">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Entry"
android:exported="true" >
</activity>
<activity
android:name=".HousePref"
android:exported="true" />
<activity
android:name=".Profile"
android:exported="true" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
changed position of intent filter to change my first page.
Got debug Manifest xml errors. I put the intent filter back to original place. since then getting these errors.
You meta-data tag seems correct.
Check you are using the latest Google Play services version in your build.gradle.
Try also Build > Clean Project and Build > Rebuild Project.
What have I looked over in the code that is causing this error. Don't see anything wrong with it. What's the issue?
There is also an R cannot be resolved t a variable error in each java file in the project. Does that have anything to do with this?
Here's the manifest file.
<<<<<<< Original
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.activity2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.FLAG_ACTIVITY_NEW_TASK" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.authorwjf.youtubeapi.MainActivity"
android:label="#string/title_activity_activity2" >
</activity>
<activity android:name= ".Search" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="#xml/searchable"/>
</activity>
<activity android:name=".OtherActivity" >
<!-- enable the search dialog to send searches to SearchableActivity -->
<meta-data android:name="android.app.default_searchable"
android:value=".SearchableActivity" />
</activity>
</application>
</manifest>
=======
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
<application>
<activity android:name="com.example.activity2.OtherActivity"
android:label="#string/title_activity_other"
>
</activity>
</application>
</manifest>
>>>>>>> Added
Your first line is <<<<<<< Original
And you have a section at the end preceeded by ======= - it appears you had a merge conflict that was not resolved. Remove those lines and merge the two <manifest> elements together so get a single, correct manifest.