java.lang.RuntimeException: Unable to instantiate activity Google Maps - android

Here is the Manifest File.
Oops! Your question couldn't be submitted because:
Your post does not have much context to explain the code sections; please explain your scenario more clearly.
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.googlemaps"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application android:icon="#drawable/ic_launcher" android:label="#string/app_name" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".HelloGoogleMaps"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Thanks in advance.

Here is the problem is adding permission. I also had this problem while doing a project.
You missed one permission. Find that one and give it.

You didn't supply your layout, but I had this same problem when I used the wrong Map API key in my MapView control. Under Eclipse, you must generate the Key from "debug.keystore", NOT your distribution keystore.

Related

I am Getting this error "INSTALL_PARSE_FAILED_MANIFEST_MALFORMED" .how do i solve it?

I am getting this error.Please help me. I tried to solve this but i could not.Thanks in advance.This is my Manifest file. Please tell what are the things that i need to change or add.Please explain why ? Explanation would be preferred.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Puzzle1024.angry2048"
android:versionCode="3"
android:versionName="2" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="19" />
<supports-screens
android:largeScreens="true"
android:xlargeScreens="true" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name" >
<activity
android:name="Puzzle1024.angry2048.app.MainGame"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/app_name"
android:windowSoftInputMode="stateHidden|adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<activity android:name="Puzzle1024.angry2048.Screen"></activity>
</application>
</manifest>
system package name should contain only lower case characters.
package="Puzzle1024.angry2048"
P is caps.
In such a case usually do following:
check the manifest-file for syntax errors
clean your project (e.g. build->clean or delete /bin-folder and sometimes /gen-folder)
go to the project/package explorer
right-click on the manifest-file
VALIDATE!
Everything should be fine now.

Android | Google Maps API

Today I've been updating my android app but this isn't going as expected.
I'm using google maps and after the update I don't get it to work anymore.
I got another API key and everything.. Now the difference is I used Google APIs 4.2.2 and after today 4.4
Could it be that the code to display a Google Map changed in these APIs? Is there a way to keep track of the changes and if yes where?
In the old app where it works I use following code in an XML file to display a map
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_below="#id/upper"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="be.khk.mmapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<permission
android:name="be.khk.mmapp.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<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/mm_icon"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="be.khk.mmapp.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="be.khk.mmapp.NewsActivity"
android:label="#string/news_activity" >
</activity>
<activity
android:name="be.khk.mmapp.RetailersActivity"
android:label="#string/retailers_activity" >
</activity>
<activity
android:name="be.khk.mmapp.VoucherActivity"
android:label="#string/voucher_activity" >
</activity>
<activity
android:name="be.khk.mmapp.AboutUsActivity"
android:label="#string/aboutus_activity" >
</activity>
<activity
android:name="be.khk.mmapp.RetailerActivity"
android:label="#string/retailer_activity" >
</activity>
<activity
android:name="be.khk.mmapp.ContactActivity"
android:label="#string/contact_activity" >
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<uses-library android:name="com.google.android.maps" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBnVb**************************6pUvk" />
</application>
</manifest>
If anyone could lead me in the right direction that would be nice.
The Google Maps SDK is stored in Google Play Services and is updated independently from the Android OS. What phone are you using? If you flashed a custom ROM, make sure it has Google Play Services. Can you also provide your AndroidManifest?
EDIT: check logcat for authorization failure.

Error Parsing XML: Mismatched tag - Android strange error

I have just started Android Development, and I am trying to implement "Google Maps for Android API v2" in my app. I pretty much just want the map to show the device's location. So far, I can get the lat + long position, country, and city. Now, I just want to show that on a map. I am working in eclipse
So, I ran into an issue where I get a weird error that says
Error Parsing XML: Mismatched tag
I have been troubleshooting my code for the past 2 hours, and cannot find out how the tag could possibly be mismatched (it is the closing </application> tag)
Here is my complete code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dd.splash"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="18" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<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"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.dd.splash.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=".myMainScreen"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.tutorial.CLEARSCREEN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".myMainScreen" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar"></activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="KEY" />
</application>
</manifest>
Any help, or suggestions are greatly appreciated!
Thank you :)
I just found out how to fix this. You can automatically clean up all formatting and errors within eclipse, by going to Project > Clean... It's as simple as that :)

Changing API Key Has No Effect

In messing around, I noticed that adding a dummy API Key to a working project's AndroidManifest.xml does not affect the project. In fact, I added key "Asfasdfasdfasfa" which isn't even valid and the project continues working.
Could someone draw light on this issue? Is there caching going?
Console:
MY:SS:HA:1K:EY;com.company.myproject
MY:SS:HA:1K:EY;com.example.gmaptest
Working manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.myproject"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.company.myproject.MainScreen"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="asdfadf22" />
</application>
</manifest>
Take a look of this: Can I have a single Google Maps API key for all my apps without registering their package names?.
To create an API key, you provide some information that include the package name of the app. That means you are trying to validate one of your apps with a key created with another package name, this could be the issue.

AdMob error: "You must have AdActivity declared in AndroidManifest.xml with configChanges"

I have looked at similar questions and did all the suggestions and I am still getting this message on my phone: "You must have AdActivity declared in AndroidManifest.xml with configChanges".
Here is what I have in the manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="..." android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17"/>
<application android:icon="#drawable/ic_launcher" android:label="#string/app_name" android:allowBackup="true">
<activity android:name="..." 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.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode"/>
<service android:enabled="true" android:name="..." />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>
Is there anything else that I should do?
Please note: I have looked at other similar questions, and none of the answers solves my problem.
Thanks for the help.
Change your manifest to
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
also,
you have to set your project build target to Android 3.2 or higher .
Note:
Don't forget these two permissions in your manifest
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Refer this tutorial
Read documentation

Categories

Resources