|
| 1 | +apply plugin: 'com.android.application' |
| 2 | + |
| 3 | +android { |
| 4 | + compileSdkVersion rootProject.ext.compileSdkVersion |
| 5 | + defaultConfig { |
| 6 | + applicationId "io.ionic.starter" |
| 7 | + minSdkVersion rootProject.ext.minSdkVersion |
| 8 | + targetSdkVersion rootProject.ext.targetSdkVersion |
| 9 | + versionCode 1 |
| 10 | + versionName "1.0" |
| 11 | + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| 12 | + aaptOptions { |
| 13 | + // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. |
| 14 | + // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 |
| 15 | + ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' |
| 16 | + } |
| 17 | + } |
| 18 | + buildTypes { |
| 19 | + release { |
| 20 | + minifyEnabled false |
| 21 | + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 22 | + } |
| 23 | + } |
| 24 | +} |
| 25 | + |
| 26 | +repositories { |
| 27 | + flatDir{ |
| 28 | + dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' |
| 29 | + } |
| 30 | +} |
| 31 | + |
| 32 | +dependencies { |
| 33 | + implementation fileTree(include: ['*.jar'], dir: 'libs') |
| 34 | + implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" |
| 35 | + implementation project(':capacitor-android') |
| 36 | + testImplementation "junit:junit:$junitVersion" |
| 37 | + androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" |
| 38 | + androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" |
| 39 | + implementation project(':capacitor-cordova-android-plugins') |
| 40 | +} |
| 41 | + |
| 42 | +apply from: 'capacitor.build.gradle' |
| 43 | + |
| 44 | +try { |
| 45 | + def servicesJSON = file('google-services.json') |
| 46 | + if (servicesJSON.text) { |
| 47 | + apply plugin: 'com.google.gms.google-services' |
| 48 | + } |
| 49 | +} catch(Exception e) { |
| 50 | + logger.warn("google-services.json not found, google-services plugin not applied. Push Notifications won't work") |
| 51 | +} |
0 commit comments