title: Android Studio, Gradle and Card.IO
body: <p>I am not sure how to get my project to build Card.IO with Gradle. My gradle file looks as follows:</p>
  
  <pre><code>buildscript {
      repositories {
          maven { url 'http://download.crashlytics.com/maven' }
      }
  
      dependencies {
          classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
      }
  }
  apply plugin: 'com.android.application'
  apply plugin: 'crashlytics'
  
  repositories {
      maven { url 'http://download.crashlytics.com/maven' }
  }
  
  
  android {
      compileSdkVersion 19
      buildToolsVersion "20.0.0"
  
      defaultConfig {
          applicationId "applicationId"
          minSdkVersion 16
          targetSdkVersion 19
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              runProguard false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:support-v4:20.0.0'
      compile 'com.crashlytics.android:crashlytics:1.+'
  }
  </code></pre>
  
  <p>My local.properties are as follows:</p>
  
  <pre><code>sdk.dir=/Applications/Android Studio.app/sdk
  ndk.dir=/Applications/Android Studio.app/android-ndk-r10b
  </code></pre>
  
  <p>And my Project structure is as follows:</p>
  
  <p><img src="https://i.stack.imgur.com/blBGz.png" alt="Quintin Card.IO Project structure"></p>
  
  <p>Now according to Card.IO (<a href="https://github.com/card-io/card.io-Android-SDK" rel="nofollow noreferrer">https://github.com/card-io/card.io-Android-SDK</a>) all I need to do is copy the files into the correct directory, but this is not working. </p>
  
  <p>I have also looked at the following posts:
  <a href="https://stackoverflow.com/questions/19688783/card-io-on-android-with-gradle">Card.IO on Android with Gradle</a>
  <a href="https://github.com/paypal/PayPal-Android-SDK/issues/26" rel="nofollow noreferrer">https://github.com/paypal/PayPal-Android-SDK/issues/26</a> - this suggests some extra gradle methods but does no work</p>
  
  <p>When I do this to my Gradle file:</p>
  
  <pre><code>buildscript {
      repositories {
          maven { url 'http://download.crashlytics.com/maven' }
      }
  
      dependencies {
          classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
      }
  }
  apply plugin: 'com.android.application'
  apply plugin: 'crashlytics'
  
  repositories {
      maven { url 'http://download.crashlytics.com/maven' }
  }
  
  
  android {
      compileSdkVersion 19
      buildToolsVersion "20.0.0"
  
      defaultConfig {
          applicationId "appId"
          minSdkVersion 16
          targetSdkVersion 19
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              runProguard false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
      sourceSets {
          main {
              jniLibs.srcDir 'src/main/libs'
              jni.srcDirs = [] //disable automatic ndk-build call
              java.srcDirs = ['src/main/java', 'src-gen/main/java']
              resources.srcDirs = ['src']
              aidl.srcDirs = ['src']
              renderscript.srcDirs = ['src']
              res.srcDirs = ['res']
              assets.srcDirs = ['assets']
          }
      }
      productFlavors {
          x86 {
              versionCode Integer.parseInt("6" + defaultConfig.versionCode)
              ndk {
                  abiFilter "x86"
              }
          }
          mips {
              versionCode Integer.parseInt("4" + defaultConfig.versionCode)
              ndk {
                  abiFilter "mips"
              }
          }
          armv7 {
              versionCode Integer.parseInt("2" + defaultConfig.versionCode)
              ndk {
                  abiFilter "armeabi-v7a"
              }
          }
          arm {
              versionCode Integer.parseInt("1" + defaultConfig.versionCode)
              ndk {
                  abiFilter "armeabi"
              }
          }
          fat
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:support-v4:20.0.0'
      compile 'com.crashlytics.android:crashlytics:1.+'
  }
  </code></pre>
  
  <p>Then Card.IO works, but I get the error: Crashlytics couldn't find the res folder specified in sourceSets.main.res, please make one. It picked: src/main/res.</p>
  
  <p>I am very sure my problem is just a misunderstanding on Gradle - I am new to it. But there are no up to date complete answers that I can look at.</p>