Google play services rev. 16 error - java

I am new to android. I want add a map to my application. I have the latest revision 16 of play services installed. When I run my application, I get an error a missing meta tag which i have added as below. I testing on android 2.3.6. See Manifets file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mylocation"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="21" />
<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-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.example.mylocation.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>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="A***************************IE" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>

Related

ant build error: package r does not exist

I got this error message when running from command line:
[javac]E:\...\MainActivity.java:19: Error: Package R does not exist
[javac] setContentView(R.layout.activity_main);
I have added import com.***.R; to file MainActivity.java.
Here is the xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.***">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:persistent="true"
android:theme="#style/AppTheme" >
<activity
android:name=".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>
<service android:name=".JmfService"
android:enabled="true"/>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.DELETE_PACKAGES"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.intent.action.MEDIA_SCANNER_SCAN_DIR" />
</manifest>
I've tried ant clean, rebuild project and so on.
When clicking on the menu button to build the project, i got BUILD SUCCESSFUL.

The meta data tag in AndroidManifest.xml does not have the right value

I get this error when trying to run the app:
Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 7095000 but found 6587000. 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" />
But that line of code is in my manifest sorry still noob at android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.topgame.blackjackgfree1"
android:versionCode="2"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10"/>
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<supports-screens android:xlargeScreens="true"
android:largeScreens="true"
android:smallScreens="true"
android:anyDensity="true"
android:normalScreens="true"/>
<application android:label="#string/app_name"
android:icon="#drawable/icon"
android:hardwareAccelerated="true"
android:allowBackup="true"
>
<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"/>
<activity android:name="com.topgame.test.MainActivity"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboardHidden"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<activity android:name="com.greystripe.sdk.GSFullscreenActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" />
<activity android:name="com.mdotm.android.view.MdotMActivity" android:launchMode="singleTop"/>
<activity android:name="com.chartboost.sdk.CBImpressionActivity" android:excludeFromRecents="true" android:theme="#android:style/Theme.Translucent.NoTitleBar" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" />
<activity android:name="com.mopub.mobileads.MoPubActivity" android:configChanges="keyboardHidden|orientation"/>
<activity android:name="com.mopub.mobileads.MraidActivity" android:configChanges="keyboardHidden|orientation"/>
<activity android:name="com.mopub.mobileads.MraidBrowser" android:configChanges="keyboardHidden|orientation"/>
<activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity" android:configChanges="keyboardHidden|orientation"/>
</application>
</manifest>
You need to Update the Google Play Service in Your Device or in Your
Emulator
Because the thing is that, you use the latest version of play service in development but you device have oldest one.
So the problem is come in picture.
you don't have the updated version. you need to update from SDK manager. if you work with android studio you can do it do it automatic by define in gradle file like this:
dependencies {
compile 'com.android.support:support-v13:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
}
if you work with eclipse, you need to remove the oldest google play services and bring the new from android sdk/extras

Android error: "APK NOT INSTALLED" in Android 2.3.x

My app seems to working in Android 4.0 also in emulator. but when I tried in other device(2.3) it showing "APK NOT INSTALLED" :(
Here is my manifest file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ex.live"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<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/AppTheme" >
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<activity
android:name="com.ex.live.Main"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED how to fix?

Today, I was working on an app. Testing testing testing.. and out of the blue, the app says Manifest Malformed. What is did first was undo what I changed, but that didn't help. I then copied a copy from this morning, but that was no good either.. Hope you guys can help, my manifest is below!
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lahmob.swagdaddymcnugget"
android:versionCode="2"
android:versionName="1.1" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.lahmob.swagdaddymcnugget.MainActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.lahmob.swagdaddymcnugget.SplashScreen"
android:label="#string/app_name" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name="com.lahmob.swagdaddymcnugget.Webview"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.lahmob.swagdaddymcnugget.MusicPlayer"
android:label="#string/title_activity_music_player" >
</activity>
</application>
</manifest>
Because requested, the LogCat
In the meantime, I fixed the problem myself. Turned out I just had to remove a corrupt lib file.
-Laurens

Unable to load maps into an android(samsung) phone

Unable to load maps into an android(samsung) phone. It just displays grid cells without loading the maps. This is my first time developing an android application. Could you please help in what else needs to be done apart from the below steps.
Downloaded the android version(eclipse).
Installed all the required API's for google maps.
Set the manifest file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.csc714.app"
android:versionCode="1"
android:versionName="1.0.0" >
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<application
android:icon="#drawable/icon"
android:label="#string/app_name" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".Main"
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>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
If you are using google map v2 then first create(check) api key.
You have to add google-play-services library.
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="17" />
<permission
android:name="com.example.package.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.package.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-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:icon="#drawable/icon"
android:label="#string/app_name" >
<uses-library
android:name="com.google.android.maps"/>
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
References:
link link2
Please refer link and change xml,java and manifext.xml
If you find any trouble then let me know.
In AndroidManifest.xml, add the following element as a child of the element, by inserting it just before the closing tag :
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="your_api_key"/>
You are missing
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
Few permissions are repeated remove them
Go through the steps in the link. I doubt you have followed the steps from the below link.
https://developers.google.com/maps/documentation/android/start.
You can also follow the tutorial in the link below
http://www.youtube.com/watch?v=awX5T-EwLPc
Edit :
You also require
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
You can also get rid of
<permission
android:name="com.example.package.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
For more information read
https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2

Categories

Resources