我是andengine的新手,我的游戏应用程序工作正常,没有admob代码。当我添加admob代码,在模拟器上工作,但显示应用程序在其主线程上做了太多工作。但同样的应用程序在移动设备上崩溃了。我不应该做什么,我花了将近一个星期的时间,但无法解决它。请帮帮我。
我的清单文件: 机器人:名字= “com.google.ads.AdActivity” 机器人:configChanges = “键盘| keyboardHidden |取向|屏幕布置| uiMode |屏幕尺寸| smallestScreenSize”/>
基本游戏中的:
公共类GameActivity扩展了BaseGameActivity
{
protected void onSetContentView() {
this.mRenderSurfaceView = new RenderSurfaceView(this);
this.mRenderSurfaceView.setRenderer(this.mEngine, this);
final android.widget.FrameLayout.LayoutParams surfaceViewLayoutParams = new FrameLayout.LayoutParams(super.createSurfaceViewLayoutParams());
//Creating the banner view.
AdView adView = new AdView(this, AdSize.BANNER, "AdMobPubId");
adView.loadAd(new AdRequest());
final FrameLayout.LayoutParams adViewLayoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.RIGHT | Gravity.CENTER_HORIZONTAL);
final FrameLayout frameLayout = new FrameLayout(this);
final FrameLayout.LayoutParams frameLayoutLayoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.FILL_PARENT);
frameLayout.addView(this.mRenderSurfaceView,surfaceViewLayoutParams);
frameLayout.addView(adView,adViewLayoutParams);
this.setContentView(frameLayout, frameLayoutLayoutParams);
}
logcat文件:
01-12 14:46:49.320: D/AndEngine(949): GameActivity.onResumeGame @(Thread: 'main')
01-12 14:46:49.320: I/Choreographer(949): Skipped 58 frames! The application may be doing too much work on its main thread.
01-12 14:46:49.600: D/dalvikvm(949): GC_EXPLICIT freed 478K, 15% free 4403K/5176K, paused 5ms+18ms, total 463ms
01-12 14:46:50.740: D/dalvikvm(949): GC_FOR_ALLOC freed 37K, 15% free 4416K/5176K, paused 86ms, total 97ms
01-12 14:46:50.760: I/dalvikvm-heap(949): Grow heap (frag case) to 5.900MB for 1536016-byte allocation
01-12 14:46:50.920: D/dalvikvm(949): GC_FOR_ALLOC freed <1K, 12% free 5916K/6680K, paused 86ms, total 86ms
01-12 14:46:51.230: D/dalvikvm(949): GC_FOR_ALLOC freed 1K, 12% free 5915K/6680K, paused 98ms, total 98ms
01-12 14:46:51.350: I/dalvikvm-heap(949): Grow heap (frag case) to 7.363MB for 1536016-byte allocation
01-12 14:47:38.840: I/Ads(949): onReceiveAd()
01-12 14:47:39.230: E/eglCodecCommon(949): glUtilsParamSize: unknow param 0x00000b44
01-12 14:47:39.250: E/eglCodecCommon(949): glUtilsParamSize: unknow param 0x00000bd0
01-12 14:47:39.600: I/chromium(949): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
01-12 14:47:40.120: I/chromium(949): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
01-12 14:47:40.280: E/eglCodecCommon(949): **** ERROR unknown type 0x0 (glSizeof,72)
01-12 14:47:40.490: E/eglCodecCommon(949): glUtilsParamSize: unknow param 0x00000b44
01-12 14:47:40.490: E/eglCodecCommon(949): glUtilsParamSize: unknow param 0x00000bd0
01-12 14:47:40.560: E/eglCodecCommon(949): **** ERROR unknown type 0x0 (glSizeof,72)
01-12 14:47:40.820: E/eglCodecCommon(949): glUtilsParamSize: unknow param 0x00000b44