build.gradle 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. apply plugin: 'com.android.application'
  2. android {
  3. namespace "com.example.app"
  4. compileSdk rootProject.ext.compileSdkVersion
  5. defaultConfig {
  6. applicationId "com.example.app"
  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. signingConfigs {
  19. release {
  20. storeFile file("f62.keystore")
  21. keyAlias "__uni__9c0e590"
  22. storePassword "LkSvN1Ys"
  23. keyPassword "LkSvN1Ys"
  24. }
  25. // IM证书
  26. // release {
  27. // storeFile file("1.keystore")
  28. // keyAlias "key0"
  29. // storePassword "123456"
  30. // keyPassword "123456"
  31. // }
  32. }
  33. buildTypes {
  34. release {
  35. signingConfig signingConfigs.release
  36. minifyEnabled false
  37. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  38. }
  39. }
  40. }
  41. repositories {
  42. flatDir{
  43. dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
  44. }
  45. }
  46. dependencies {
  47. implementation fileTree(include: ['*.jar'], dir: 'libs')
  48. implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
  49. implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
  50. implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
  51. implementation project(':capacitor-android')
  52. testImplementation "junit:junit:$junitVersion"
  53. androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
  54. androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
  55. implementation project(':capacitor-cordova-android-plugins')
  56. }
  57. apply from: 'capacitor.build.gradle'
  58. try {
  59. def servicesJSON = file('google-services.json')
  60. if (servicesJSON.text) {
  61. apply plugin: 'com.google.gms.google-services'
  62. }
  63. } catch(Exception e) {
  64. logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
  65. }