1

https://github.com/kikoso/Swipeable-Cards

I haven't imported libraries before and I'm struggling to actually get it all working. Can somebody give me step by step instructions to properly import this library and get it working on Android studio, that would be great (starting from downloading the zip file).

Thanks!!

TheQ
  • 1,949
  • 10
  • 38
  • 63
  • 2
    http://stackoverflow.com/questions/16588064/how-do-i-add-a-library-project-to-the-android-studio – NovusMobile Jul 20 '15 at 08:30
  • And I'm here wondering how TheQ didn't find that. After all, typing "import library in android studio" yields the same result... Just out of curiosity, **how did you miss that ???** – 2Dee Jul 20 '15 at 08:35
  • 2Dee I did the: dependencies { compile 'com.github.kikoso:SwipeableCards:1.1-RELEASE@aar' } and i clicked the "sync" button, but then I got an error in my Android manifest saying. Error:(7, 9) Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:7:9 – TheQ Jul 20 '15 at 09:29
  • and Error:(7, 9) Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:7:9 is also present at com.github.kikoso:SwipeableCards:1.1-RELEASE:12:9 value=(@drawable/ic_launcher) Suggestion: add 'tools:replace="android:icon"' to element at AndroidManifest.xml:5:5 to override – TheQ Jul 20 '15 at 09:30
  • And when I do it the other way, manually install the library, after I do: compile project(":libs:Swipeable-Cards-master") i get: Error:Configuration with name 'default' not found. And I did both his 5.1 and 6.1 ways... – TheQ Jul 20 '15 at 09:40
  • there are a couple of build.gradle and settings.gradle. The ones I am using are for the app build.gradle and the very bottom of settings.gradle – TheQ Jul 20 '15 at 09:43
  • so I added: 1)settings.gradle (for overall app) include ':app', 'Swipeable-Cards-master' project(':Swipeable-Cards-master').projectDir = new File('libs/Swipeable-Cards-master') – TheQ Jul 20 '15 at 09:54
  • 2)build.gradle (for app) compile project(":Swipeable-Cards-master") and i get: Error:Configuration with name 'default' not found. – TheQ Jul 20 '15 at 09:55

2 Answers2

1

You can fix this by adding
xmlns:tools="http://schemas.android.com/tools" to manifest tag and adding this tools:replace="android:icon"to your application tag

Sumighosh Charuvil
  • 446
  • 1
  • 4
  • 14
0

I don't know if you still need the "how-to" guide but here it is:

Import using gradle

Go to your build.gradle (module app) file, there you will find the dependencies section. There you will paste the compile command.

compile 'com.github.kikoso:SwipeableCards:1.1-RELEASE@aar'

Android Studio then will tell you that the gradle files have changed since last sync and will give you in the upper corner a Sync now text. You just click it and everything will synchronize.

Artem Mostyaev
  • 3,874
  • 10
  • 53
  • 60