Project import giving Google Play Service error - android

I am working on Open Data Kit. I have cloned the ODK Collect repo on my system.
Now whenever i try to import the Android Project in my Android Studio,
i get the following error
* Project ODK Collect:D:\Development\opendatakit.collect\project.properties:
Library reference ..\playservices could not be found
Path is D:\Development\opendatakit.collect\..\playservices which resolves to D:\Development\playservices
I have put the Google-Play-Services JAR file in the project folder.
Please guide with detailed steps.
I SEARCHED FOR SIMILAR QUESTIONS, AND NONE OF THE SOLUTIONS WORK
Thanks a lot.

To prevent Unrecoverable error
First open eclipse and open project remove all errors make project runnable.
If you don't have ecclipse installed then delete (keep backup) project.properties file from the project
Now try to import your project in Android Studio you will not get Unrecoverable error
Now to add dependency
Right click on the project folder click Open Module Setting
Goto dependency tab (last one)
Select + button on the right side , Select Library dependency.
Scroll to Google play service and select it.
Now you will be able to import and work with Google play service.

Related

How to enable "Next" or "Finish" button in Android Studio when adding Android library as a dependency

I'm following the instructions on Android Developer website to import a AAR file as a module. I'm using the instructions under "Add your library as a dependency." I browse to select my .aar file, but the 'Next' and 'Finish' buttons are disabled. I don't see any error messages. Any ideas? Thanks in advance.
I select the .aar file by browsing for it, so the path is correct.
Buttons are disabled, although there are no error messages.
Figured it out right after posting it. My project gradle sync errors, so I had to fix those first before I was allowed to import the project. As soon as I fixed that and synced I was able to import the project.
Thanks.

Android Studio/LeadBolt SDK: Setting up sample SDK and sample App given files

I have been trying to understand how to incorporate a sample app from the LeadBolt SDK. LeadBolt is a mobile/web advertising service.
http://help.leadbolt.com/android-integration-guide/
I've downlaoded their SDK and I got an executable and a sample application, but when I open up the folder that has the .idea, lib, and src folders as my project, it doesnt automatically compile. I get errors in the XML that says that the URI is not recognized and that the version codes are not reconized in the manifest.
I want to be able to import sample apps but I'm failing on the developer side.
I managed to make it compile for me. Heres what I did:
1) In android studio, go to file -> new -> import project
2) imported the LeadBoltSampleApp folder that was already unzipped
3) Gradle needed to be updated, in the 'app' box it asked to update the 'missing platforms'
(this video) helped with step 3

Eclipse failed to include google play services

I am trying out android gcm in eclipse. I have successfully completed the http server implementation but then i get an error in the manifest file around #integer/ play.
I have tried importing the jar manually but it doesn't work.
Any help?
Follow the instructions carefully.
Make sure that both the project library and the application project that depends on it are in your workspace. If one of the projects is missing, import it into your workspace.
In the Package Explorer, right-click the dependent project and select Properties.
In the Properties window, select the "Android" properties group at left and locate the Library properties at right.
Click Add to open the Project Selection dialog.
From the list of available library projects, select a project and click OK.
When the dialog closes, click Apply in the Properties window.
Click OK to close the Properties window.
Basically, you have to import the Google Play Services project, then add it as a library in the project.

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.

Why can't I add mopub-android-sdk as library?

I want to use MoPub for putting ads in my Android app.
I have downloaded the required resources and set-up a library project (mopub-android-sdk) in Eclipse. Now I want to add this project as a library to my Android app. But when I try to do that it gives this error:
Are the mopub-android-sdk files in the same parent folder as your project? This seems like the same problem addressed in this question/answer:
In eclipse, unable to reference an android library project in another android project
Place the referencing project in the same physical folder and see if the error persists.
To get around this, don't set up the mopub-sdk as a library project.
You can simply import it as a standard project.
Go to File > Import >Existing Projects Into Workspace, find the right project and click finish.
Right click your actual project and then click Build Path. Go to Link Source and then select the location of the project you just imported.
That should resolve the issue for you without requiring you to build a JAR.
-Franklin

Categories

Resources