Admob integration with cocos2d-x 2.0.3 in android plataform


#1

Hi,
I use the HelloCpp example and try to show an admob ad inside it.

I use the following code in my onCreate method inside HelloCpp class:

                runOnUiThread(new Runnable() {

            @Override
            public void run() {

                LinearLayout.LayoutParams adParams = new LinearLayout.LayoutParams(
                        LinearLayout.LayoutParams.WRAP_CONTENT,
                        LinearLayout.LayoutParams.WRAP_CONTENT);

                adView = new AdView(HelloCpp.this, AdSize.BANNER, "a150b62207a5a96");
                adView.setAdListener(HelloCpp.this);

                // adView.loadAd(new AdRequest());
                AdRequest request = new AdRequest();
                adView.loadAd(request); 
                addContentView(adView, adParams);
            }
        });

The ad shows correctly, but when I click on it , i receive the following error

Fatal signal 11 (SIGSEGV) at 0x00000124 (code=1)

Any idea what is wrong with that?


#2

My admob code work perfectly.

The problem is that I create a method to pause my game, is that method that make my game crash, not admob code.