hunk.code_window:     flatDir {
         dirs 'libs'
         // dirs project(':expoview').file('libs')
       }
       maven { url "https://jitpack.io" }
       maven {
         url 'https://maven.google.com'
       }
       // Want this last so that we never end up with a stale cache
       mavenLocal()
     }
   }
  
hunk.labels: keep keep keep keep keep replace replace replace keep keep keep keep keep
hunk.file_path: android/build.gradle
hunk.type: replace
file: apply plugin: 'com.android.library'
  apply plugin: 'maven'
  
  //maven repository info
  group = 'host.exp.exponent'
  version = '28.0.0'
  
  //Upload android library to maven with javadoc and android sources
  configurations {
    deployerJars
  }
  
  //Creating sources with comments
  task androidSourcesJar(type: Jar) {
    classifier = 'sources'
    from android.sourceSets.main.java.srcDirs
  }
  
  //Put the androidSources and javadoc to the artifacts
  artifacts {
    archives androidSourcesJar
  }
  
  uploadArchives {
    repositories {
      mavenDeployer {
        configuration = configurations.deployerJars
        repository(url: mavenLocal().url) {
          //if your repository needs authentication
          // authentication(userName: "username", password: "password")
        }
      }
    }
  }
  
  buildscript {
    repositories {
      maven { url 'https://maven.fabric.io/public' }
      maven { url "https://jitpack.io" }
      mavenCentral()
      jcenter()
    }
    dependencies {
      classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
    }
  }
  
  apply plugin: 'com.jakewharton.butterknife'
  
  import org.apache.tools.ant.taskdefs.condition.Os
  
  repositories {
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://jitpack.io" }
  }
  
  // Custom task for NDK module
  
  def getNdkBuildName() {
    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
      return "ndk-build.cmd"
    } else {
      return "ndk-build"
    }
  }
  
  def findNdkBuildFullPath() {
    // we allow to provide full path to ndk-build tool
    if (hasProperty('ndk.command')) {
      return property('ndk.command')
    }
    // or just a path to the containing directory
    if (hasProperty('ndk.path')) {
      def ndkDir = property('ndk.path')
      return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
    }
    if (System.getenv('ANDROID_NDK') != null) {
      def ndkDir = System.getenv('ANDROID_NDK')
      return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
    }
    def ndkDir = android.hasProperty('plugin') ? android.plugin.ndkFolder :
            plugins.getPlugin('com.android.library').hasProperty('sdkHandler') ?
                    plugins.getPlugin('com.android.library').sdkHandler.getNdkFolder() :
                    android.ndkDirectory.absolutePath
    if (ndkDir) {
      return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
    }
    return null
  }
  
  def getNdkBuildFullPath() {
    def ndkBuildFullPath = findNdkBuildFullPath()
    if (ndkBuildFullPath == null) {
      throw new GradleScriptException(
              "ndk-build binary cannot be found, check if you've set " +
                      "\$ANDROID_NDK environment variable correctly or if ndk.dir is " +
                      "setup in local.properties",
              null)
    }
    if (!new File(ndkBuildFullPath).canExecute()) {
      throw new GradleScriptException(
              "ndk-build binary " + ndkBuildFullPath + " doesn't exist or isn't executable.\n" +
                      "Check that the \$ANDROID_NDK environment variable, or ndk.dir in local.proerties, is set correctly.\n" +
                      "(On Windows, make sure you escape backslashes in local.properties or use forward slashes, e.g. C:\\\\ndk or C:/ndk rather than C:\\ndk)",
              null)
    }
    return ndkBuildFullPath
  }
  
  task buildExponentNdkLib(dependsOn: ':ReactAndroid:prepareJSC', type: Exec) {
    inputs.file('src/main/jni')
    inputs.file('../../cpp')
    outputs.dir("$buildDir/exponent-ndk/all")
    commandLine getNdkBuildFullPath(),
            'NDK_PROJECT_PATH=null',
            "NDK_APPLICATION_MK=$projectDir/src/main/jni/Application.mk",
            'NDK_OUT=' + temporaryDir,
            "NDK_LIBS_OUT=$buildDir/exponent-ndk/all",
            '-C', file('src/main/jni').absolutePath,
            '--jobs', Runtime.runtime.availableProcessors()
  }
  
  task cleanExponentNdkLib(type: Exec) {
    commandLine getNdkBuildFullPath(),
            '-C', file('src/main/jni').absolutePath,
            'clean'
  }
  
  task packageExponentNdkLibs(dependsOn: buildExponentNdkLib, type: Copy) {
    from "$buildDir/exponent-ndk/all"
    exclude '**/libjsc.so'
    exclude '**/libgnustl_shared.so'
    into "$buildDir/exponent-ndk/exported"
  }
  
  
  android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"
  
    defaultConfig {
      minSdkVersion 19
      targetSdkVersion 26
      versionCode 1
      versionName "1.0"
      ndk {
        abiFilters 'armeabi-v7a', 'x86'
      }
      manifestPlaceholders = [
        'appAuthRedirectScheme': 'host.exp.exponent'
      ]
    }
  
    // Use custom task for NDK module from above
    sourceSets.main {
      jni.srcDirs = []
      jniLibs.srcDir "$buildDir/exponent-ndk/exported"
    }
    tasks.withType(JavaCompile) {
      compileTask -> compileTask.dependsOn packageExponentNdkLibs
    }
    clean.dependsOn cleanExponentNdkLib
  
    flavorDimensions 'minSdk', 'remoteKernel'
    productFlavors {
      devKernel {
        dimension 'remoteKernel'
      }
      prodKernel {
        dimension 'remoteKernel'
      }
      devMinSdk {
        dimension 'minSdk'
        // dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
        // to pre-dex each module and produce an APK that can be tested on
        // Android Lollipop without time consuming dex merging processes.
        minSdkVersion 21
      }
      prodMinSdk {
        dimension 'minSdk'
        minSdkVersion 19
      }
    }
    buildTypes {
      debug {
        ext.enableCrashlytics = false
      }
      release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
    }
  }
  
  task generateDynamicMacros(type: Exec) {
    environment "EXPO_ANDROID_GRADLE_TASK_NAMES", "${gradle.startParameter.taskNames}"
    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
      // This gets run from the 'app' directory
      workingDir '../../tools-public'
      def command = 'gulp generate-dynamic-macros --buildConstantsPath ../android/expoview/src/main/java/host/exp/exponent/generated/ExponentBuildConstants.java --platform android'
      commandLine 'cmd.exe', '/c', command
    } else {
      commandLine '../../tools-public/generate-dynamic-macros-android.sh'
    }
  }
  preBuild.dependsOn generateDynamicMacros
  
  dependencies {
    api fileTree(dir: 'libs', include: ['*.jar'])
    api 'com.android.support:multidex:1.0.1'
  
    // Current react native
    api project(':ReactAndroid')
    /* UNCOMMENT WHEN DISTRIBUTING
    api 'com.facebook.react:react-native:28.0.0'
    END UNCOMMENT WHEN DISTRIBUTING */
  
    // Versioned react native
    // THIS COMMENT IS USED BY android-build-aar.sh DO NOT MODIFY
    api 'host.exp:reactandroid-abi28_0_0:1.0.0'
    api 'host.exp:reactandroid-abi27_0_0:1.0.0'
    api 'host.exp:reactandroid-abi26_0_0:1.0.0'
    api 'host.exp:reactandroid-abi25_0_0:1.0.0'
    api 'host.exp:reactandroid-abi24_0_0:1.0.0'
    api 'host.exp:reactandroid-abi23:1.0.0'
    api 'host.exp:reactandroid-abi22:1.0.0'
  
    // React native dependencies
    // We use a different version of appcompat
    api 'com.android.support:recyclerview-v7:27.1.1'
    api 'com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.0.0'
    api 'com.facebook.fresco:fresco:1.0.1'
    api 'com.facebook.fresco:animated-gif:1.0.1'
    api 'com.facebook.fresco:animated-webp:1.0.1'
    api 'com.facebook.fresco:webpsupport:1.0.1'
    api 'com.facebook.fresco:webpsupport:1.0.1'
    api 'expolib_v1.com.facebook.fresco:expolib_v1-imagepipeline-okhttp3:1.0.1'
    api 'com.facebook.stetho:stetho:1.3.1'
    api 'com.facebook.stetho:stetho-okhttp3:1.3.1'
    api 'com.facebook.soloader:soloader:0.1.0'
    api 'com.fasterxml.jackson.core:jackson-core:2.2.3'
    api 'com.google.code.findbugs:jsr305:3.0.0'
    api 'expolib_v1.com.squareup.okhttp3:okhttp:3.6.0'
    api 'expolib_v1.com.squareup.okhttp3:okhttp-urlconnection:3.6.0'
    api 'expolib_v1.com.squareup.okio:okio:1.13.0'
    api 'org.webkit:android-jsc:r174650'
  
    // Our dependencies
    api 'com.android.support:appcompat-v7:27.1.1'
    api 'com.android.support:customtabs:27.1.1'
    api 'com.android.support:cardview-v7:27.1.1'
    api('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
      transitive = true;
    }
    api 'com.facebook.android:facebook-android-sdk:4.28.0'
    api('com.facebook.android:audience-network-sdk:4.26.1') {
      exclude module: 'play-services-ads'
    }
    compileOnly 'org.glassfish:javax.annotation:3.1.1'
    api 'de.greenrobot:eventbus:2.4.0'
    api 'com.amplitude:android-sdk:2.9.2' // Be careful when upgrading! Upgrading might break experience scoping. Check with Jesse. See Analytics.resetAmplitudeDatabaseHelper
    api 'com.squareup.picasso:picasso:2.5.2'
    api 'com.google.android.gms:play-services-gcm:12.0.1'
    api 'com.google.android.gms:play-services-analytics:12.0.1'
    api 'com.google.android.gms:play-services-maps:12.0.1'
    api 'com.google.android.gms:play-services-auth:12.0.1'
    api 'com.google.android.gms:play-services-location:12.0.1'
    api 'com.google.android.gms:play-services-ads:12.0.1'
    api 'com.google.android.gms:play-services-fitness:12.0.1'
    api 'com.google.android.gms:play-services-vision:12.0.1'
    api 'com.google.android.gms:play-services-wallet:12.0.1' //may need 10.+
    api 'com.stripe:stripe-android:2.1.+'
    api 'com.github.thefuntasty:CreditCardEntry:1.4.8.4'
    annotationProcessor 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
    api "com.raizlabs.android:DBFlow-Core:2.2.1"
    api "com.raizlabs.android:DBFlow:2.2.1"
    api "com.madgag.spongycastle:core:1.53.0.0"
    api "com.madgag.spongycastle:prov:1.53.0.0"
    debugApi 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
    // debugApi 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
    releaseApi 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
    api 'com.facebook.device.yearclass:yearclass:1.0.1'
    api 'commons-io:commons-io:1.3.2'
    // Newer version introduces dependency versions conflict
    // on 'com.android.support:support-annotations'
    api 'com.google.android.exoplayer:exoplayer:r2.5.4'
    api 'me.leolin:ShortcutBadger:1.1.4@aar'
    api 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    api 'com.theartofdev.edmodo:android-image-cropper:2.4.7'
    api 'com.yqritc:android-scalablevideoview:1.0.1'
    api 'commons-codec:commons-codec:1.10'
    api 'com.segment.analytics.android:analytics:4.3.0'
    api 'com.google.zxing:core:3.3.2'
    api 'net.openid:appauth:0.4.1'
    api('com.airbnb.android:lottie:2.5.+') {
      exclude group: 'com.android.support', module: 'appcompat-v7'
    }
    api 'io.branch.sdk.android:library:2.17.1'
    api('io.nlopez.smartlocation:library:3.2.11') {
      transitive = false
    }
    api 'com.android.support:exifinterface:27.1.1'
    api 'com.google.android:cameraview:1.0.0'
    api 'com.google.firebase:firebase-core:12.0.1'
    api 'com.google.firebase:firebase-messaging:12.0.1'
    api 'com.google.maps.android:android-maps-utils:0.5+'
    api 'com.jakewharton:butterknife:8.4.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    /*api('com.gettipsi:stripeview:1.0.0') {
        transitive = false
        exclude group: 'com.facebook.react', module: 'react-native'
    }*/
    // Remember to update DetachAppTemplate build.gradle if you add any excludes or transitive = false here!
  }
  