how to resolve Link error with BaseGameUtility when building Android project - android

I am trying to use Google Play Games Services with my android project. I have followed instructions as both seen on the official documentation and here as well: http://helios.hud.ac.uk/u1070589/blog/?p=202
Both libraries BaseGameUtils and google-play-services_lib are added and referenced by my project. BaseGameUtils references google-play-services_lib.
All boxes are checked under Properties -> Java Build Path -> Order and Export.
I receive the following error when attempting to run:
Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
I don't understand the issue. I have followed the instructions exactly. And retried several times.
Any ideas?

I had to go into the Java Build Path and remove BaseGameUtils and google-play-services_lib from there.
Also to remove another error I had to go into the libraries section and add the two jars (basegameutils.jar and google-play-services.jar.)
I'm not sure why this last part was nowhere in the instructions but this fixed the problem.

Related

Could not find BaseGameUtils.apk

For the last 2 days I've been trying to simply get Google play game services Integrated into my game. I've followed the instructions here...
https://github.com/playgameservices/android-basic-samples/blob/master/README.md
...many many times. I have been trying to get it to build with Gradle but for now, I'll just focus on Eclipse building until that works. I've imported BaseGameUtils project into my workspace as an Android library project. My game android project has two Android library dependencies: google-play-services_lib and BaseGameUtils. Everything in Eclipse is showing without any errors. When I build and run on a real device, I see an error that says -
[2014-10-27 20:39:25 - BaseGameUtils] Could not find BaseGameUtils.apk!
I don't know why it's even looking for BaseGameUtils.apk since it should be an Android library. That said, I'm not sure how an Android library is really handled so maybe it should be a .apk. In any case, I couldn't find any information on this bug and the error message doesn't give me much to work with. I've tried adjusting things in the Build Path but no luck. I did have to remove some redundant dependencies in my Build Path earlier since I was getting some kind of duplicate DEX error but I'm not sure that's related in any way to this. I am desperate for help, anyone have any idea?
Can you try this? It has to do with conflicting methods of specifying that a project is a library.
I found the source of the problem!
It turns out that "with the new library feature, you don't specify the
Android projects you depend on in the Java Build Path section of the
Properties. You do it in the Android section of the Properties".
So all I had to do is go the Application Project's Properties, hit the
Projects tab, select my own library project and click the Remove
button. That's it. No more problem.
In Eclipse Java EE select the project Properties, then select Project
References, then check the FacebookSDK (see screen capture)
From: Android Eclipse - Could not find *.apk
If that doesn't help, you may want to double check that you selected "Is Library" in BaseGameUtils.
Also, when you hit "Run" in Eclipse, are you running your application and not BaseGameUtils?
Please would you check that BaseGameUtils has "is library" checked and that your application project DOES NOT have "is library" checked.
If this is correct, then please would you review the following in detail (especially as regards checking and unchecking "is library" ) :
Android Eclipse - Could not find *.apk
I presume that the DEX error related to two or more versions of the same lib. What is the specific GameHelper error ?
As a general point, I find it productive to get a sample project working first to ensure that I have got the environment working correctly before I start integrating game services into my own projects. If you have been changing the build path then it may be quicker to start from scratch and get a sample working. I have followed those instructions in the past and they are accurate.

BaseGameUtils - unable to compile the source project

I am trying to have leaderboards in my android app. I was trying to use the library BaseGameUtils. This library is referencing the google play services library. When I clean my workspace I get the message for the library BaseGameUtils that the google-play-services_lib.jar is missing in a specified path. But actually the jar file is there in that path. Because of this When I refer the library BaseGameUtils the actual game APP is having an error marking. Kindly assist me to resolve this
More info might help to clarify your question more.
But let me see if my being from struggling with the Play Games Service for the past day helps:
first of all, make sure your Google Play Service is updated through SDK manager. After that, COPY THE ENTIRE FOLDER google-play-services_lib to your project and do all the referencing work accordingly.
After all that, check to see if the file res/values/version.xml from google-play-service_lib has the updated version number 4323000

Android: Google Map V2 not working as expected using eclipse

I'm integrating google map v2 to my android app, I'm using Eclipse with minimum SDK Version version 10. I'm using a Samsung Galaxy Ace as a test device.
I've read and done the necessary steps in this site:
http://developer.android.com/google/play-services/setup.html
https://developers.google.com/maps/documentation/android/start
I've also consult this tutorials:
http://www.vogella.com/articles/AndroidGoogleMaps/article.html
http://www.androidhive.info/2013/08/android-working-with-google-maps-v2/
The problem is that the google-play-service_lib seems to be not included although I have done the step Project > Properties > Android > Add: google-play-service_lib
Here is a screenshot:
I've tried solving this problem by doing Project > Properties > Java Build Path and adding the google-play-service_lib, but this will cause a runtime error java.lang.noclassdeffounderror: com.google.android.gms.R$styleable
Has anyone encounter this problem, and how did you solve this?
Make sure that your project code and google-play-service_lib's code are at same place otherwise it will keep fireing import error.
As you said
I add the library project, it is green. But when I visit the Project > Properties > Android part again, it will be red.
Just copy your project into your workspace or if its already copied into the workspace make sure you have also copied your Google-play-services library into your workspace otherwise it will always give you library error as it will not get the library available into your workspace.
The problem is because when you are importing lib project at that time you haven't copy that project in to workspace.
So finally when import it enable "Copy to Workspace" checkbox.
And after that give a reference to your project like below image.

Configure build path suggestion when trying to extend ActionBarActivity

I’m trying to extend my class from ActionBarActivity and cant, already tried every possible way I know. I’m importing android.support.v7.app.ActionBarActivity; I want to add the lib without the resource as instructed on the android developer’s site. And every time I get the same error....I upload some photos
this is the error: Description Resource Path Location Type
The project was not built since its build path is incomplete. Cannot find the class file for android.support.v4.app.ActionBarDrawerToggle$DelegateProvider. Fix the build path then try building this project xxx Unknown Java Problem
a busy cat http://img29.imageshack.us/img29/1032/qlei.jpg
a busy cat http://img43.imageshack.us/img43/6339/n4cj.jpg
thanks
The problem has been fixed for me after adding android support library.
Right Click -> Android Tools -> Add Support Library
Check that you have the android-support v7-appcompat project in the Projects tab on Java Build Path as in the picture:
(I can't add the picture to you, but you find it by right clicking your project and choose Build Path --> Configure Build Path)
Check also that that project does not report any error.
I am a novice but I just passed by the same obstacle a couple of minutes ago.
I hope this help.
I copied the whole project and it started working.....strange

ERROR: "._android-support-v4.jar" in project FacebookSDK

Help needed!!!! Stuck for 2 weeks on this and help needed.
I've recently imported the facebook sdk for android and its projects into my workspace. It shows up errors and the problems:
Archive for required library: '/home/Documents/facebook-android-sdk-3.0.2.b/facebook/libs/._android-support-v4.jar' in project 'FacebookSDK' cannot be read or is not a valid ZIP file
And the samples get errors along the line of:
The container 'Android Dependencies' references non existing library '/home/Documents/facebook-android-sdk-3.0.2.b/facebook/bin/facebooksdk.jar'
The things I have done following the other discussions without any success are
cleaned project
set the Facebook SDK as library
looked at the build path section and added external jar consisting of facebook/libs
imported fb sdk like 20 times and into different folders.
made sure my java compiler was 1.6
HELP would be very greatly appreciated!!!!
Take the lastest version of android-support-v4.jar (in your sdk environement : sdk/extras/android/support/v4/android-support-v4.jar) and replace in your project and library project do not create conflict.
The steps to importing a library are:
Download the library
Place the library in the libs folder of the project.
Build the project
Do Not attempt to import the library using some import wizard.
I suspect either your download was corrupted, and you need to do it again, or you put the file into the wrong directly.
I think your problem is that the android.support.v4 versions are different, take the one from your project and replace the one in the Facebook sdk lib folder, it should dismiss the clash.
As per your question, I think you are not able to compile once you add the SDK to your project. Do you get an error saying unable to run as library?
If so that means you have included this as library and create your project as a library to be used further. It is a common mistake that I have seen many people do when they try to import a library to use and tick mark the checkbox is Library. This actually means you want this project to be treated as a library for future use. Just try to add the SDK and do not tick mark the checkbox and this project will run fine.
Many forums will just tell you to tick that checkbox and you will be stuck on this error for long time.
For any .jar file related issues you have to make the .jars files compatible as there hashing a problem and the two jars are not compatible with each other (a version issue).

Categories

Resources