Try to integrate Google Play Services (for AdMob) but "failed to resolve library path"

652 views
Skip to first unread message

Michael H.

unread,
Sep 20, 2014, 10:01:21 AM9/20/14
to google-adm...@googlegroups.com
Hello,

i have build my first android app and now i want to integrate AdMob into my app.
I'm using ANT to build the .apk, but i get the following error report:

C:\ ....my directory... \android-sdk\tools\ant\build.xml:459: "Failed to resolve library path: C:/...my path..".

I think i made a mistake integrating the Google Play Services into my workspace. I am not using Ecplise.

I also read the instructions from http://developer.android.com/google/play-services/setup.html#Setup which say that, if you are not usig ecplise, you should use the command line to add a reference to a library project.
Somewhere i read that i should change android library reference to a relative path.

My question is: To which file i should set the library path and how?

Any help is much appreciated :)

Eric Leichtenschlag

unread,
Sep 22, 2014, 8:30:33 PM9/22/14
to google-adm...@googlegroups.com
Does your app have a project.properties file? That's where the reference got added. It should point to the <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib directory.

Michael H.

unread,
Sep 27, 2014, 4:01:46 AM9/27/14
to google-adm...@googlegroups.com
At first: Thanks for your answer :)

Yes, i have a project.properties file in my main folder, next to my AndroidManifest.xml
Inside the file i have this code:

target=19
android.library.reference.1=../../google-play-services_lib

What i am curious about is, the error message says that there is no project.properties FOR my project.
So, i guess its not missing the file, but the file seems not to match.

Also, i saw that there is another project.properties file inside the google-play-services_lib folder. I tried on both places with the same project.properties file, but getting the same error message.

Have you any idea what i'm doing wrong?

Thanks

Eric Leichtenschlag

unread,
Sep 29, 2014, 6:24:18 PM9/29/14
to google-adm...@googlegroups.com
Each project has its project.properties, so the Google Play services one should be separate from yours.

And your project.properties file should be in the same folder as your AndroidManifest.xml. It sounds like it's in the right place.

Is ../../google-play-services_lib the correct reference based on where your project.properties is?

Michael H.

unread,
Sep 30, 2014, 3:14:59 PM9/30/14
to google-adm...@googlegroups.com
Since your last answer, i used the trial-and-error way to test which way could work.
I got a success by building the .apk but now i have an error that causes my app to crash as soon as it launches, which i think is based on what i have tried.

I try to descripe my folder structure as clear as possible: (by the way: i'm using Pygame Subset for Android to build my .apk)

I have one head folder "pgs4a" which includes the following sub-folders:
"android-sdk", "apache-ant", "assets", "bin"(where the .apk will land, if the building process is succesful), "buildlib", "doc", "gen", "libs", "private", "python-install", "res", "src", "templates", "google-play-services_lib" and one folder "myapp" which includes my python code+graphics+sound.
Also inside the "pgs4a" folder is my "AndroidManifest.xml", "build.xml", "local.properties", "project.properties", "proguard.txt", "blacklist.txt" and my android.keystore.

Now,  the part where i am very confussed at, is: On the site for Google Developers http://developer.android.com/google/play-services/setup.html stands, that if you want to add GooglePlayServices to your project and if you are NOT using ECPLISE, you should
"Copy the library project at <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/ to the location where you maintain your Android app projects."

After reading that, i copied the complete folder "google-play-services_lib" into my "pgs4a" folder and made via command line "android update project --target 6 (which is API Level 19 in my case) --path C:/....../pgs4a --library android.library.reference.1=../../google-play-services_lib    like it is mentioned here: http://developer.android.com/tools/projects/projects-cmdline.html#ReferencingLibraryProject

Then, i tried to build my .apk via command line, and it was mentioned that inside my "google-play-services_lib" folder (which is in my "pgs4a" folder) the local.properties, project.properties and the build.xml were missing. So i copied these files also inside the folder.
This seems very strange to my, but i could build an .apk without further error messages, so i thought this would be okay.

Unfortunately my app crashed immediatly after showing the presplash.jpg. I used USB-Debugging and "adb logcat > logcat.log" to see what the problem is:

THIS is my current problem/error from logcat.log:

D/dalvikvm( 8385): Trying to load lib /data/app-lib/com.myapp-1/libsdl_mixer.so 0x43125618
E/dalvikvm( 8385): dlopen("/data/app-lib/com.myapp-1/libsdl_mixer.so") failed: dlopen failed: cannot locate symbol "__gnu_thumb1_case_sqi" referenced by "libsdl_mixer.so"...
W/dalvikvm( 8385): threadid=15: thread exiting with uncaught exception (group=0x41e9cda0)
D/KeyguardUpdateMonitor( 1120): sendKeyguardVisibilityChanged(true)
E/AndroidRuntime( 8385): FATAL EXCEPTION: Thread-838
E/AndroidRuntime( 8385): Process: com.myapp, PID: 8385
E/AndroidRuntime( 8385): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__gnu_thumb1_case_sqi" referenced by "libsdl_mixer.so"...
E/AndroidRuntime( 8385):     at java.lang.Runtime.loadLibrary(Runtime.java:365)
E/AndroidRuntime( 8385):     at java.lang.System.loadLibrary(System.java:526)
E/AndroidRuntime( 8385):     at org.renpy.android.PythonActivity.run(PythonActivity.java:281)  

The mentioned file "libsdl_mixer.so" is here: "pgs4a" -> "libs" -> "armeabi" -> "libsdl_mixer.so"

What do i do wrong now ?

Sorry for the long text, i just wanted to be as detailed as possible. :/

Eric Leichtenschlag

unread,
Oct 2, 2014, 5:22:55 PM10/2/14
to google-adm...@googlegroups.com
I've always used some IDE to build the project so I'm not an expert here. But from your project directory, your Google Play services library looks like it's in the same directory as your build.xml and project.properties, so I think the reference should just be google-play-services_lib/ and not ../../google-play-services_lib.

Michael H.

unread,
Oct 2, 2014, 5:32:19 PM10/2/14
to google-adm...@googlegroups.com
I will definetly try that!
Maybe, where can i find an "expert" for this matter?

Do you have an idea what can be reason for my error message, or how to avoid it?

Eric Leichtenschlag

unread,
Oct 3, 2014, 12:02:20 PM10/3/14
to google-adm...@googlegroups.com
I recommend asking this question on StackOverflow with the android, google-play-services, and admob tags. That should target a wide community that'll be most likely to answer this question.

Thanks,
Eric
Reply all
Reply to author
Forward
0 new messages