I use Eclipse with ADT, I tried to show admob banners with Google Play Services in Google Ads Sample but it show "Internal Error".
Internet work, I have google-play-services_lib rev 22 included in project.
I have tried in another phone but same thing.
LogCat:
01-25 09:19:01.795: W/GooglePlayServicesUtil(14429): Google Play services out of date. Requires 6587000 but found 5089030
01-25 09:19:01.845: D/dalvikvm(14429): GC_CONCURRENT freed 864K, 18% free 4349K/5248K, paused 4ms+3ms, total 39ms
01-25 09:19:01.865: W/GooglePlayServicesUtil(14429): Google Play services out of date. Requires 6587000 but found 5089030
01-25 09:19:01.885: I/Ads(14429): Starting ad request.
01-25 09:19:01.936: I/Ads(14429): Please set theme of AdActivity to #android:style/Theme.Translucent to enable transparent background interstitial ad.
01-25 09:19:02.105: I/dalvikvm(14429): Total arena pages for JIT: 11
01-25 09:19:02.105: I/dalvikvm(14429): Total arena pages for JIT: 12
01-25 09:19:02.105: I/dalvikvm(14429): Total arena pages for JIT: 13
01-25 09:19:02.105: I/dalvikvm(14429): Total arena pages for JIT: 14
01-25 09:19:02.105: I/dalvikvm(14429): Total arena pages for JIT: 15
01-25 09:19:02.105: I/dalvikvm(14429): Total arena pages for JIT: 16
01-25 09:19:02.105: I/dalvikvm(14429): Total arena pages for JIT: 17
01-25 09:19:02.265: I/dalvikvm(14429): Total arena pages for JIT: 18
01-25 09:19:02.915: D/dalvikvm(14429): DexOpt: --- BEGIN 'ads-1030805842.jar' (bootstrap=0) ---
01-25 09:19:03.046: D/dalvikvm(14429): DexOpt: --- END 'ads-1030805842.jar' (success) ---
01-25 09:19:03.046: D/dalvikvm(14429): DEX prep '/data/data/com.google.android.gms.samples.ads/cache/ads-1030805842.jar': unzip in 1ms, rewrite 137ms
01-25 09:19:03.115: W/GooglePlayServicesUtil(14429): Google Play services out of date. Requires 6587000 but found 5089030
01-25 09:19:03.115: E/GooglePlayServicesUtil(14429): GooglePlayServices not available due to error 2
01-25 09:19:03.315: I/dalvikvm(14429): Could not find method android.webkit.WebView.evaluateJavascript, referenced from method com.google.android.gms.internal.gu.evaluateJavascript
01-25 09:19:03.315: W/dalvikvm(14429): VFY: unable to resolve virtual method 8193: Landroid/webkit/WebView;.evaluateJavascript (Ljava/lang/String;Landroid/webkit/ValueCallback;)V
01-25 09:19:03.315: D/dalvikvm(14429): VFY: replacing opcode 0x6f at 0x0016
01-25 09:19:04.175: W/Ads(14429): JS: The page at https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html displayed insecure content from file:///android_asset/webkit/android-weberror.png.
01-25 09:19:04.175: W/Ads(14429): (null:1)
01-25 09:19:04.175: W/Web Console(14429): The page at https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html displayed insecure content from file:///android_asset/webkit/android-weberror.png.
01-25 09:19:04.175: W/Web Console(14429): at null:1
01-25 09:19:04.526: E/Ads(14429): JS: Uncaught ReferenceError: AFMA_buildAdURL is not defined (null:1)
01-25 09:19:04.526: E/Web Console(14429): Uncaught ReferenceError: AFMA_buildAdURL is not defined at null:1
01-25 09:19:13.316: D/webviewglue(14429): nativeDestroy view: 0x2a377dc8
01-25 09:19:13.335: W/Ads(14429): There was a problem getting an ad response. ErrorCode: 0
01-25 09:19:13.345: D/dalvikvm(14429): GC_CONCURRENT freed 519K, 17% free 4405K/5248K, paused 5ms+5ms, total 36ms
01-25 09:19:13.375: W/Ads(14429): Failed to load ad: 0
Mannifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.gms.samples.ads"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="21" />
<!-- Used to request banner and interstitial ads. -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Used to avoid sending an ad request if there is no connectivity. -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<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.google.android.gms.samples.ads.GoogleAdsSampleActivity"
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=".BannerXmlActivity"
android:label="#string/banner_in_xml"/>
<activity android:name=".BannerCodeActivity"
android:label="#string/banner_in_code"/>
<activity android:name=".InterstitialActivity"
android:label="#string/interstitial"/>
<!-- Activity required to show ad overlays. -->
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>
</manifest>
Project-Property:
target=android-21
android.library.reference.1=../google-play-services_lib
Java Code:
mAdView = new AdView(this);
mAdView.setAdUnitId("ca-app-pub-8xxxxxxxxxxxxxxx/4xxxxxxxxx");
mAdView.setAdSize(AdSize.BANNER);
final RelativeLayout layout = (RelativeLayout) findViewById(R.id.mainLayout);
layout.addView(mAdView);
mAdView.setAdListener(new ToastAdListener(this));
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice("AAxAxxxAxAxxxAxxxAxxxAAxxAxxxAA")
.build();
mAdView.loadAd(adRequest);
If I must update Google Play Services on my phone, I don't know how because Google Play Store doesn't show Google Play Services.
Check if you imported library for ads
Check if you created internal ads in your ADMob account
Check if you have API 9 or higher on your mobile phone (if you have API 8 or lower it won't work because API 8 doesn't support Google Play services any more)
Then try this code:
Toast toast = new Toast(this);
toast.setView(ads);
toast.show();
you need to call toast.show in your main activity or it won't work.
Related
i have trying to get test ad on my device from last 3 weeks but still no ad.
plz help me .
my logcat details is:
01-04 14:09:22.099: D/WebView(1677): onSizeChanged - w:480 h:75
01-04 14:10:30.957: W/IInputConnectionWrapper(1677): getSelectedText on inactive InputConnection
01-04 14:10:30.957: W/IInputConnectionWrapper(1677): setComposingText on inactive InputConnection
01-04 14:10:56.782: D/dalvikvm(3437): GC_FOR_ALLOC freed 138K, 10% free 9738K/10759K, paused 23ms, total 23ms
01-04 14:10:56.922: D/dalvikvm(3437): GC_CONCURRENT freed 147K, 10% free 10109K/11143K, paused 2ms+4ms, total 131ms
01-04 14:10:56.922: D/dalvikvm(3437): WAIT_FOR_CONCURRENT_GC blocked 66ms
01-04 14:10:57.022: I/dalvikvm(3437): Could not find method android.webkit.WebSettings.getDefaultUserAgent, referenced from method com.google.android.gms.ads.internal.util.g.a
01-04 14:10:57.022: W/dalvikvm(3437): VFY: unable to resolve static method 3091: Landroid/webkit/WebSettings;.getDefaultUserAgent (Landroid/content/Context;)Ljava/lang/String;
01-04 14:10:57.022: D/dalvikvm(3437): VFY: replacing opcode 0x71 at 0x0011
01-04 14:10:57.112: D/dalvikvm(3437): GC_FOR_ALLOC freed 244K, 10% free 10392K/11527K, paused 16ms, total 16ms
01-04 14:10:57.232: I/webclipboard(3437): clipservice: android.sec.clipboard.ClipboardExManager#41e6c6e0
01-04 14:10:57.252: I/Ads(3437): Starting ad request.
01-04 14:10:57.252: I/Ads(3437): Use AdRequest.Builder.addTestDevice("11D834F405486C316220DC52A0BB7D6D") to get test ads on this device.
01-04 14:10:57.412: D/dalvikvm(3437): GC_CONCURRENT freed 193K, 10% free 10489K/11591K, paused 6ms+33ms, total 301ms
01-04 14:10:57.502: D/libEGL(3437): loaded /system/lib/egl/libGLES_hawaii.so
01-04 14:10:57.512: D/(3437): mem_init ++
01-04 14:10:57.512: D/(3437): gHwMemAllocator client 3
01-04 14:10:57.512: D/(3437): **** Using ION allocator ****
01-04 14:10:57.512: D/(3437): registered SIGUSR1[10] for pid[3437]
01-04 14:10:57.512: D/(3437): HwMemAllocatorImpl Static Counters 0 0
01-04 14:10:57.512: D/(3437): HwMemAllocatorImpl[4acdad5c] totalDeviceAllocSize[0] totalFree[0] maxFree[0] in numSlabs[0]
01-04 14:10:57.512: D/(3437): mem_init 4acdad5c--
01-04 14:10:57.512: D/ION(3437): config: version(0x10000) secure(0xf000) 256M(0x22d) fast(0x608) hwwr(0x608)
01-04 14:10:57.512: D/(3437): Waiting for mm thread to come up
01-04 14:10:57.512: D/(3437): mm_device_thread starting
01-04 14:10:57.522: D/HAWAII_EGL(3437): eglCreateContext() config: 35 context: 0x4d983e40, VC context 1, Thread 3437
01-04 14:10:57.522: D/HAWAII_EGL(3437): Set SWAP INTERVAL 0
01-04 14:10:57.522: D/HAWAII_EGL(3437): eglCreateWindowSurface() surface: 0x4d57beb8, VC surface: 1, Thread: 3437
01-04 14:10:57.522: D/HAWAII_EGL(3437): eglMakeCurrent(0x4d983e40, 0x4d57beb8, 0x4d57beb8) Thread: 3437
01-04 14:10:57.522: D/OpenGLRenderer(3437): Enabling debug mode 0
01-04 14:10:57.583: V/webkit(3437): BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {41f6c018}
01-04 14:10:57.883: D/dalvikvm(3437): DexOpt: --- BEGIN 'ads1156133905.jar' (bootstrap=0) ---
01-04 14:10:58.183: D/dalvikvm(3437): DexOpt: --- END 'ads1156133905.jar' (success) ---
01-04 14:10:58.183: D/dalvikvm(3437): DEX prep '/data/data/com.example.myadtestapp/cache/ads1156133905.jar': unzip in 0ms, rewrite 299ms
01-04 14:11:00.986: W/Ads(3437): There was a problem getting an ad response. ErrorCode: 1
01-04 14:11:00.996: I/dalvikvm(3437): Could not find method android.webkit.WebSettings.setMediaPlaybackRequiresUserGesture, referenced from method com.google.android.gms.ads.internal.o.a.<init>
01-04 14:11:00.996: W/dalvikvm(3437): VFY: unable to resolve virtual method 3104: Landroid/webkit/WebSettings;.setMediaPlaybackRequiresUserGesture (Z)V
01-04 14:11:00.996: D/dalvikvm(3437): VFY: replacing opcode 0x6e at 0x004b
01-04 14:11:01.006: I/dalvikvm(3437): Could not find method android.webkit.WebView.evaluateJavascript, referenced from method com.google.android.gms.ads.internal.o.a.evaluateJavascript
01-04 14:11:01.016: W/dalvikvm(3437): VFY: unable to resolve virtual method 3114: Landroid/webkit/WebView;.evaluateJavascript (Ljava/lang/String;Landroid/webkit/ValueCallback;)V
01-04 14:11:01.016: D/dalvikvm(3437): VFY: replacing opcode 0x6f at 0x0016
01-04 14:11:01.036: V/webkit(3437): BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {41fc54a0}
01-04 14:11:01.036: I/webclipboard(3437): clipservice: android.sec.clipboard.ClipboardExManager#41fc5bd8
01-04 14:11:01.086: W/Ads(3437): Failed to load ad: 1
and main.java is:
package com.example.myadtestapp;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.google.ads.AdSize;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
public class MainActivity extends ActionBarActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
AdView adView = (AdView) findViewById(R.id.adView);
// Request for Ads
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice("4d08da7768519000")
.build();
adView.loadAd(adRequest);
}
and activity_main.xml is
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.example.myadtestapp.MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/hello_world" />
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="#+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adUnitId="ca-app-pub-1205981486869590/2185561060 "
ads:adSize="SMART_BANNER"/>
</RelativeLayout>
and my mainfest.xml is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myadtestapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<!-- Include required permissions for Google Mobile Ads to run-->
<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/AppTheme" >
<!--This meta-data tag is required to use Google Play Services.-->
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<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>
<!--Include the AdActivity configChanges and theme. -->
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent" />
</application>
</manifest>
plz help me to get out from this problem....
Remove padding from parent layout.
To be exact, remove below 4 lines in your xml.
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
As per the Google Mobile Ads documentation, "Failed to load ad: 1" means the ad unit ID was incorrect.
Get the proper add unit id. See: Create an ad unit
My Project has a map activity with other activities linked using intent. However all other activities are been seen; Map just shows a blank white screen on phone and error" update google play services" on the emulator. please help
ActivityMap.java
package com.example.bloodbankmap;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.widget.Toast;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.CameraPosition;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
public class ActivityMap extends FragmentActivity {
// Google Map
private GoogleMap googleMap;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
try {
// Loading map
initilizeMap();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* function to load map. If map is not created it will create it for you
* */
private void initilizeMap() {
if (googleMap == null) {
// googleMap = ((MapFragment) getFragmentManager().findFragmentById(
//R.id.map)).getMap();
googleMap = ((SupportMapFragment)(getSupportFragmentManager().findFragmentById(R.id.map))).getMap();
// check if map is created successfully or not
if (googleMap == null) {
Toast.makeText(getApplicationContext(),
"Sorry! unable to create maps", Toast.LENGTH_SHORT)
.show();
}
}
}
#Override
protected void onResume() {
super.onResume();
initilizeMap();
}
}
map.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!-- <Button
android:id="#+id/button10"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="View Complete Stock " /> -->
</RelativeLayout>
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.bloodbankmap"
android:versionCode="1"
android:versionName="1.0" >
<permission
android:name="com.example.bloodbankmap.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.bloodbankmap.permission.MAPS_RECEIVE" />
<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" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Required to show current location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Required OpenGL ES 2.0. for Maps V2 -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<!-- Requires OpenGL ES version 2 -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/blood"
android:label="#string/app_name">
<activity
android:name="com.example.bloodbankmap.Launcher"
android:label="#string/app_name"
android:theme="#style/AppBaseTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.bloodbankmap.List"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.example.bloodbankmap.ActivityMap"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.example.bloodbankmap.Registration"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.example.bloodbankmap.Area"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.example.bloodbankmap.Disp_bb"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.example.bloodbankmap.Nearest_BB"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.example.bloodbankmap.Notifications"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.example.bloodbankmap.Notify"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.example.bloodbankmap.SByBlgrp"
android:label="#string/app_name" >
</activity>
<!-- Goolge API Key -->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyD-0S4belIQQUFoYL26Y_fimoS6FZ4udpE" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
my logcat
02-20 06:07:15.317: D/dalvikvm(1022): GC_CONCURRENT freed 272K, 15% free 2489K/2904K, paused 17ms+3ms, total 62ms
02-20 06:07:15.317: D/dalvikvm(1022): WAIT_FOR_CONCURRENT_GC blocked 46ms
02-20 06:07:15.327: I/dalvikvm-heap(1022): Grow heap (frag case) to 3.254MB for 721184-byte allocation
02-20 06:07:15.377: D/dalvikvm(1022): GC_FOR_ALLOC freed 1K, 12% free 3191K/3612K, paused 48ms, total 49ms
02-20 06:07:15.557: I/Choreographer(1022): Skipped 44 frames! The application may be doing too much work on its main thread.
02-20 06:07:15.597: D/gralloc_goldfish(1022): Emulator without GPU emulation detected.
02-20 06:07:52.841: D/dalvikvm(1161): GC_FOR_ALLOC freed 251K, 14% free 2489K/2884K, paused 36ms, total 38ms
02-20 06:07:52.841: I/dalvikvm-heap(1161): Grow heap (frag case) to 3.253MB for 721184-byte allocation
02-20 06:07:52.901: D/dalvikvm(1161): GC_FOR_ALLOC freed 2K, 12% free 3191K/3592K, paused 49ms, total 49ms
02-20 06:07:52.961: D/dalvikvm(1161): GC_CONCURRENT freed <1K, 12% free 3191K/3592K, paused 5ms+25ms, total 65ms
02-20 06:07:53.101: I/Choreographer(1161): Skipped 33 frames! The application may be doing too much work on its main thread.
02-20 06:07:53.151: D/gralloc_goldfish(1161): Emulator without GPU emulation detected.
02-20 06:07:55.442: I/Choreographer(1161): Skipped 57 frames! The application may be doing too much work on its main thread.
02-20 06:07:55.811: I/Choreographer(1161): Skipped 399 frames! The application may be doing too much work on its main thread.
02-20 06:07:55.841: D/dalvikvm(1161): GC_CONCURRENT freed 731K, 24% free 2858K/3732K, paused 6ms+43ms, total 163ms
02-20 06:07:57.901: I/Choreographer(1161): Skipped 2434 frames! The application may be doing too much work on its main thread.
02-20 06:07:58.231: I/Choreographer(1161): Skipped 70 frames! The application may be doing too much work on its main thread.
02-20 06:07:58.392: I/Choreographer(1161): Skipped 175 frames! The application may be doing too much work on its main thread.
02-20 06:07:58.571: I/Choreographer(1161): Skipped 42 frames! The application may be doing too much work on its main thread.
02-20 06:07:59.131: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.181: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.241: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.281: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.321: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.351: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.391: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.422: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.461: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.651: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.681: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.781: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.821: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.902: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:07:59.961: W/GooglePlayServicesUtil(1161): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:08:00.021: D/dalvikvm(1161): GC_CONCURRENT freed 317K, 20% free 2993K/3732K, paused 15ms+58ms, total 255ms
02-20 06:08:00.081: I/Choreographer(1161): Skipped 157 frames! The application may be doing too much work on its main thread.
02-20 06:08:00.351: I/Choreographer(1161): Skipped 128 frames! The application may be doing too much work on its main thread.
02-20 06:08:00.641: I/Choreographer(1161): Skipped 30 frames! The application may be doing too much work on its main thread.
02-20 06:56:51.331: E/Trace(1652): error opening trace file: No such file or directory (2)
02-20 06:56:51.991: D/dalvikvm(1652): GC_FOR_ALLOC freed 262K, 14% free 2489K/2892K, paused 87ms, total 89ms
02-20 06:56:52.001: I/dalvikvm-heap(1652): Grow heap (frag case) to 3.253MB for 721184-byte allocation
02-20 06:56:52.061: D/dalvikvm(1652): GC_FOR_ALLOC freed 2K, 12% free 3191K/3600K, paused 54ms, total 54ms
02-20 06:56:52.131: D/dalvikvm(1652): GC_CONCURRENT freed <1K, 12% free 3191K/3600K, paused 5ms+4ms, total 71ms
02-20 06:56:52.301: I/Choreographer(1652): Skipped 38 frames! The application may be doing too much work on its main thread.
02-20 06:56:52.331: D/gralloc_goldfish(1652): Emulator without GPU emulation detected.
02-20 06:56:54.451: I/Choreographer(1652): Skipped 43 frames! The application may be doing too much work on its main thread.
02-20 06:56:54.801: I/Choreographer(1652): Skipped 382 frames! The application may be doing too much work on its main thread.
02-20 06:56:54.821: D/dalvikvm(1652): GC_CONCURRENT freed 731K, 24% free 2858K/3732K, paused 5ms+22ms, total 146ms
02-20 06:56:55.001: I/Choreographer(1652): Skipped 44 frames! The application may be doing too much work on its main thread.
02-20 06:56:55.651: I/Choreographer(1652): Skipped 45 frames! The application may be doing too much work on its main thread.
02-20 06:56:56.032: I/Choreographer(1652): Skipped 99 frames! The application may be doing too much work on its main thread.
02-20 06:57:03.691: I/Choreographer(1652): Skipped 105 frames! The application may be doing too much work on its main thread.
02-20 06:57:04.301: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:04.351: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:04.411: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:04.441: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:04.491: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:04.531: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:04.581: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:04.611: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:04.651: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:04.881: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:04.931: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:05.082: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:05.131: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:05.231: D/dalvikvm(1652): GC_CONCURRENT freed 292K, 20% free 2987K/3732K, paused 6ms+38ms, total 256ms
02-20 06:57:05.241: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:05.291: W/GooglePlayServicesUtil(1652): Google Play services out of date. Requires 4242000 but found 3136130
02-20 06:57:05.371: I/Choreographer(1652): Skipped 71 frames! The application may be doing too much work on its main thread.
02-20 06:57:05.681: I/Choreographer(1652): Skipped 114 frames! The application may be doing too much work on its main thread.
02-20 06:57:07.101: I/Choreographer(1652): Skipped 70 frames! The application may be doing too much work on its main thread.
02-20 06:57:07.271: I/Choreographer(1652): Skipped 45 frames! The application may be doing too much work on its main thread.
02-20 06:57:14.221: I/Choreographer(1652): Skipped 55 frames! The application may be doing too much work on its main thread.
02-20 06:57:14.971: I/Choreographer(1652): Skipped 51 frames! The application may be doing too much work on its main thread.
02-20 06:57:15.516: I/Choreographer(1652): Skipped 87 frames! The application may be doing too much work on its main thread.
02-20 06:57:16.541: I/Choreographer(1652): Skipped 30 frames! The application may be doing too much work on its main thread.
02-20 06:57:17.311: I/Choreographer(1652): Skipped 48 frames! The application may be doing too much work on its main thread.
02-20 07:35:21.421: D/dalvikvm(1811): GC_CONCURRENT freed 281K, 15% free 2491K/2916K, paused 17ms+6ms, total 105ms
02-20 07:35:21.421: D/dalvikvm(1811): WAIT_FOR_CONCURRENT_GC blocked 33ms
02-20 07:35:21.442: I/dalvikvm-heap(1811): Grow heap (frag case) to 3.256MB for 721184-byte allocation
02-20 07:35:21.492: D/dalvikvm(1811): GC_FOR_ALLOC freed 4K, 12% free 3191K/3624K, paused 46ms, total 46ms
02-20 07:35:21.751: I/Choreographer(1811): Skipped 43 frames! The application may be doing too much work on its main thread.
02-20 07:35:21.781: D/gralloc_goldfish(1811): Emulator without GPU emulation detected.
02-20 07:35:23.801: I/Choreographer(1811): Skipped 61 frames! The application may be doing too much work on its main thread.
02-20 07:35:24.181: D/dalvikvm(1811): GC_CONCURRENT freed 731K, 24% free 2854K/3728K, paused 6ms+70ms, total 146ms
02-20 07:35:24.201: I/Choreographer(1811): Skipped 462 frames! The application may be doing too much work on its main thread.
02-20 07:35:24.391: I/Choreographer(1811): Skipped 36 frames! The application may be doing too much work on its main thread.
02-20 07:35:24.941: I/Choreographer(1811): Skipped 35 frames! The application may be doing too much work on its main thread.
02-20 07:35:25.351: I/Choreographer(1811): Skipped 101 frames! The application may be doing too much work on its main thread.
02-20 07:35:25.982: I/Choreographer(1811): Skipped 62 frames! The application may be doing too much work on its main thread.
02-20 07:35:26.501: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:26.551: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:26.581: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:26.631: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:26.671: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:26.711: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:26.751: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:26.781: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:26.821: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:26.981: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:27.001: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:27.241: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:27.281: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:27.361: D/dalvikvm(1811): GC_CONCURRENT freed 276K, 20% free 3003K/3728K, paused 69ms+48ms, total 281ms
02-20 07:35:27.372: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:27.411: W/GooglePlayServicesUtil(1811): Google Play services out of date. Requires 4242000 but found 3136130
02-20 07:35:27.502: I/Choreographer(1811): Skipped 87 frames! The application may be doing too much work on its main thread.
02-20 07:35:27.771: I/Choreographer(1811): Skipped 99 frames! The application may be doing too much work on its main thread.
02-20 07:35:29.351: I/Choreographer(1811): Skipped 30 frames! The application may be doing too much work on its main thread.
02-20 07:35:30.241: D/AndroidRuntime(1811): Shutting down VM
02-20 07:35:30.251: W/dalvikvm(1811): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
02-20 07:35:30.271: E/AndroidRuntime(1811): FATAL EXCEPTION: main
02-20 07:35:30.271: E/AndroidRuntime(1811): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.google.android.gms flg=0x80000 pkg=com.android.vending }
02-20 07:35:30.271: E/AndroidRuntime(1811): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1622)
02-20 07:35:30.271: E/AndroidRuntime(1811): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1417)
02-20 07:35:30.271: E/AndroidRuntime(1811): at android.app.Activity.startActivityForResult(Activity.java:3370)
02-20 07:35:30.271: E/AndroidRuntime(1811): at android.app.Activity.startActivityForResult(Activity.java:3331)
02-20 07:35:30.271: E/AndroidRuntime(1811): at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:839)
02-20 07:35:30.271: E/AndroidRuntime(1811): at android.app.Activity.startActivity(Activity.java:3566)
02-20 07:35:30.271: E/AndroidRuntime(1811): at android.app.Activity.startActivity(Activity.java:3534)
02-20 07:35:30.271: E/AndroidRuntime(1811): at com.google.android.gms.dynamic.a$5.onClick(Unknown Source)
02-20 07:35:30.271: E/AndroidRuntime(1811): at android.view.View.performClick(View.java:4204)
02-20 07:35:30.271: E/AndroidRuntime(1811): at android.view.View$PerformClick.run(View.java:17355)
02-20 07:35:30.271: E/AndroidRuntime(1811): at android.os.Handler.handleCallback(Handler.java:725)
02-20 07:35:30.271: E/AndroidRuntime(1811): at android.os.Handler.dispatchMessage(Handler.java:92)
02-20 07:35:30.271: E/AndroidRuntime(1811): at android.os.Looper.loop(Looper.java:137)
02-20 07:35:30.271: E/AndroidRuntime(1811): at android.app.ActivityThread.main(ActivityThread.java:5041)
02-20 07:35:30.271: E/AndroidRuntime(1811): at java.lang.reflect.Method.invokeNative(Native Method)
02-20 07:35:30.271: E/AndroidRuntime(1811): at java.lang.reflect.Method.invoke(Method.java:511)
02-20 07:35:30.271: E/AndroidRuntime(1811): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-20 07:35:30.271: E/AndroidRuntime(1811): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-20 07:35:30.271: E/AndroidRuntime(1811): at dalvik.system.NativeStart.main(Native Method)
02-20 07:35:33.941: D/dalvikvm(1825): GC_CONCURRENT freed 250K, 14% free 2589K/2984K, paused 74ms+4ms, total 156ms
02-20 07:35:34.101: I/Choreographer(1825): Skipped 127 frames! The application may be doing too much work on its main thread.
02-20 07:35:34.111: D/gralloc_goldfish(1825): Emulator without GPU emulation detected.
02-20 07:35:34.373: I/Choreographer(1825): Skipped 213 frames! The application may be doing too much work on its main thread.
02-20 07:35:35.283: I/Choreographer(1825): Skipped 88 frames! The application may be doing too much work on its main thread.
02-20 07:35:36.031: I/Choreographer(1825): Skipped 92 frames! The application may be doing too much work on its main thread.
02-20 07:35:36.081: I/Choreographer(1825): Skipped 43 frames! The application may be doing too much work on its main thread.
02-20 07:35:36.191: I/Choreographer(1825): Skipped 32 frames! The application may be doing too much work on its main thread.
02-20 07:35:36.281: I/Choreographer(1825): Skipped 36 frames! The application may be doing too much work on its main thread.
02-20 07:35:36.684: I/Choreographer(1825): Skipped 88 frames! The application may be doing too much work on its main thread.
02-20 07:35:36.831: I/Choreographer(1825): Skipped 98 frames! The application may be doing too much work on its main thread.
Either your api key has been generated using a SHA1 fingerprint , which has not been generated from your computer i.e a fingerprint mismatch is occuring.
Or you are providing a wrong api key.
Also update your Google Play Services in sdk.
You cannot emulate google maps on the emulator you just need a real device for working with maps, since adt emulator don't have google play services installed, just make sure google services are updated your api key is not wrong and go test your app on a real device , however this must be known I searched and found this Link go see it they describe how you car run the Google Maps in the emulator.
I have updated my answer and showed my code it is little different from yours but may it help you
public class MainActivity extends FragmentActivity {
private static final int GPS_ERRORDIALOG_REQUEST = 9001;
GoogleMap mMap;
MapView mMapView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (servicesOK()) {
Toast.makeText(this, "Ready to map!", Toast.LENGTH_SHORT).show();
setContentView(R.layout.activity_mapview);
// 1- get reference to MapView
mMapView = (MapView)findViewById(R.id.map);
// 2- MapView has the same life cycles as the Activity
mMapView.onCreate(savedInstanceState);
}else {
setContentView(R.layout.activity_main);
}
}
#Override
protected void onDestroy() {
super.onDestroy();
mMapView.onDestroy();
}
#Override
protected void onPause() {
super.onPause();
mMapView.onPause();
}
#Override
protected void onResume() {
super.onResume();
mMapView.onResume();
}
#Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
mMapView.onSaveInstanceState(outState);
}
#Override
protected void onStart() {
super.onStart();
}
#Override
protected void onStop() {
super.onStop();
}
#Override
public void onLowMemory() {
super.onLowMemory();
mMapView.onLowMemory();
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
/**
* Test and check if Google Play Services is available
* #return boolean
*/
public boolean servicesOK() {
int isAvailable = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if (isAvailable == ConnectionResult.SUCCESS) {
return true;
}
else if (GooglePlayServicesUtil.isUserRecoverableError(isAvailable)) {
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(isAvailable, this, GPS_ERRORDIALOG_REQUEST);
dialog.show();
}
else {
Toast.makeText(this, "Can't connect to Google Play services", Toast.LENGTH_SHORT).show();
}
return false;
}
}
activity_mapview.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Adds a mapView to the layout -->
<com.google.android.gms.maps.MapView
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.google.android.gms.maps.MapView>
manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="com.example.gmapsapp.permission.MAPS_RECEIVE"/>
<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-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.gmapsapp.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="YOUR_API_KEY_IS_NOT_PUBLIC"/>
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
see the following link too here
from ur logcat I see
02-20 07:35:30.271: E/AndroidRuntime(1811):
android.content.ActivityNotFoundException: No Activity found to handle
Intent { act=android.intent.action.VIEW dat=market://details?
Actually, the problem relates to Gingerbread and older phones using the wrong URI if they don't already have the Play Store installed. This isn't a safe assumption. Most out-of-the-box Gingerbread phones don't come with it, and Google updates don't necessarily install it. See the discussion
https://code.google.com/p/android/issues/detail?id=42543
U can get answer for this link
Try replacing fill_parent with match_parent in your layout, fill_parent has been deprecated after android 2.2 Also, try regenerating the api key.
what device are you testing on?
Think the problem Is SHA1 Key ,
1.Get The API Key And Update it your google_maps_api.xml file.
https://developers.google.com/maps/documentation/android-api/start#step_4_get_a_google_maps_api_key
2.Generate Sha1
>Open Android Studio.
>Open Your Project.
>Click on Gradle (From Right Side Panel, you will see Gradle Bar)
>Click on Refresh (Click on Refresh from Gradle Bar , you will see List
Gradle scripts of your Project)
>Click on Your Project (Your Project Name form List(root))
>Click on Tasks
>Click on android
>Double Click on signingReport (You will get SHA1 and MD5 in Run Bar)
How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?
clean project
in android studio
menu > build > clean project
4.Run application on your phone or emulator
I have added AdMob banner into my application according to a how-to. But banner is never shown, i have made this the same way i did with another app and everything works perfectly. Cannot find a solution, checked all the related Stack questions, nothing works:(
I use a correct publisher id and i have added GoogleAdMobAdsSdk-6.4.1.jar
My xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/background"
android:orientation="vertical"
tools:context=".MainActivity" >
<ListView
android:id="#+id/list"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_gravity="center_vertical"
android:layout_weight="0.80" >
</ListView>
<com.google.ads.AdView android:id="#+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adUnitId="pub_id"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"/>
</LinearLayout>
My manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.luckyyou.greatlaces"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.luckyyou.greatlaces.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.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize| smallestScreenSize"/>
<activity
android:name="com.luckyyou.greatlaces.tab1"
android:label="#string/name1"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"> </activity>
...
<activity
android:name="com.luckyyou.greatlaces.tab12"
android:label="#string/name12"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait">
</activity>
</application>
</manifest>
Here what LogCat says:
01-08 14:21:52.778: DEBUG/dalvikvm(1804): GC_EXTERNAL_ALLOC freed 52K, 51% free 2674K/5379K, external 1527K/1559K, paused 242ms
01-08 14:21:55.431: ERROR/ActivityThread(1804): Failed to find provider info for com.google.plus.platform
01-08 14:21:55.518: INFO/Ads(1804): To get test ads on this device, call adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
01-08 14:21:55.858: DEBUG/dalvikvm(1804): DexOpt: --- BEGIN 'ads-143252855.jar' (bootstrap=0) ---
01-08 14:21:56.198: DEBUG/dalvikvm(1818): DexOpt: load 64ms, verify+opt 75ms
01-08 14:21:56.378: DEBUG/dalvikvm(1804): DexOpt: --- END 'ads-143252855.jar' (success) ---
01-08 14:21:56.378: DEBUG/dalvikvm(1804): DEX prep '/data/data/com.luckyyou.greatlaces/cache/ads-143252855.jar': unzip in 34ms, rewrite 520ms
01-08 14:21:56.378: DEBUG/dalvikvm(1804): GC_EXTERNAL_ALLOC freed 217K, 50% free 2876K/5639K, external 2151K/2316K, paused 140ms
01-08 14:21:56.388: DEBUG/webviewglue(1804): nativeDestroy view: 0x91621b8
01-08 14:21:56.748: INFO/Ads(1804): adRequestUrlHtml: <html><head><script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_getSdkConstants();AFMA_buildAdURL({"preqs":0,"session_id":"9030672260837145206","seq_num":"1","slotname":"pub_id","u_w":320,"msid":"com.luckyyou.greatlaces","cap":"m,a","js":"afma-sdk-a-v6.4.1","bas_off":0,"net":"ed","app_name":"1.android.com.luckyyou.greatlaces","hl":"en","gnt":3,"carrier":"310260","u_audio":4,"kw":[],"u_sd":1.5,"simulator":1,"ms":"aESYziECsoJ_gzwNWoDn5OQjNPknVakDj2SrrKXxrOZsEWD6r4wsETa7CzeB3sCAwMmoFdWVd-PB3S-s381WQrdDEK_k05alE8tfJmkHWXNzJkS-Xql-6WqEEAgBc0-8cSp08YlmRv0xjgqH5yKehnOHMtOonYftI2DXsmFuMAwdjIOmWmCYaT7BjDQDlUzULzTvZRe6EvgSgalmiK-4Wfem4vJyo-QXzVRVG5Ng0WRcCebjE0LIulSyCsQyngqLWg2VhqUfHzGfiru4NxSUYV3GvxksLLXeShEv8X00-c629-Loha16sjyWYc0ecQ9gerTls_FvObQwTYyTb3jqRg","isu":"B3EEABB8EE11C2BE770B684D95219ECB","format":"320x50_mb","oar":0,"ad_pos":{"height":0,"visible":0,"y":76,"x":0,"width":0},"u_h":533,"pt":1,"bas_on":0,"ptime":0});</script></head><body></body></html>
01-08 14:21:56.918: DEBUG/dalvikvm(1804): GC_EXTERNAL_ALLOC freed 128K, 49% free 2886K/5639K, external 2438K/3005K, paused 108ms
01-08 14:21:57.550: DEBUG/dalvikvm(1804): GC_EXTERNAL_ALLOC freed <1K, 49% free 2885K/5639K, external 4395K/5489K, paused 126ms
01-08 14:21:58.507: DEBUG/gralloc_goldfish(1804): Emulator without GPU emulation detected.
01-08 14:21:59.218: INFO/ActivityManager(858): Displayed com.luckyyou.greatlaces/.MainActivity: +7s494ms
01-08 14:22:00.818: WARN/webcore(1804): Can't get the viewWidth after the first layout
01-08 14:22:00.998: WARN/Ads(1804): Invalid unknown request error: Cannot determine request type. Is your ad unit id correct?
01-08 14:22:00.998: DEBUG/webviewglue(1804): nativeDestroy view: 0x915dbd0
01-08 14:22:01.008: INFO/Ads(1804): onFailedToReceiveAd(Invalid Ad request.)
01-08 14:22:05.238: DEBUG/dalvikvm(1131): GC_EXPLICIT freed 9K, 52% free 2662K/5511K, external 1527K/1559K, paused 149ms
These look to be the relevant lines in the log.
Since your layout looks OK I suspect that you have do something funky in the theme you have applied for the application that is causing confusion with the view width. Review your #style/AppTheme config.
01-08 14:22:00.818: WARN/webcore(1804): Can't get the viewWidth after the first layout
01-08 14:22:00.998: WARN/Ads(1804): Invalid unknown request error: Cannot determine request type. Is your ad unit id correct?
The final thing: You said you are using Admob-6.4.1. Are you also using thge GooglePlayServices library? If so you might have inadvertently used some of the Admob classes from GPS. If this is the case then I suggest removing Admob-6.4.1 and going 100% with GPS.
I am tring to implement google maps using the new google maps api v2 and for some reason i don't see a map.
I think that the problem is those two lines of error when i run it on the emulator:
E/ActivityThread( 1373): Failed to find provider info for com.google.settings
E/ActivityThread( 1373): Failed to find provider info for com.google.android.gsf
.gservices
when i run the application on the device the following error is produced:
Could not find class 'maps.j.k', referenced from method map.y.ae.a
My problem looks the same as in this link: http://android-er.blogspot.co.il/2012/12/google-maps-android-api-v2-with-blank.html
There it's says that the problem may be my key so i went and reproduced it using the following tutorial: http://android-er.blogspot.co.il/2012/12/displaying-sha1-certificate-fingerprint.html. but this still didn't helped me.
the support files are of course add to the project as well as the Google play services lib.
I see the same result on the emulator (after adding manually the two file that allow using the google map v2 on the emulator) as well as on the motorola Defy running android 2.2.
Maybe I am using the wrong debug.keystore? I am using the one in my User.android folder.If so then how do i find the right file?
EDIT: My eclipse says that my debug key is in the default folder. So i renamed the debug.keystore file and ran the Eclipse to recreate it all over again. That resulted in producing a new SHA1 key. I used it to create a new Google Maps API v2 key but the result is still the same. I'm still unable to see the map.
EDIT2: Stupid me, I chose Google Map API V2 instead of Google Maps Android API V2.
This question can be closed. Thanks.
Here are all the code files:
xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<fragment
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
map:cameraBearing="112.5"
map:cameraTargetLat="-33.796923"
map:cameraTargetLng="150.922433"
map:cameraTilt="30"
map:cameraZoom="13"
map:mapType="normal"
map:uiCompass="false"
map:uiRotateGestures="true"
map:uiScrollGestures="false"
map:uiTiltGestures="true"
map:uiZoomGestures="true" />
</LinearLayout>
Map Fragmentactivity class:
package com.eadesign.skygiraffefinalv2;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.maps.GoogleMap;
import android.os.Bundle;
import com.google.android.gms.maps.*;
import android.widget.ImageView;
import android.widget.TextView;
public class Map extends android.support.v4.app.FragmentActivity
{
private GoogleMap map;
#Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
if (GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()) == 0)
{
map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
// map.setMapType(GoogleMap.MAP_TYPE_HYBRID);
}
}}
manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.eadesign.skygiraffefinalv2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17"/>
<permission android:name="com.eadesign.skygiraffefinalv2.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.eadesign.skygiraffefinalv2.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-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/sgicon90"
android:label="#string/app_name"
android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen">
<activity
android:name=".Map"
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="My key"/>
</application>
log from logcat:
ent.category.LAUNCHER] flg=0x10000000 cmp=com.eadesign.skygiraffefinalv2/.Map u=
0} from pid 1362
W/WindowManager( 148): Failure taking screenshot for (246x410) to layer 21010
D/AndroidRuntime( 1362): Shutting down VM
I/ActivityManager( 148): Start proc com.eadesign.skygiraffefinalv2 for activity
com.eadesign.skygiraffefinalv2/.Map: pid=1373 uid=10046 gids={3003, 1015, 1028}
D/dalvikvm( 1373): Not late-enabling CheckJNI (already on)
D/dalvikvm( 1362): GC_CONCURRENT freed 99K, 77% free 483K/2048K, paused 1ms+1ms,
total 13ms
D/jdwp ( 1362): Got wake-up signal, bailing out of select
D/dalvikvm( 1362): Debugger has detached; object registry had 1 entries
E/jdwp ( 1373): Failed sending reply to debugger: Broken pipe
D/dalvikvm( 1373): Debugger has detached; object registry had 2 entries
E/Trace ( 1373): error opening trace file: No such file or directory (2)
D/dalvikvm( 1373): GC_CONCURRENT freed 204K, 3% free 8264K/8519K, paused 89ms+6m
s, total 161ms
D/dalvikvm( 1373): WAIT_FOR_CONCURRENT_GC blocked 33ms
E/ActivityThread( 1373): Failed to find provider info for com.google.settings
E/ActivityThread( 1373): Failed to find provider info for com.google.settings
D/dalvikvm( 1373): GC_CONCURRENT freed 312K, 5% free 8471K/8839K, paused 82ms+10
5ms, total 268ms
E/ActivityThread( 1373): Failed to find provider info for com.google.android.gsf
.gservices
E/ActivityThread( 1373): Failed to find provider info for com.google.android.gsf
.gservices
D/dalvikvm( 1373): GC_CONCURRENT freed 227K, 4% free 8797K/9095K, paused 91ms+11
0ms, total 300ms
D/libEGL ( 1373): Emulator without GPU support detected. Fallback to software r
enderer.
I/Choreographer( 1373): Skipped 54 frames! The application may be doing too muc
h work on its main thread.
D/gralloc_goldfish( 1373): Emulator without GPU emulation detected.
D/libEGL ( 1373): loaded /system/lib/egl/libGLES_android.so
I/ActivityManager( 148): Displayed com.eadesign.skygiraffefinalv2/.Map: +3s545ms
I/Choreographer( 1373): Skipped 75 frames! The application may be doing too muc
h work on its main thread.
In my case I chose Google Maps API V2 instead of Google Maps Android API V2. After changing that the problem was gone. So this code is perfectly fine to create a full screen Google map and the question can be closed.
Thanks.
I am testing the sample google code on an actual device having 2.3.6.I thought it might be the problem with the key ,so I created different key on a different account through Google's API Console.Still the same problem "Google Maps Android API-Authorization Failure".
Here is the log:
12-07 10:31:30.476: D/dalvikvm(17791): DexOpt: couldn't find field Landroid/content/res/Configuration;.smallestScreenWidthDp
12-07 10:31:30.484: W/dalvikvm(17791): VFY: unable to resolve instance field 24
12-07 10:31:30.484: D/dalvikvm(17791): VFY: replacing opcode 0x52 at 0x0012
12-07 10:31:30.484: D/dalvikvm(17791): VFY: dead code 0x0014-0018 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b (Landroid/content/res/Resources;)Z
12-07 10:31:30.718: D/dalvikvm(17791): GC_CONCURRENT freed 197K, 46% free 3063K/5639K, external 408K/517K, paused 3ms+4ms
12-07 10:31:30.789: W/dalvikvm(17791): Unable to resolve superclass of Lmaps/a/du; (411)
12-07 10:31:30.789: W/dalvikvm(17791): Link of class 'Lmaps/a/du;' failed
12-07 10:31:30.789: W/dalvikvm(17791): Unable to resolve superclass of Lmaps/a/ej; (2363)
12-07 10:31:30.789: W/dalvikvm(17791): Link of class 'Lmaps/a/ej;' failed
12-07 10:31:30.789: W/dalvikvm(17791): Unable to resolve superclass of Lmaps/j/k; (2379)
12-07 10:31:30.789: W/dalvikvm(17791): Link of class 'Lmaps/j/k;' failed
12-07 10:31:30.789: E/dalvikvm(17791): Could not find class 'maps.j.k', referenced from method maps.y.ae.a
12-07 10:31:30.789: W/dalvikvm(17791): VFY: unable to resolve new-instance 3571 (Lmaps/j/k;) in Lmaps/y/ae;
12-07 10:31:30.789: D/dalvikvm(17791): VFY: replacing opcode 0x22 at 0x007d
12-07 10:31:30.820: D/dalvikvm(17791): VFY: dead code 0x007f-008f in Lmaps/y/ae;.a (Landroid/view/LayoutInflater;Lcom/google/android/gms/maps/GoogleMapOptions;Z)Lmaps/y/ae;
12-07 10:31:31.281: D/dalvikvm(17791): GC_CONCURRENT freed 297K, 46% free 3222K/5959K, external 408K/517K, paused 3ms+4ms
12-07 10:31:31.523: D/dalvikvm(17791): GC_EXTERNAL_ALLOC freed 227K, 45% free 3397K/6087K, external 431K/517K, paused 52ms
12-07 10:31:31.648: I/System.out(17791): 0
12-07 10:31:31.734: D/dalvikvm(17791): GC_CONCURRENT freed 188K, 43% free 3531K/6151K, external 544K/1029K, paused 5ms+4ms
12-07 10:31:32.125: D/libEGL(17791): loaded /system/lib/egl/libGLES_hgl.so
12-07 10:31:32.132: D/BRCM_EGL(17791): eglCreateContext() context: 0xd7090, VC context 1, Thread 17810
12-07 10:31:32.148: D/BRCM_EGL(17791): eglCreateWindowSurface() surface: 0xd70d0, VC surface: 1, Thread: 17810
12-07 10:31:32.148: D/BRCM_EGL(17791): eglMakeCurrent(0xd7090, 0xd70d0, 0xd70d0) Thread: 17810
12-07 10:31:32.859: E/Google Maps Android API(17791): Authorization failure.
Here's is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.smartapps4u.googlemapslib"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<permission
android:name="com.smartapps4u.googlemapslib.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.smartapps4u.googlemapslib.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<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-library android:name="com.google.android.maps" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="My API key"/>
<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>
</application>
</manifest>
Any help would be appreciated.
Solved it.Very stupid mistake on my part.Used wrong api key.Was using the api key for the signed app.Replaced it with api key for debug keystore and solved the problem.
Had the same problem and #Sunkenglory 's answer is right, just to add some info for newbies like myself when I was looking for a solution.
On mac osX, my debug keystore was located here:
~/.android/debug.keystore
Go to that folder and run the following
keytool -list -v -keystore debug.keystore
That gave me the correct sha1 that I entered in the google console, and now it works.