Hi people i´m a very begginer developing android apps and i want to do some application using the google maps android api v2, but with no succes.
The step im following are this http://mobile.tutsplus.com/tutorials/android/android-sdk-working-with-google-maps-application-setup/ testing it with a samsung galaxy SIII phonel.
The application simply starts but close inmediatly (5 seconds after) telling the app must be closed.
Attached you can find the logcat with the errors and here is the manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tuxido.example.mapuse"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="18" />
<permission
android:name="tuxido.example.mapuse.MAPS_RECEIVE"
android:protectionLevel="signature" />
<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-permission android:name="your.package.name.permission.MAPS_RECEIVE"/>
<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="tuxido.example.mapuse.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>
</application>
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="(my API key)" />
</manifest>
I added the google-services-lin in the workspace as in the tutorial
Thanks before hand
Your meta-data elements should be within the application element. See previous reply. By the way, don't show your API Key.
I am adding one of my manifests from a working program (less the API key of course)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.maptest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<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"/>
<!-- The following two permissions are not required to use
Google Maps Android API v2, but are recommended. -->
<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" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.example.maptest.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=".NextActivity"
android:label="#string/title_next" >
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="....."/>
</application>
Related
I'm starting using google maps and i added
<uses-permission android:name="android.permission.INTERNET"/>
<uses-library android:name="com.google.android.maps"/>
in my manifest file as well as apikey i got from google.
<com.google.android.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="api_key_here"
android:id="#+id/mvMain"
android:enabled="true"
android:clickable="true"
/>
But on running the program, "Couldn't get connection factory client" shows up in Error log.
I will greatly appreciate any help. thank you.
This is working manifest file and take a look into this. If you are missing any thing inside your manifest.xml file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Package_name"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<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" />
<!--
The following two permissions are not required to use
Google Maps Android API v2, but are recommended.
-->
<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" />
<!-- TODO: Replace "com.example.hellomap" with your package name -->
<permission
android:name="PACKAGE_NAME.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="PACKAGE_NAME.permission.MAPS_RECEIVE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="PACKAGE_NAME.MainActivity"
android:label="#string/app_name"
android:windowSoftInputMode="stateHidden" >
<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="API_KEY" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
Hello I am a beginner programmer using eclipse for app development and received this error in my manifest when trying to run a simple program. I have taken other suggestions based on other responses to people with the same error but so far nothing seems to have worked. Any help is greatly appreciated.
{
<<<<<<< Original
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.JTInc.tag"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<uses-permission android:name="com.JTInc.tag.permission.MAPS_RECEIVE" />
<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" />
<permission
android:name="com.JTInc.tag.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<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="com.JTInc.tag.LoginActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustResize|stateVisible" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.JTInc.tag.MapActivity"
android:label="#string/title_activity_map"
android:parentActivityName="com.JTInc.tag.LoginActivity">
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="com.JTInc.tag.LoginActivity" />
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyCZ6x93L7BBTILLTdWkDT8Da6a8f4mVo1o" />
</application>
You forgot the closing </manifest> at the end of your manifest.
Also the beginning <<<<<<< Original text should not be there.
I have this very weird bug that my app crashes in the minute I launch it.
the call stack is:
01-25 15:10:52.264: E/AndroidRuntime(13707): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.out.goout/com.out.goout.Splash}: java.lang.IllegalStateException:The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4030500 but found 4132500. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
the thing is that I do have the tag that explained in the stack trace and the version of my google play services is 14
the code in my manifest is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my package"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
<uses-permission android:name="com.out.goout.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<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" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<permission
android:name="com.out.goout.permission.MAPS_RECEIVE"
android:protectionLevel="signature" >
</permission>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:name="com.out.App"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="false"
android:theme="#style/Theme.Sherlock.Light.DarkActionBar" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<uses-library
android:name="com.google.android.maps"
android:required="true" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my key" />
<activity
...
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
...
</activity>
<activity
...
</activity>
<activity
...
</activity>
<activity
...
</activity>
</application>
</manifest>
your help is much needed
Remove this line from manifest:
<uses-library
android:name="com.google.android.maps"
android:required="true" />
finnaly I got this...
I started a new android project and replace the android-support-v4.jar file clean the project and it helped!
Thanks a lot Zohra Khan for your help
have a problem with the already published application on Google Play. The application in store, but no one can download, because I getting "Supported devices 0". I did refactor the project, removed all unnecessary with the manifest. Compiled a new apk, and again "Supported devices 0". I have already a few days trying to solve this problem, but until the "Supported devices 0". I spread the current manifest, project structure, and screenshots from Google Play page publication. Application Activated. Really need your help.
(Sorry for my english)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.application"
android:versionCode="2"
android:versionName="1.1">
<uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="17"/>
<permission android:name="my.application.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-feature android:glEsVersion="0x00020000"
android:required="true"/>
<uses-permission android:name="my.application.permission.MAPS_RECEIVE"/>
<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"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application android:icon="#drawable/ic_launcher"
android:name="my.application.activity.delegateApplication"
android:allowBackup="true"
android:launchMode="singleInstance"
android:largeHeap="true"
android:label="#string/app_name" >
<activity
android:name=".activity.SomeActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
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>
<activity android:name=".SomeClass"
android:theme="#style/CustomTheme"
android:screenOrientation="portrait"
>
</activity>
<activity android:name=".SomeClass1"
android:theme="#android:style/Theme.NoTitleBar"
android:screenOrientation="portrait"
>
</activity>
<activity
android:name=".SomeClass3"
android:launchMode="singleInstance"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.NoTitleBar" />
...
<activity android:name=".SomeClassN"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my_code"
/>
</application>
</manifest>
pictures
unfortunately I can not post it pictures, just links to them
http://leahov.com/pic/1.png
http://leahov.com/pic/2.png
I am building a project for android 4.3 and building to an actual device but my google map always shows up empty and i get an authorization failure.. But everything checks out..
I have a network connection..
LOG ERROR
GOOGLE API CONSOLE
SERVICES IN CONSOLE
My Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sapientnitro.inhouse.drop"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="18" />
<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.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<permission
android:name="com.sapientnitro.inhouse.drop.activities.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission
android:name="com.sapientnitro.inhouse.drop.activities.permission.MAPS_RECEIVE"
android:required="false" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<uses-library android:name="com.google.android.maps"/>
<activity
android:name=".activities.DRPSplashActivity"
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=".activities.DRPMapViewActivity"
android:launchMode="standard"
android:screenOrientation="portrait" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyA7tcgqzYWAcqLd0ea5qAqHYpaYKTHQv5s" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
problem solved.. i had to uninstall the app, and do a project clean, then re-install the app.. don't know why exactly but now its working
Your API key in your manifest clearly does not match the API key you posted that is showing in the API console. Paste the API key from the console into the manifest. Should fix you right up.