Could not find class error in logcat during runtime

75 views
Skip to first unread message

L Nigogosian

unread,
Aug 14, 2014, 1:54:33 PM8/14/14
to google-adm...@googlegroups.com
I am using the Eclipse/Android development system with Android at the latest issue. I loaded down the Interstitial sample program from your site and linked it to Google-play-services_lib. The code compiles but I am getting a runtime error as shown below when I run in debug and stop the program at "InterstitialAd= new InterstitialAd(this)" and then step through the program.

It seems that at runtime the import classes associated with the library are not available. I have followed your instructions and the Android instructions. 

My plan is to get this working with your sample and then adding it section by section to my app.  

I have the application ready for the market but this is hindering me in a big way.  


Eric Leichtenschlag

unread,
Aug 15, 2014, 5:14:17 PM8/15/14
to google-adm...@googlegroups.com
Hmm, that error probably means the google play services library isn't getting included in your build.

Are you referencing Google Play services as a library project? You could double check that by checking if there is an "android.library.reference" to Google Play services in your project.properties file.

L Nigogosian

unread,
Aug 19, 2014, 10:08:10 AM8/19/14
to google-adm...@googlegroups.com
Yes googleplay services library is referenced and I get no compile time errors. My problem is during run time. One of the paths must be missing. Any ideas as to what these should be and how can I set them? Cleaning the project does not help. 
Levon

Eric Leichtenschlag

unread,
Aug 19, 2014, 8:33:54 PM8/19/14
to google-adm...@googlegroups.com
Could you zip up your project and send it over? At this point, the best way to advise is to see the problem in action.

Thanks,
Eric

L Nigogosian

unread,
Aug 20, 2014, 12:54:51 PM8/20/14
to google-adm...@googlegroups.com
Thank you for your effort to sort this out for me. I have attached the workspace where I have the two projects. If you launch and it doesn't work and the console shows that the interstitial.apk file is missing then go to the Properties window of the interstitial project and untick the "is library" box select "Apply" and then OK. Relaunch and a lot of gumf is shown by the console. Go back to properties and tick the box again and then OK. Relaunch and the code will run now but the device will show pane "the application interstitial has stopped unexpectedly etc. ". Such are the ways of Android. 

If you run in debug mode and stop at the line "interstitialAd= new InterstitialAd(this)" the device will display the background window. Any attempt to go further results in errors in logcat a sample of which I sent you in my first e-mail. At run time the library file cannot be found. 

Kind Regards
Levon 
       


--

---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/gmg5Fs7ORzw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

workspacegoogleplayservices6.zip

Eric Leichtenschlag

unread,
Aug 20, 2014, 7:45:55 PM8/20/14
to google-adm...@googlegroups.com
Hi Levon,

I got your code to run after fixing some library project references. For some reason, your google-play-services_lib was not set up as a library project. You should tick "Is library" for the google-play-services_lib, or update your project.properties to read android.library=true. Both of these actions do the same thing.

You provided two additional interstitial sample projects which both looked about the same. One of them was a library project though. I'm not sure why it was, but I made that one a regular application project and it ran for me once I referenced google-play-services_lib as a library project. The other one just worked after making the first change to google-play-services_lib.

Hope this helps,
Eric
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.

L Nigogosian

unread,
Aug 29, 2014, 1:56:12 PM8/29/14
to google-adm...@googlegroups.com
After I made the changes you recommended the code became much more stable and I am left with the original problem which I related in my first e-mail. It is definitely a run time error and as the code works on your system it may be that there are  some difference in the software program issues I am using. I am using the following:
Android SDK Build Tools issue 18.01
Java issue 1.6
Windows 7 Ultimate
Can you let me know what you are using and if it is at a later issue whether you think this would solve the problem. I am very reluctant to update any of the android development code because every time I update, a string of new problems arise. 

Can you also let me know the order in which the various items are compiled and linked as shown in the build path window in Eclipse both for the project and the library.

And finally can you let me know if you think there is something else wrong.

Thank you in advance for your cooperation,

Kind Regards
Levon Nigogosian



 

 


To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.

Eric Leichtenschlag

unread,
Aug 29, 2014, 5:36:01 PM8/29/14
to google-adm...@googlegroups.com
Is the attached image what you were referring to regarding build order?

I'm on Build Tools 23.0.2 now, running Java 1.6 and on Ubuntu. I'm not sure whether the new build tools make a difference or not.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
buildorder.png

L Nigogosian

unread,
Aug 31, 2014, 6:40:26 AM8/31/14
to google-adm...@googlegroups.com
Thank you for the image. There is another one for the project. If you can let me have that I would appreciate it.  I updated the tools but this has not solved the problem. The error I am getting seems to be associated with 3rd party libraries and the various solutions given in Stackflow etc. do not work. The only thing left to do is to install the system on another computer and see if the problem is resolved. This is obviously very time consuming and I wish to avoid it. If I could check the part of the program that defines the build path of the libraries in the build cycle during run time and ensure that they are correct this may resolve the problem. Do you have any suggestions. 

Thank you for your cooperation,
Kind Regards
Levon
                    


To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.

Eric Leichtenschlag

unread,
Sep 2, 2014, 6:18:25 PM9/2/14
to google-adm...@googlegroups.com
I don't know what other project build file you're looking for. This does sound incredibly frustrating, but I'm not sure what else to suggest.

L Nigogosian

unread,
Sep 6, 2014, 3:58:11 AM9/6/14
to google-adm...@googlegroups.com
Thank you for your cooperation. I am going to load down the latest version of the Android development system on another PC and see if this solves the problem. I will let you know when I get the result. In my long career Android has been the most frustrating development system I have worked with. But I think things are improving and lets hope a stable system will emerge.

Kind Regards
Levon Nigogosian


To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages