Dependencies Error - android

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

Related

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

The import com.google.android.vending cannot be resolved in an imported android project

I have just imported an android project and when I am trying to run it it is giving me error on the following imports
import com.google.android.vending.licensing.AESObfuscator;
import com.google.android.vending.licensing.LicenseChecker;
import com.google.android.vending.licensing.LicenseCheckerCallback;
import com.google.android.vending.licensing.ServerManagedPolicy;
Any help resolving this would be greatly appreciated.
You’re getting those errors because you didn’t import the licensing library.
Go into the folder where u downloaded the android-sdks stuff.
So there are 2 things: I) a Licensing Library and II) the Sample Licensing App
I) The licensing library is located in:
UserName/android-sdks/extras/google/play_licensing/library
II) The Sample Licensing App is located in:
UserName/android-sdks/extras/google/play_licensing/sample
OR
In Eclipse, File-> New -> Other… -> Android Sample Project -> (Choose a Target and hit next) -> Google Play Licensing Library
Step 1:
In Eclipse, Go to File-> New -> Other… -> Android Project from Existing Code -> (Locate the library, ie= UserName/android-sdks/extras/google/play_licensing/library)
Step 2:
Once you have the library imported to Eclipse, right click on the package and go to Properties -> Android. Make sure the “Is Library” option is checked.
Step 3:
In Eclipse, File-> New -> Other… -> Android Sample Project -> (Choose a Target and hit next) -> Google Play Licensing Library. My package was named “play_licensing_sample” by default.
Step 4:
Right click on “play_licensing_sample” and go to Properties-> Android -> Add… -> (Choose the Licensing Library u made in Step 2)-> Apply
You’re done!
I ran into this issue when trying to set up my Android project for an APK expansion file.
The following steps resolved it for me:
Add downloader_library to eclipse as a "project from existing source" (it has errors)
Add licensing library to eclipse as a "project from existing source"
Add licensing library to downloader_library project
In android studio 2.2.3 I was able to fix the "package com.google.android.vending.licensing does not exist"
error by:
Right click the downloader_library module from your project view
Select "Open Module Settings"
Select "Dependencies" Tab
Press plus sign + then select "3 Module Dependency"
Select "market_licensing" and press OK.
Original writeup of fix at https://kitefaster.com/2017/02/15/expansion-apk-files-android-studio/
It took me 2 days to resolve this in my project
1)I discovered the folder here
2)created a folder here
3)copied the files (less the UTIL folder) here
enter image description here
In Android studio you need to add a folder same level as java(folder) called aidl. Take a look at the image for more specific.
You can get those file here - https://android.googlesource.com/platform/development.git/+/b8168f27f6f5b6b0ced5ef3210c0e89e8d3a5ae2/samples/MarketLicensing/src/com/android/vending/licensing
You may want to review the steps this link. It goes through the steps of adding it to your Android project, regardless of your IDE. Eclipse will work just fine.
These steps take some time and effort, but I have successfully done this before.

Location Update example for Android not working

I am trying location update example from following link
http://developer.android.com/training/location/retrieve-current.html#AppPermissions
It gave me some errors that I resolved by adding google play services, the application is building without errors, but when I am running it (both using AVD or real device) it is giving ClassNotFoundException and is not working.
I am using eclipse and ADT for my development
Adding error snapshot for reference
You need to add the lib android-support-v4.jar that is is your sdk.
Then, go to project properties (alt+Enter) -> Java Build Path -> Order and Export and then check android-support-v4.jar. Clean the project and it will work.
If you don't know how to ass a library you can co to properties -> Java Build Path -> Libraries tab and then click to add external jars.
Did you include the Google-play-services.jar file and also please make sure you have this metadata included in your manifest
for more details - refer
http://developer.android.com/google/play-services/setup.html
I think you should right-click on the Android project, choose properties, Java Build Path, and Checks the "Android Private Libraries" under "Order and Export".
You should tick something ;)
Check this out

Can not install google-play-services into Eclipse correctly (trying to get maps working)

My current wokspace setup looks like this:
However, people have told me that to get maps working, I also need to have "google-play-services_lib.jar" in my "Android Dependencies" folder, and the way to do that was through doing: "to Google Play Services into your project Project -> Properties -> Android -> Library, Add -> google-play-services_lib"
The only problem with that is it always after the initial green marker, it turns to a red cross when re-opening "Project -> Properties -> Android -> Library" ...and also no "google-play-services_lib.jar" gets added to "Android Dependencies" in the prooject
This question is an off-spring of this: Trying to get maps v2 Android demo working where I was told above was necessary to get maps working in my app. (Otherwise one gets error during inflating the XML containing the maps fragment.)
Have you tried to use Google APIs instead of Android 4.2.2? Using that will use Google Maps dependencies.
I just made a "working app" (it throws no errors but I was too lazy to make a key) using Google Maps v2 and not Google APIs as build but Android 4.1. This was my procedure.
Download the library from the SDK download manager.
Copied the folder "google-play-services_lib" which had this path ".../android-sdk/extras/google/google_play_services/libproject/google-play-services_lib" to another folder where I keep my libraries.
In Eclipse I chose New Project - Android Project from Existing Code. It got imported without any problems.
Right click the test project, click Properties - Android - Add - google-play-services_lib which now is in my workspace.
See if it works by trying to subclass com.google.android.gms.maps.MapFragment.
Please respond if you get any errors, if you do it right it will all work. Good luck.
First you need to delete your google-play-services project from your Package Explorer then you need to copy "google-play-service folder" from the directory C:/android-sdks.....google-play-service to your WORKSPACE then open Eclipse import the project "google-play-services" also from your WORKSPACE and then you can add the library...
Hope it helps:)

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