0

I am currently trying to import a library from github into my androidStudio project. Until now I had no problem with it, because there was always an exaplanation in the Readme on what exactly to include into my build.gradle. But for these libraries e.g.:

I have no idea how to include them in to my build.gradle to import them.

Best regards

Wonky
  • 13
  • 7
  • Does this answer your question? [Android studio - add library from github](https://stackoverflow.com/questions/32600325/android-studio-add-library-from-github) – Syn3sthete Feb 27 '20 at 11:07
  • I tried to to it like this, but when I include "compile project (':stickerview') into my build.gradle I get the error: ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :stickerview. I called the imported module stickerview. – Wonky Feb 27 '20 at 11:16
  • are you getting the error for https://github.com/nimengbo/StickerView project or both the projects? – Syn3sthete Feb 27 '20 at 11:22
  • It's the same problem for all libraries I try to include like that. If I try to use "implementatin ':stickerview' instead of the deperecated "compile", I get: ERROR: Failed to resolve: :stickerview: despite that I have the module in my project. – Wonky Feb 27 '20 at 11:23
  • check this you are trying to import a regular project as library project. Check this link: https://github.com/nimengbo/StickerView/blob/master/app/build.gradle The first line should be apply plugin: apply plugin: 'com.android.library' instead of 'com.android.application' – Syn3sthete Feb 27 '20 at 11:27
  • I changed the build.gradle(:stickerview) to apply plugin: 'com.android.library' and deleted the applicatinID (else it will get an error). But still when using implementation ':stickerview' in my build.gradle(:app) I get: ERROR: Failed to resolve: :stickerview: – Wonky Feb 27 '20 at 11:32
  • Alright it worked now using your library tip + using the deprecated compile method instead if implementatin. Thanks! – Wonky Feb 27 '20 at 11:37
  • Awesome, instead of compile try using implementation project(path: ':stickerview') replace stickerview with the name you gave to the module. So that there won't be any deprecated code in your project. – Syn3sthete Feb 27 '20 at 11:51

0 Answers0