1buildscript { 2 // Simple helper that allows the root project to override versions declared by this library. 3 ext.safeExtGet = { prop, fallback -> 4 rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 5 } 6 7 repositories { 8 google() 9 mavenCentral() 10 } 11 12 dependencies { 13 classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.6.10')}") 14 } 15} 16apply plugin: 'com.android.application' 17apply plugin: 'kotlin-android' 18 19android { 20 compileSdkVersion safeExtGet("compileSdkVersion", 31) 21 22 compileOptions { 23 sourceCompatibility JavaVersion.VERSION_11 24 targetCompatibility JavaVersion.VERSION_11 25 } 26 27 kotlinOptions { 28 jvmTarget = JavaVersion.VERSION_11.majorVersion 29 } 30 31 defaultConfig { 32 applicationId 'host.exp.exponent' 33 minSdkVersion safeExtGet("minSdkVersion", 21) 34 targetSdkVersion safeExtGet("targetSdkVersion", 31) 35 // ADD VERSIONS HERE 36 // BEGIN VERSIONS 37 versionCode 161 38 versionName '2.22.3' 39 // END VERSIONS 40 41 multiDexEnabled true 42 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 43 // Deprecated. Used by net.openid:appauth 44 manifestPlaceholders = [ 45 'appAuthRedirectScheme': 'host.exp.exponent' 46 ] 47 } 48 dexOptions { 49 javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g" 50 } 51 52 signingConfigs { 53 debug { 54 storeFile file('../debug.keystore') 55 } 56 release { 57 storeFile file(System.getenv("ANDROID_KEYSTORE_PATH") ?: "release-key.jks") 58 storePassword System.getenv("ANDROID_KEYSTORE_PASSWORD") 59 keyAlias System.getenv("ANDROID_KEY_ALIAS") 60 keyPassword System.getenv("ANDROID_KEY_PASSWORD") 61 } 62 } 63 buildTypes { 64 debug { 65 debuggable true 66 } 67 release { 68 minifyEnabled true 69 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 70 consumerProguardFiles 'proguard-rules.pro' 71 if (!System.getenv("ANDROID_UNSIGNED")) { 72 signingConfig signingConfigs.release 73 } 74 } 75 } 76 // WHEN_DISTRIBUTING_REMOVE_FROM_HERE 77 // WHEN_PREPARING_SHELL_REMOVE_FROM_HERE 78 flavorDimensions "versioning" 79 productFlavors { 80 versioned { 81 dimension "versioning" 82 manifestPlaceholders = [appLabel:"@string/versioned_app_name"] 83 } 84 unversioned { 85 dimension "versioning" 86 getIsDefault().set(true) 87 manifestPlaceholders = [appLabel: "@string/unversioned_app_name"] 88 } 89 } 90 // WHEN_PREPARING_SHELL_REMOVE_TO_HERE 91 // WHEN_DISTRIBUTING_REMOVE_TO_HERE 92 93 // `productFlavors` must be defined before this block 94 defaultConfig { 95 if (android.productFlavors.empty) { 96 // when preparing shell app, the above flavor declarations are removed 97 // this falls back :expoview to versioned flavor 98 missingDimensionStrategy 'versioning', 'versioned' 99 manifestPlaceholders = [appLabel:"@string/versioned_app_name"] 100 } 101 } 102 103 lintOptions { 104 abortOnError false 105 } 106 packagingOptions { 107 // libfbjni.so is prebuilt library shared between all ABIs 108 pickFirst "lib/**/libfbjni.so" 109 } 110} 111 112configurations.all { 113 resolutionStrategy { 114 force 'org.webkit:android-jsc:r245459' 115 } 116} 117 118dependencies { 119 implementation fileTree(dir: 'libs', include: ['*.jar']) 120 121 implementation 'androidx.multidex:multidex:2.0.0' 122 123 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.6.10')}" 124 125 // Our dependencies 126 implementation ('androidx.appcompat:appcompat:1.3.1') { 127 // Workaround for https://github.com/expo/expo/issues/17372 128 // Remove this version pinning when we drop sdk 44 129 version { 130 strictly '1.3.1' 131 } 132 } 133 134 // Our dependencies from ExpoView 135 // DON'T ADD ANYTHING HERE THAT ISN'T IN EXPOVIEW. ONLY COPY THINGS FROM EXPOVIEW TO HERE. 136 implementation ('androidx.appcompat:appcompat:1.3.1') { 137 // Workaround for https://github.com/expo/expo/issues/17372 138 // Remove this version pinning when we drop sdk 44 139 version { 140 strictly '1.3.1' 141 } 142 } 143 compileOnly 'org.glassfish:javax.annotation:3.1.1' 144 implementation 'com.jakewharton:butterknife:10.2.1' 145 implementation 'de.greenrobot:eventbus:2.4.0' 146 147 implementation 'com.squareup.picasso:picasso:2.5.2' 148 implementation 'com.google.android.gms:play-services-analytics:16.0.1' 149 implementation 'com.google.android.gms:play-services-maps:18.0.0' 150 implementation 'com.google.android.gms:play-services-auth:15.0.1' 151 implementation 'com.google.android.gms:play-services-location:15.0.1' 152 debugImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1' 153 // debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.4-beta1' 154 releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1' 155 implementation 'com.facebook.device.yearclass:yearclass:2.1.0' 156 implementation 'commons-io:commons-io:1.4' 157 implementation 'me.leolin:ShortcutBadger:1.1.4@aar' 158 implementation 'com.github.CanHub:Android-Image-Cropper:1.1.1' 159 implementation 'commons-codec:commons-codec:1.10' 160 implementation 'com.segment.analytics.android:analytics:4.3.0' 161 implementation 'com.google.zxing:core:3.3.3' 162 implementation 'net.openid:appauth:0.4.1' 163 implementation 'com.airbnb.android:lottie:3.4.0' 164 implementation('io.nlopez.smartlocation:library:3.2.11') { 165 transitive = false 166 } 167 implementation "androidx.exifinterface:exifinterface:1.0.0" 168 implementation 'com.squareup.okio:okio:1.9.0' 169 implementation 'com.facebook.soloader:soloader:0.8.2' 170 implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava' 171 172 // expo-file-system 173 implementation 'com.squareup.okhttp3:okhttp:3.10.0' 174 implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0' 175 176 // Testing 177 androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' 178 androidTestImplementation 'androidx.test:runner:1.4.0' 179 androidTestImplementation "androidx.annotation:annotation:1.3.0" 180 androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.0' 181 androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' 182 androidTestImplementation 'com.azimolabs.conditionwatcher:conditionwatcher:0.2' 183 184 androidTestImplementation 'junit:junit:4.12' 185 androidTestImplementation 'org.mockito:mockito-core:1.10.19' 186 testImplementation 'org.robolectric:robolectric:3.8' 187 androidTestImplementation 'androidx.test:runner:1.4.0' 188 androidTestImplementation 'androidx.test:rules:1.4.0' 189 190 testImplementation 'androidx.test:runner:1.4.0' 191 testImplementation 'androidx.test:rules:1.4.0' 192 testImplementation 'junit:junit:4.12' 193 testImplementation 'org.mockito:mockito-core:1.10.19' 194 195 /* UNCOMMENT WHEN DISTRIBUTING 196 implementation('host.exp.exponent:expoview:45.0.0@aar') { 197 transitive = true 198 exclude group: 'com.squareup.okhttp3', module: 'okhttp' 199 exclude group: 'com.squareup.okhttp3', module: 'okhttp-urlconnection' 200 } 201 END UNCOMMENT WHEN DISTRIBUTING */ 202 203 // WHEN_DISTRIBUTING_REMOVE_FROM_HERE 204 205 // BEGIN_SDK_UNVERSIONED 206 implementation(project(':expoview')) 207 208 implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava' 209 // END_SDK_UNVERSIONED 210 211 // WHEN_PREPARING_SHELL_REMOVE_FROM_HERE 212 213 // ADD_NEW_SDKS_HERE 214 215 216 // BEGIN_SDK_45 217 versionedImplementation(project(':expoview-abi45_0_0')) 218 // END_SDK_45 219 220 221 // BEGIN_SDK_44 222 versionedImplementation(project(':expoview-abi44_0_0')) 223 // END_SDK_44 224 225 // This is not needed in shell apps, the Amplitude module will include this dep if installed 226 implementation 'com.amplitude:android-sdk:2.23.2' 227 228 // WHEN_PREPARING_SHELL_REMOVE_TO_HERE 229 // WHEN_DISTRIBUTING_REMOVE_TO_HERE 230 231 /* UNCOMMENT WHEN DISTRIBUTING 232 api 'org.webkit:android-jsc:r245459' // needs to be before react-native 233 api 'com.facebook.react:react-native:+' 234 END UNCOMMENT WHEN DISTRIBUTING */ 235 236 // WHEN_DETACHING_REMOVE_FROM_HERE 237 /* UNCOMMENT WHEN DISTRIBUTING 238 implementation project(':expo') 239 implementation 'host.exp.exponent:expo-random:+' 240 END UNCOMMENT WHEN DISTRIBUTING */ 241 // WHEN_DETACHING_REMOVE_TO_HERE 242} 243 244// This has to be down here for some reason 245apply plugin: 'com.google.gms.google-services' 246