0

Hi I'musing android studio and I'm trying to get a YouTube video to play on my app. I've imported the api to the libs folder but every time i run the app it gives me the error: no main manifest attribute, in D:\Users\Work\AndroidStudioProjects\Tutorial\app\libs\YouTubeAndroidPlayerApi.jar.

I've checked the file and it does have a manifest.mf file, don't know whats wrong any help would be appreciated

  • Welcome to SO! See this discussion, one of many for this type of error. https://stackoverflow.com/questions/9689793/cant-execute-jar-file-no-main-manifest-attribute. In your case, Java is apparently trying to execute the given .jar file, but the .jar file is not designed to be a runnable jar, i.e., it does not have a "Main" attribute in it's manifest file, so Java doesn't know what main class to execute. – Alessandro Scarlatti May 28 '20 at 00:41
  • One question you should likely ask is whether or not YouTubeAndroidPlayerApi.jar is intended to be used as an executable .jar or not. Typically an API .jar file is placed on the classpath and the classes it contains are utilized within your code, but the .jar is not invoked directly. – Alessandro Scarlatti May 28 '20 at 00:45
  • Does this answer your question? https://stackoverflow.com/questions/9689793/cant-execute-jar-file-no-main-manifest-attribute – Alessandro Scarlatti May 28 '20 at 01:15
  • I just installed the Api and deleted all code that was associated with the youtube api. Downloaded the file again followed the tutorial again and it worked. Don't know what i did wrong but at least it works, Thanks for the help. – Skyknightw19 May 28 '20 at 12:29

0 Answers0