library projects cant be found and R.java wont be built. - android

I have a couple of libraries which are not being detected in my eclipse project.
The problem is its showing up with a cross in properties -> Android
How can I resolve this issue?

first delete google play services from eclipse and clean project
For google play services first install Google play Services
SDK Manager -> Extras -> Google play Services
after installing go to
File->import->your SDK folder path ->extras->extras/google/google_play_services/libproject/google-play-services_lib

Do not copy-paste these libraries inside your 'libs' folder. Instead, import those to your workspace(not from libs folder) and refer them from there.

RightClick On Project->property->Android->Add->select google play services lib ->Apply->ok

In order to use Library project in your application, all library project should be imported first in your working Workspace
How to add Library projects
RightClick on Your Project> Go to Properties >Android>Click on Add
Then add all the required library project
Then click Apply then Ok
Hope this will help you..

Related

Could not locate google-play-services_lib.jar, but is there

All was ok with BaseGameUtils and GooglePlay services lib used with my project a day ago when I decided to update Eclipse to its latest version
Luna Service Release 2 (4.4.2)
Build id: 20150219-0600
then I've started to get problems with the projects.
I did clean and rebuild the entire workspace, even restart Eclipse, fix project properties... add support library... but still I cannot solve the
> [... BaseGameUtils] Could not locate google-play-services_lib.jar'.
> This will not be added to the package
Of course, BaseGameUtils and GooglePlayServices are marked as "Is library" and I've checked the jar
file /media/dotteri/proyectos/google-play-services_lib/bin/google-play-services_lib.jar
/media/dotteri/proyectos/google-play-services_lib/bin/google-play-services_lib.jar: Java Jar file data (zip)
so, is there, but somehow Eclipse doesn't find the jar.
This person has the same problem like me: Dx Could not locate '../google-play-services_lib.jar'. This will not be added to the package
Am I missing something? Thank you
[Solved]
More or less solved. I just created a new project and I moved the source code there. I know this isn't the best way to solve it but it works. Thank you. The problem is not Eclipse.
In Eclipse, go to "Build Path>Configure Build Path" and then option "Android" on the left, below in that screen delete the google play services and add again.
Here is the path for google play services:

Dependencies Error

I am having the following error in my project. I have tried many solution but none worked for me. I am proviging the screenshots of project kindly help me in solving this problem.
Please Solve my this problem..
As the second screenshot suggests, the library for google play services (a .jar file) is missing. You need to delete that dependency, and add it by hand (I guess you imported this project from somewhere else). Make sure in your Android SDK manager you download the Google Play Services Library, then in eclipse you can import it by going to your Android SDK folder and import the jar file, the path should be like this ..\Android SDK\extras\google\google_play_services\libproject\google-play-services_lib\libs\google-play-services.jar
Update:
The error you are getting is not related to the library already, it's a different error, there is no size value for the AdView (missing or it was somewhere in the app inserted and the reference is missing).
I guess you talk about this app https://play.google.com/store/apps/details?id=com.solutionproviders.rapsongs&hl=en
Try like this
1.Right click your project
2.Select -> properties
3.Select -> Java Build Path
4.Select -> Libraries
5.Select -> Google play services lib.jar file
6.Select -> Remove
7.Select -> Add External JARS
8.Select -> New google paly service
9.Select -> Order and Export
10.Click -> Select All
11.Click -> ok
12.Select -> Clean your projects
13.finished
Second screen shot
1.Click Google play service.jar file
2.Remove your jar file
3. Add new Google play service.jar file
your problem solve

eclipse android can not import google play services library

hello i am quite new to Android development and i want to learn how to use the google Maps API v2. After trying numerous tutorials, i always seem to have a problem with the google play services library. Somehow, Eclipse can't import it properly. I tried this tutorial https://github.com/thecodepath/android_guides/wiki/Google-Maps-Fragment-Guide and when i try to include Google Play Services project as a library, first it all goes nice and smooth, i get a green tick in the Project Properties - Android - Library window, but when i close it i still get lots of "can't be resolved to a type" errors. I return to the window where i add the library and i see a red "X" and a question mark under "project" instead of the green tick. I tried several other tutorials and i always have a problem with this library. I like this tutorial and i would really like to make it work. I also tried to manually copy the library folder in the workspace but that didn't work either. I googled like crazy trying to find an answer but i always find something that i tried before (like manually copying the library in the workspace or something similar). I am quite desperate, i really have no idea why it can't just see the library please help. Also this is my first post to StackOverflow so be gentle :)
later Edit (solved):
when i imported the downloaded project, i kept it on the desktop and thats why it didn't work, after i copied it in the workspace everything worked. Thank you all very much for helping a beginner :)
The important thing in adding a library in eclipse is to remember that your project and the library project need to be in the same workspace.
To solve this follow below ways,
You can copy the google-play-services library project to the same workspace where your main project is there.
else
While importing the library to eclipse remember to check copy projects into workspace which will add a copy of the library to your workspace.
I see a red "X" and a question mark under "project" instead of the
green tick.
The problem is -
The path to your google play services library is not same as the path to your project. It is outside of your project. And so is not recognized by simple import.
Solution - Put the library in the project's libs folder.
NOTE: Just putting the library to the libs folder is not enough.
After you added your library follow these steps -
1) Go to Project -> Properties -> Java Build Path -> Libraries -> Add JARs..
2) Now add your recently added jar to the build path from JAR selection process.
3) Go to Project -> Properties -> Java Build Path -> Order and Export.
4) Put a tick mark in the check box against this library name and press OK.
5) Do Project -> Clean.
if your giving google-Play-Service-lib as a references to your project , try to keep your project and the Google-play services lib should be in same drive.
if your project is on C: drive means place Google-play-services-lib in C:
While making the copy of the entire folder libproject containing google-play-services_lib from eclipse import project by selecting the copied libproject folder in your working place.
For the rest follow the steps in Setting Up Google Play Services
Eclipse
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.
Import the library project into your Eclipse workspace. Click
File > Import, select Android > Existing Android Code into Workspace
and browse to the copy of the library project to import it.
After you've added the Google Play services library as a dependency for your app project, open your app's manifest file and add the following tag as a child of the <application> element:
< meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
Android Studio
Open the build.gradle file inside your application module directory.
Add a new build rule under dependencies for the latest version of play-services
eg
...
dependencies {
compile 'com.google.android.gms:play-services:9.2.0'
}
apply plugin: 'com.android.application'
Source developers.google.com

adding library for google map api v2 in android

I cannot add google play service library project in my existing android app project to implement google map. Android dependencies are also not been added in the existing app project. It shows me error. I am always trying to add it from my saved sdk manager folder in my adt bundle but the library project is not added. Though I have imported the google_play_service_lib project in my package explorer. Please some body help me.
Thanks in advance.
RightClick On Project->property->Android->Add->select google play services lib ->Apply->ok
Go to: Your Drive:\android-sdk-windows\extras\google\google_play_services add it in your eclipse, if this will added if you have completed whole process of google map.
Make sure that your library and project in the same Workspace.
RightClick On Project->properties->Android->Add->select googleplayservices library->Apply->ok
Try Like this,
File>New>Project>Android>Android Project from Existing code>Browse: Navigate to adt-bundle-windows-x86\adt-bundle-windows-x86\sdk\extras\google\google_play_services> Select libproject
Then you can add this Library project in your own project.
Hope this will help.
Import the android project library "google-play-services_lib" in your Eclipse workspace.
File > Import > Android > Existing Project in WorkSpace.
Select path to google play services library. Click Ok.
Go to your Project Settings (right click project).
then go to Android Tab in left.
Under library section click ADD to add the library project. Apply the settings.

How to add google-play-services.jar project dependency so my project will run and present map

I have following problem:
I try to use SupportMapFragment from com.google.android.gms.maps.SupportMapFragment which is part of Google Maps Android API v2.
My first approach was to add project to Eclipse from android-sdk\extras\google\google_play_services\libproject\google-play-services_lib location and set it as referenced project in Properties -> Project References menu of MyApp. I also added project to Java Build Path / Projects. Error indicators disappeared from Eclipse but when I tried to run my app I got NoClassDefFoundError exception.
So my second approach was to copy jar file from google-play-services_lib/libs to my project's libs directory. MyApp succesfully started but in LogCat I can see dead code ... something message so I guess that jar file has to be referenced in another way.
And now I am confused and tired..
Maybe someone more experienced in Android can tell me what should I do ?
The quick start guide that keyboardsurfer references will work if you need to get your project to build properly, but it leaves you with a dummy google-play-services project in your Eclipse workspace, and it doesn't properly link Eclipse to the Google Play Services Javadocs.
Here's what I did instead:
Install the Google Play Services SDK using the instructions in the Android Maps V2 Quick Start referenced above, or the instructions to Setup Google Play Services SDK, but do not follow the instructions to add Google Play Services into your project.
Right click on the project in the Package Explorer, select Properties to open the properties for your project.
(Only if you already followed the instructions in the quick start guide!) Remove the dependency on the google-play-services project:
Click on the Android category and remove the reference to the google-play-services project.
Click on the Java Build Path category, then the Projects tab and remove the reference to the google-play-services project.
Click on the Java Build Path category, then the Libraries tab.
Click Add External JARs... and select the google-play-services.jar file. This should be in [Your ADT directory]\sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs.
Click on the arrow next to the new google-play-services.jar entry, and select the Javadoc Location item.
Click Edit... and select the folder containing the Google Play Services Javadocs. This should be in [Your ADT directory]\sdk\extras\google\google_play_services\docs\reference.
Still in the Java Build Path category, click on the Order and Export tab. Check the box next to the google-play-services.jar entry.
Click OK to save your project properties.
Your project should now have access to the Google Play Services library, and the Javadocs should display properly in Eclipse.
What i have done is that import a new project into eclipse workspace, and that path of that was be
android-sdk-macosx/extras/google/google_play_services/libproject/google-play-services_lib
and add as library in your project.. that it .. simple!!
you might require to add support library in your project.
Be Careful, Follow these steps and save your time
Right Click on your Project Explorer.
Select New-> Project -> Android Application Project from Existing Code
Browse upto this path only - "C:\Users**your path**\Local\Android\android-sdk\extras\google\google_play_services"
Be careful brose only upto - google_play_services and not upto google_play_services_lib
And this way you are able to import the google play service lib.
Let me know if you have any queries regarding the same.
Thanks
Some of the solutions described here did not work for me. Others did, however they produced warnings on runtime and javadoc was still not linked. After some experimenting, I managed to solve this. The steps are:
Install the Google Play Services as recommended on Android Developers.
Set up your project as recommended on Android Developers.
If you followed 1. and 2., you should see two projects in your workspace: your project and google-play-services_lib project. Copy the docs folder which contains the javadoc from <android-sdk>/extras/google/google_play_services/ to libs folder of your project.
Copy google-play-services.jar from <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/libs to 'libs' folder of your project.
In google-play-services_lib project, edit libs/google-play-services.jar.properties . The <path> in doc=<path> should point to the subfolder reference of the folder docs, which you created in step 3.
In Eclipse, do Project > Clean. Done, javadoc is now linked.

Categories

Resources