我在Play商店有一个应用程序。除三星Galaxy S4外,它适用于所有设备。该应用程序是使用LibGDX构建的。用户抱怨它在启动时崩溃。任何人都可以告诉我解决问题的方向是什么?这是代码:
public class AndroidLauncher extends AndroidApplication implements IActivityRequestHandler {
AdView adView;
int other=-1;
private final int BIG_ADS = 2;
private final int SHOW_ADS = 1;
private final int HIDE_ADS = 0;
protected Handler handler = new Handler()
{
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case SHOW_ADS:
{
adView.setVisibility(View.VISIBLE);
break;
}
case HIDE_ADS:
{
adView.setVisibility(View.GONE);
break;
}
default:
{
show();
}
}
}
};
public void show()
{
other++;
if(other==1)
{
AdBuddiz.showAd(this);
other=-1;
}
}
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AdBuddiz.setPublisherKey("Secret");
AdBuddiz.cacheAds(this);
// Create the layout
RelativeLayout layout = new RelativeLayout(this);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
// Do the stuff that initialize() would do for you
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
// Create the libgdx View
View gameView = initializeForView(new AntiBully(this), config);
// Create and setup the AdMob view
adView = new AdView(this);
adView.setAdUnitId("Secret");
adView.setAdSize(AdSize.BANNER);
adView.loadAd(new AdRequest.Builder()
.build());
// Add the libgdx view
layout.addView(gameView);
// Add the AdMob view
RelativeLayout.LayoutParams adParams =
new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
adParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
adParams.addRule(RelativeLayout.CENTER_IN_PARENT);
layout.addView(adView, adParams);
// Hook it all up
setContentView(layout);
}
// This is the callback that posts a message for the handler
public void showAds(int show) {
handler.sendEmptyMessage(show);
}
public AndroidApplication returnThis()
{
return this;
}
}
这是堆栈跟踪:
Build fingerprint: 'samsung/trltespr/trltespr:5.0.1/LRX22C/N910PVPU3BOF5:user/release-keys'
Revision: '12'
ABI: 'arm'
pid: 17354, tid: 17374, name: GLThread 2400 >>> com.mygdx.highjumper.android <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
r0 00000000 r1 000043de r2 00000006 r3 00000000
r4 af6f2db8 r5 00000006 r6 00000016 r7 0000010c
r8 a22b0140 r9 00000000 sl 00000001 fp a2265de0
ip 000043de sp af6f2820 lr b6f42fe1 pc b6f66980 cpsr 60070010
backtrace:
#00 pc 00037980 /system/lib/libc.so (tgkill+12)
#01 pc 00013fdd /system/lib/libc.so (pthread_kill+52)
#02 pc 00014bfb /system/lib/libc.so (raise+10)
#03 pc 00011541 /system/lib/libc.so (__libc_android_abort+36)
#04 pc 0000fccc /system/lib/libc.so (abort+4)
#05 pc 00001259 /system/lib/libstdc++.so
#06 pc 00000afb /system/lib/libstdc++.so (__cxa_pure_virtual+6)
#07 pc 000e4595 /system/vendor/lib/egl/libGLESv2_adreno.so (EsxGlObject::DecRefCount(EsxContext*)+28)
#08 pc 000b4b67 /system/vendor/lib/egl/libGLESv2_adreno.so (EsxContext::GlUseProgram(unsigned int)+150)
#09 pc 000e02d3 /system/vendor/lib/egl/libGLESv2_adreno.so (EsxGlApiParamValidate::GlUseProgram(EsxDispatch*, unsigned int)+34)
#10 pc 000abd75 /system/vendor/lib/egl/libGLESv2_adreno.so (glUseProgram+44)
#11 pc 0031ff8f /data/dalvik-cache/arm/data@app@com.mygdx.highjumper.android-1@base.apk@classes.dex
谢谢,
Isaiah Thompson