1

I want to add the YoutubeAndroidPlayerApi.jar to my Android Studio Project but nothing happens when i paste it into the app/libs folder. I have already tried the steps suggested here but i'm stuck.

This is what i have done so far to include the library:

copied .jar to libs folder

added it under [File] > [Project Structure] > [Dependencies]

added it to the build.gradle file

In another project i've tried it before and it worked, so i was able to compare but everything seems right except for no additional files being generated in the libs folder like this.

marvinsxtr
  • 101
  • 2
  • 9
  • `but it does not work` what doesn't work? `but i'm stuck` what are you stuck with? – Zun Jul 03 '18 at 13:41
  • basically if i paste the .jar file in my libs folder, nothing happens, so i cannot call `import` as seen [here](https://i.stack.imgur.com/qMAjy.png) – marvinsxtr Jul 03 '18 at 14:49

2 Answers2

2

Adding the .jar library to 'libs' folder should work. make sure you have synced project with gradle files.. in File>Sync Project With Gradle Files

0

I ran the gradlew.bat file, which gave me the following Exception:

Exception in thread "main" java.lang.RuntimeException: Could not determine wrapper version.at
org.gradle.wrapper.GradleWrapperMain.wrapperVersion(GradleWrapperMain.java:111)at 
org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)Caused by: 
java.lang.RuntimeException: No build receipt resource found.at 
org.gradle.wrapper.GradleWrapperMain.wrapperVersion(GradleWrapperMain.java:97)... 1 more

which brought me to this answer and indeed i had used an ! in my project name. Removing it somehow solved the problem.

marvinsxtr
  • 101
  • 2
  • 9