Cannot integrate AdMob in my Project

62 views
Skip to first unread message

Lukas

unread,
Mar 7, 2014, 5:53:39 PM3/7/14
to google-adm...@googlegroups.com
Hello,

I want to add an ad with AdMob but there are two problems when I want to import.
1. Everytime I finished my import line in the editor, the line just disappears. Nothing is said, it simply disappears.
2. The "com.google.android.gms.ads.*" statement is not available. When I'm typing in "com.google.android." it doesn't give me the option "gms".

Can anyone help me with the problems?

Lukas

unread,
Mar 7, 2014, 6:21:30 PM3/7/14
to google-adm...@googlegroups.com


Am Freitag, 7. März 2014 23:53:39 UTC+1 schrieb Lukas:
Hello,

I want to add an ad with AdMob but there are two problems when I want to import.
1. Everytime I finished my import line in the editor, the line just disappears. I get the following error in the event log: Access is allowed from event dispatch thread only.
         Details: Current thread: Thread[JobScheduler FJ pool 5/8,6,main] 1703161454
         Our dispatch thread:Thread[AWT-EventQueue-0 0.5.0#AI-134.1058404, eap:true,6,main] 357586160
         SystemEventQueueThread: Thread[AWT-EventQueue-0 0.5.0#AI-134.1058404, eap:true,6,main] 357586160

Eric Leichtenschlag

unread,
Mar 7, 2014, 9:52:40 PM3/7/14
to google-adm...@googlegroups.com
Check out the setup documentation: https://developers.google.com/mobile-ads-sdk/docs/

You'll need to add a reference to the Google Play services library project.

Thanks,
Eric

Lukas

unread,
Mar 8, 2014, 3:30:24 AM3/8/14
to google-adm...@googlegroups.com
Thanks for the answer. I already added a reference, but it only worked after restarting Android Studio. So this problem is solved. But there's still the problem that I can't import anything. Everytime I finished my "import line" it just disappears and I get the following error: Access is allowed from event dispatch thread only.

         Details: Current thread: Thread[JobScheduler FJ pool 5/8,6,main] 1703161454
         Our dispatch thread:Thread[AWT-EventQueue-0 0.5.0#AI-134.1058404, eap:true,6,main] 357586160
         SystemEventQueueThread: Thread[AWT-EventQueue-0 0.5.0#AI-134.1058404, eap:true,6,main] 357586160

I really get this error when I want to import anything and not only when I'm importing "com.google.android.gms.ads.*"
Is there any solution for this problem?

Thank you

William Ferguson

unread,
Mar 8, 2014, 10:11:38 AM3/8/14
to google-adm...@googlegroups.com
Lukas, what editor are you using?

That sounds like a really strange error. You are adding an import statement at the top of a Java class, and when you press enter your import line disappears?

The access is allowed from event dispatch thread message sounds like a runtime error, not compile time. Are you getting this when you attempt to run your app?


William
Reply all
Reply to author
Forward
0 new messages