Unable to resolve YouTubeAndroidPlayerApi dependency - java

I have created a project and try'n adding YouTubeAndroidPlayer jar dependency but couldn' able to resolve it.
The gradle is able to sync it but while Inherting and using it, it might not able to resolve and throwing compile time error. I am using 2.3.2 version of Android studio. Please check the attached .gradle and .java file screenshot.
and Java file :
Thanks.

Just got it worked luckily, steps:
- Firstly, Added a New Module of type Jar file, it puts an entry like this under libs folder:
Secondly, Under app directory -> inside libs folder -> need to copy same JAR file.
This resolves the issue. Since I am a newbie in android, does make it resolve somehow.
Thanks.

I checked your code, it was missing Jar file. Just copy the "YoutubeAPI" jar from their developer's website and paste it into your "libs" folder. Sync your project and it will work!
Other Solution:
Remove that last Youtube Jar import line and delete the jar file from your "libs" folder as well. Simply add this line in your dependencies block to import directly from dependency support site:
compile 'com.google.apis:google-api-services-youtube:v3-rev181-1.22.0'
It will automatically resolve all issues. For details check this link:
Add YouTube Data API to Android Studio

Related

Include Github Project into Android Studio 2 project without jar or dependency

i have found this sdk: is24-restapi-java
and i want to import it into my android studio project for further use.
But i can't find a way to include it.
I did some searching through the github project i cannot find a simple jar or dependency that i can include into my project and all advances to generate a jar or something failed.
Can anyone give me a guid or something to include this sdk into my project or am i using the wrong approach?
Goto File -> New -> Import Module.
Source Directory -> Browse the project path
Specify the Module Name – it is used for internal project reference.
Let Android Studio build the project.
Open build.gradle (Module:app) file.
Add the following line with your module name in place of “projectName” in the dependencies block:
compile project(':projectName')
After this Android Studio would start saying “gradle files have changed since last project sync”, press the “sync now” link to start a sync.

Unable to add appcompat support library in eclipse

My project(eclipse) has dependencies on android.support.v7.app.AppCompatActivity. I tried the following.
Tried to add the library in my project's Java build path. Didnt work.
Also I observed something weird. The path for support libraries referenced elsewhere in SO is Android\sdk\extras\android\support\appcompat
However in my SDK the path is the following.
Android\sdk\extras\android\m2repository\com\android\support
May I ask why is that so?
Also I copied the appcompat jar file into the libs folder of my project. Still it didnt work.
Could anyone please help?
See this answer
The import android.support.v7.app cannot be resolved
After you add appcompat_v7 to your dependencies, be sure that the libs folder from your project are empty. By default, an android-support-v4.jar is created when you define your project, so this will cause conflict when you declare appcompat_v7 library as your dependency.
So, the first thing you need to do is check the folder .../My_Project/libs and fearlessly delete the file android-support-v4.jar.
Then, add the appcompat_v7 library as a dependency of your project:
To do this, if you are using Eclipse:
Right click in your project folder, located in the Navigator.
Click in properties, in the final of the list.
In the Properties window, select the Android option (left menu).
In the box Library, add your new reference.
Support Library Setup -
https://developer.android.com/tools/support-library/setup.html
Just import the appcompact library in your workspace then simply add this library in your project from properties .
It works for me. I using this. I also provide you library.

How to get JAR from Maven for Android

How can we get jar files/library files from Maven repo. Maven provides AAR file.
I know using Android Studio is best but I am facing some issues with my system, so for some time I have to use eclipse.
I want to get jar file/library project for this project
https://github.com/dmytrodanylyk/android-process-button/
Please suggest me some solution.
You can download the source from here and export in to your project and if you want you can create jar easily.
The code you're trying to get is an Android library, and requires some resource to work. You need to download the res folder too from here and you need to add it to your project res folder.

How do I add a Github library to my Android Project as a JAR in Eclipse?

I'm trying to add https://github.com/astuetz/PagerSlidingTabStrip to my project. Looking at it, I notice that it has files in res and depends on its own R.java file. When I make it a JAR I continue to get errors because the dependencies aren't all there. I'm not sure how to get this to work.
I keep getting errors like
import android.support cannot be resolved and everything else too. I tried referencing different answers on StackOverflow but none of them yielded a working solution.
The resources won't be packaged into the JAR file. Google is working on a new packaging scheme called AAR which is supported by Android Studio.
In order to use this third-party library in your own project, you should clone it to a local repo. Then you can import it directly into your Eclipse workspace and then add the Eclipse project to the classpath of your app's project.
Download the whole source code from https://github.com/astuetz/PagerSlidingTabStrip by git tool.
On your Eclipse IDE, import the library as exsisting source code at Android option.
Add the library your add before into your project.

Can't import an external .jar library into my Android project on Eclipse

I've searched everywhere I could for a solution to my problem an I couldn't find one, so I hope there's someone outhere who can help me.
I have a .jar library that I want to include into my project, I've followed a fews guides I found, but no one has worked for me so far, despite the fact that I can compile and generate my APK.
After installing the APK and launching the app, when a class member is called (the one from the library I want to import), my app crashes, and logcat gave me this :
Could not find class 'net.rdrei.android.dirchooser.DirectoryChooserActivity', referenced from method com.azsde.myApp.Settings$1.onPreferenceClick
I then decompiled my apk because I was curious to see if the class has been included or not, and I found that it has not be included in my apk, here's a the result of a tree command listing my files:
http://pastebin.com/wcdK37FM
Here are my Java Build Path settings:
What did I do wrong and why isn't my library included in my APK?
Adding the JAR to your project's build path yourself as if it were a plain Java project will not work.
You add libraries to an Android project by copying the JAR to the libs folder at the root of your project (if the folder does not exist, then create it); ADT will then automatically add it to your build path and set up your project to bring the JAR into your APK.
You can learn more here http://tools.android.com/recent/dealingwithdependenciesinandroidprojects

Categories