How to fix PARSE_FAILED_MANIFEST_MALFORMED in my android application - java

OK up until I started integrating FireBase my android app would load for debugging google services and other things. When I started integrating FireBase and AdMob I got the above mentioned error I am adding both manifests. I am using Android Studio 2.1.1 and Libgdx this is my Main manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.allen.howlers.game"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/GdxTheme" >
<activity
android:name="com.allen.howlers.game.AndroidLauncher"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="#string/app_id" />
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
</application>
</manifest>
This is my secondary manifest from BaseGameUtils:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.example.games.basegameutils"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="23" />
<application>
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" />
</application>
</manifest>

Related

Android Automotive: Could not identify launch activity: Default Activity not found

I have just created my first Android Automotive project:
when I run AndroidAutoDemo.mobile module it works fine:
Unfortunately when I switch to AndroidAutoDemo.automotive module I get:
Could not identify launch activity: Default Activity not found
Error while Launching activity
Failed to launch an application on all devices
This is the Android Manifest file in AndroidAutoDemo.automotive module (left as default):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.androidautodemo">
<uses-feature
android:name="android.hardware.type.automotive"
android:required="true" />
<application
android:allowBackup="true"
android:appCategory="audio"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.AndroidAutoDemo" />
</manifest>
This is my mobile emulator:
How can I fix?
To run automotive app you need Automotive emulator and Automotive flavor with Manifest like below. Also there is no Automotive emulator provided by Google yet but you can get other open source emulator from like Polestar https://developer.polestar.com/sdk/polestar2-sys-img.xml
and Volvo https://developer.volvocars.com/sdk/volvo-sys-img.xml
You don't have to add new activity
if want to understand you can go through example source code
https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:car/app/app-samples/helloworld/
`
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="androidx.car.app.sample.helloworld"
android:versionCode="1"
android:versionName="1.0">
<!-- Various required feature settings for an automotive app. -->
<uses-feature
android:name="android.hardware.type.automotive"
android:required="true" />
<uses-feature
android:name="android.software.car.templates_host"
android:required="true" />
<uses-feature
android:name="android.hardware.wifi"
android:required="false" />
<uses-feature
android:name="android.hardware.screen.portrait"
android:required="false" />
<uses-feature
android:name="android.hardware.screen.landscape"
android:required="false" />
<application
android:label="#string/app_name"
android:icon="#drawable/ic_launcher"
android:extractNativeLibs="false">
<meta-data
android:name="com.android.automotive"
android:resource="#xml/automotive_app_desc"
tools:ignore="MetadataTagInsideApplicationTag" />
<meta-data android:name="androidx.car.app.minCarApiLevel"
android:value="1"
tools:ignore="MetadataTagInsideApplicationTag" />
<service
android:name="androidx.car.app.sample.helloworld.common.HelloWorldService"
android:exported="true">
<intent-filter>
<action android:name="androidx.car.app.CarAppService" />
</intent-filter>
</service>
<activity
android:name="androidx.car.app.activity.CarAppActivity"
android:theme="#android:style/Theme.DeviceDefault.NoActionBar"
android:exported="true"
android:launchMode="singleTask"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="distractionOptimized" android:value="true"/>
</activity>
</application>
</manifest>
`
Each Manifest file should include information about available activities and launcher activity. Launcher activity needs to be defined with some additional Intent filters, for example:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.car">
<uses-permission android:name="android.car.permission.CAR_POWERTRAIN" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.DeviceDefault.NoActionBar">
<activity android:name="com.example.car.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

AAPT: error: unexpected element <activity> found in <manifest><application><activity>

It specifies
ERROR:C:\Users\rafaw\OneDrive\Desktop\pp_rafa\pp_rafa\remindertest\app\build\intermediates\packaged_manifests\debug\AndroidManifest.xml:27: AAPT: error: unexpected element <activity> found in <manifest><application><activity>.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.remindertest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="31" />
<application
android:allowBackup="true"
android:appComponentFactory="androidx.core.app.CoreComponentFactory"
android:debuggable="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.ReminderTest" >
<activity
android:name="com.example.remindertest.Activity2"
android:exported="false" />
<activity
android:name="com.example.remindertest.MainActivity"
android:exported="true" >
<activity android:name="com.example.remindertest.DestinationActivity" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.example.remindertest.AlarmReceiver" />
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="com.example.remindertest.androidx-startup"
android:exported="false" >
<meta-data
android:name="androidx.emoji2.text.EmojiCompatInitializer"
android:value="androidx.startup" />
<meta-data
android:name="androidx.lifecycle.ProcessLifecycleInitializer"
android:value="androidx.startup" />
</provider>
</application>
</manifest>
I can launch my app/emulator though but a few features does not work. Do you guys know what's happening? Also when I open AndroidManifest it's normal but when I launch emulator it turns red, if I exit and open again it's back to normal yellow, though there is a red underline under the destination activity problem
update this manifest file with your manifest, and rebuild.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.remindertest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="31" />
<application
android:allowBackup="true"
android:appComponentFactory="androidx.core.app.CoreComponentFactory"
android:debuggable="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.ReminderTest" >
<activity
android:name="com.example.remindertest.Activity2"
android:exported="false" />
<activity android:name="com.example.remindertest.DestinationActivity" />
<activity
android:name="com.example.remindertest.MainActivity"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.example.remindertest.AlarmReceiver" />
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="com.example.remindertest.androidx-startup"
android:exported="false" >
<meta-data
android:name="androidx.emoji2.text.EmojiCompatInitializer"
android:value="androidx.startup" />
<meta-data
android:name="androidx.lifecycle.ProcessLifecycleInitializer"
android:value="androidx.startup" />
</provider>
</application>
</manifest>

Application package installer has stopped

I have copied my Manifest XML File. I am just not able to figure out the error. The application is running on my Redmi 1S but it is not running on my Micromax Canvas A110 I have already tried all the solutions which are already there on Stackoverflow related to this.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gilpix.am"
android:versionCode="1"
android:versionName="1.0" android:installLocation="auto">
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<uses-configuration
android:reqTouchScreen="finger" android:reqKeyboardType="undefined"/>
<uses-feature
android:name="android.hardware.touchscreen" />
<uses-permission
android:name="android.permission.INTERNET" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" android:xlargeScreens="true" android:resizeable="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" android:uiOptions="splitActionBarWhenNarrow">
<!-- Splash screen -->
<activity android:name="com.gilpix.am.Splash"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.gilpix.am.Login"
android:label="#string/app_name"
>
</activity>
<activity android:name="com.gilpix.am.Logind"
android:label="#string/logind_name"
android:uiOptions="splitActionBarWhenNarrow"
>
</activity>
<activity android:name="com.gilpix.am.U_home"
android:label="#string/app_name"
android:uiOptions="splitActionBarWhenNarrow" >
</activity>
</application>
</manifest>
clean your project and if it doesn't work than close
the project and restart, create new apk and install
This error is come due to different android version of your both android phones.
Please check the configuration for both the phones and change according to that in manifest.xml file
android:minSdkVersion="11"
android:targetSdkVersion="19"
Thanks

Error on google maps

I have this error: Google Maps Android APIļ¹• Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors)
I must say that I have requested API key with the debug keystore and I do have the needed permissions. Here is my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tripin.corinaracasan.tripin"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="com.example.googlemaps.permission.MAPS_RECEIVE" />
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="17" />
<permission
android:name="com.tripin.corinaracasan.tripin.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MyActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:label="#string/app_name" android:name=".MarkItemClass"/>
<uses-library android:name="com.google.android.maps" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="................................." />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>

Android. No Launcher activity found?

When I'm trying running my app:
No Launcher activity found!
The launch will only sync the application package on the device!
I've readed all questions about similar problems, I changed my manifest.xml but every time I get same error. I stucked for an hour trying to solve this and nothing works.
Here's my manifest fragment:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mosbin"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" >
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="YOUR_OWN_KEY" />
/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.mosbin.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.mosbin.Run"
android:label="#string/title_activity_run"
android:parentActivityName="com.example.mosbin" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.mosbin" />
</activity>
<activity
android:name=".Stats"
android:label="#string/title_activity_stats"
android:parentActivityName="com.example.mosbin" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.mosbin" />
</activity>
</application>
</uses-sdk>
What's wrong with this code?
Before it appears I just wanted to add new activity ...
< /uses-sdk > clear this tag at the end of your manifest and change this
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" > missing / here
to :
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
Also take these into your application tag :
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="YOUR_OWN_KEY" />
https://developers.google.com/maps/documentation/android/start.
Check the link and the topic under Adding the API Key to your application
This is what you Manifest should look like:
Do note how the various tags have been opened and closed. And nested where required.
Also, read up on the Android Manifest Docs. That will ensure there is no confusion in the future. ;-)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mosbin"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" >
</uses-sdk>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="YOUR_OWN_KEY" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.mosbin.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.mosbin.Run"
android:label="#string/title_activity_run"
android:parentActivityName="com.example.mosbin" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.mosbin" />
</activity>
<activity
android:name=".Stats"
android:label="#string/title_activity_stats"
android:parentActivityName="com.example.mosbin" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.mosbin" />
</activity>
</application>
</manifest>

Categories