1. Are you ready for the Galaxy S20? Here is everything we know so far!

Adding dependencies to YouTube OAuth2.0 project

Discussion in 'Android Development' started by spiteria, Feb 20, 2016.

  1. spiteria

    spiteria Lurker
    Thread Starter

    I'm trying to add some YouTube OAuth2.0 authorization for an Android project I'm working on using Android Studio. I got some sample code from here http://bit.ly/1SI805S. I'm pretty sure I linked to it from a Google developers site. I'm trying to add some libraries to take care of the dependencies but it isn't recognizing them. Here are the dependencies:

    import com.google.api.client.auth.oauth2.Credential;
    import com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp;
    import com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver;
    import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
    import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets;
    import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
    import com.google.api.client.http.HttpTransport;
    import com.google.api.client.json.JsonFactory;
    import com.google.api.client.json.jackson2.JacksonFactory;
    import com.google.api.client.util.store.DataStoreFactory;
    import com.google.api.client.util.store.FileDataStoreFactory;
    import com.google.api.services.oauth2.Oauth2;
    import com.google.api.services.oauth2.model.Tokeninfo;
    import com.google.api.services.oauth2.model.Userinfoplus;

    I downloaded a .jar for the com.google.api.services dependencies and that is working fine. I found the file on the Google developers site and it's google-api-services-oauth2-v2-rev103-1.21.0.jar.

    However, all of the api.client jars I've found are not working. I put them in the libs folder and add compile files to the build.gradle but it won't recognize the imports. The jars I've used thus far are
    google-api-client-util-1.2.3-alpha.jar
    google-api-client-extensions-1.6.0-beta.jar
    google-api-client-auth-1.2.3-alpha.jar

    Is there anything I'm missing? I've found these files in different parts of the net. I've looked through maven repositories and I just found a site, http://www.java2s.com/Code/Jar/g/Downloadgoogleapiclientutil121alphajar.htm, but I don't know that it's helpful. There's some api.client stuff I downloaded from the Google Developers site but that doesn't look like anything I need and it doesn't resolve the dependencies.

     


  2. Best Answer:
    Post #3 by spiteria, Feb 21, 2016 (1 points)
  3. spiteria

    spiteria Lurker
    Thread Starter

    I was on stackoverflow here and got a partial solution to the problem, http://bit.ly/24iIDvj. I'm still having an issue though. I was using Bintray to find the jar files and I found one that worked but every other file I added didn't do anything.

    Bintray worked for a couple of the dependencies. google.api.client-1.21.0 took care client.googleapis but client.extensions, client.auth, client.json, and client.util still aren't resolving. I've added a few jars as libraries, google-api-client-auth-oauth2-1.2.0-alpha.jar, google-api-client-util-1.2.3-alpha.jar, google-client-api-1.0.4.jar and a few others.
     
  4. spiteria

    spiteria Lurker
    Thread Starter

    The stackoverflow answer worked. I just needed to add it with the correct version. I got it from the maven repository.
     
Loading...
Similar Threads - Adding dependencies YouTube
  1. Kupferrot
    Replies:
    1
    Views:
    194
  2. danezeq
    Replies:
    5
    Views:
    320
  3. Hegmann Kris
    Replies:
    0
    Views:
    278
  4. 808tennis
    Replies:
    1
    Views:
    174
  5. App Update
    Replies:
    0
    Views:
    152
  6. Bayberw
    Replies:
    1
    Views:
    399
  7. PeterMikeWarden
    Replies:
    12
    Views:
    332
  8. App Update
    Replies:
    1
    Views:
    299
  9. CatalinZ
    Replies:
    4
    Views:
    525
  10. Usalabs
    Replies:
    0
    Views:
    147

Share This Page

Loading...