luisba313
Android Fan
Profile
Posts: 201
Reg: Jul 11, 2011
Spain
3,810
08/26/12 04:13 PM (13 years ago)

Force close when adding Admob in Eclipse...

Hello first of all, im using v1.5 android and I have updated all the new android SDK packages today. I add all the things I have to add to put Admob, but when i add the last thing in the act_base.xml, and i open emulator, i get force close. this: <com.google.ads.AdView android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" ads:adUnitId="xxxxxxxxxxx" ads:adSize="BANNER" ads:loadAdOnCreate="true"/> the new admob .jar file is the version 6.1.0 and I changed too the project build tarjet to GOOGLE API 15. I know that is the problem because this time i only added that code and the force close comes with that. please help? im very confused. THANKS A LOT.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
08/26/12 09:30 PM (13 years ago)
Target your app to Google API Level 13. Did you add this following line in the act_base.xml file after <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" ? xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" Also did you add this following line in AndroidManifest.xml before the closing application tag? <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
 
luisba313
Android Fan
Profile
Posts: 201
Reg: Jul 11, 2011
Spain
3,810
like
08/27/12 02:09 AM (13 years ago)
As I said, I already added that. and in the graphical banner of the the act_base.xml it says: com.googleads.AdView (it does not say "ads by Google, which indicates its all done) any idea?
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
08/27/12 04:16 AM (13 years ago)
Actually i have implemented admob recently and i too use admob version 6.1.0 sdk which works fine with me so i think its not the case. I have set up ads in the screen_customhtml.xml, screen_htmlDoc.xml, screen_webview.xml and screen_quiz.xml but i never tried setting up in act_base.xml. Dont know what exactly you are missing here.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
08/27/12 04:34 AM (13 years ago)
I use admob like @Sandeep, putting it into seperate screens. Can never get it to work by putting it in the activity base.
 
luisba313
Android Fan
Profile
Posts: 201
Reg: Jul 11, 2011
Spain
3,810
like
08/27/12 04:35 AM (13 years ago)
I tried too in the "screen_menulist.xml", and the force close always comes when I add that code: <com.google.ads.AdView android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" ads:adUnitId="xxxxxxxxxxx" ads:adSize="BANNER" ads:loadAdOnCreate="true"/> Plus, the console gives no error..the logcat yes, but i dont understand logcat
 
luisba313
Android Fan
Profile
Posts: 201
Reg: Jul 11, 2011
Spain
3,810
like
08/27/12 06:18 AM (13 years ago)
help?
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
08/29/12 08:22 AM (13 years ago)
Have you selected the ads to show on your screens in Buzztouch control panel, for each of the screens you have created in your project?
 
AlmaR
Lost but trying
Profile
Posts: 73
Reg: Jun 13, 2011
location unknow...
5,630
like
04/06/13 03:12 PM (12 years ago)
Try this: Create a libs/ folder in your project and physically put the Admob SDK in the project OR in the Java Build Path, you must Order and Export the SDK jar. Otherwise, the jar doesn't get included when your apk gets compiled, and all hell breaks loose when you run AdMob code at runtime.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.