From 86c18a54895b824fc83a30486ab373783a9a99ea Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Wed, 3 Jun 2020 19:23:09 +0200 Subject: [PATCH] chore: update android native project to cap 2 --- android/app/build.gradle | 8 ++++---- android/app/src/main/AndroidManifest.xml | 2 +- .../app/src/main/res/layout/activity_main.xml | 4 ++-- android/app/src/main/res/xml/config.xml | 5 +++-- .../build.gradle | 16 ++++++++++------ .../cordova.variables.gradle | 2 +- .../src/main/AndroidManifest.xml | 2 +- android/gradle.properties | 2 ++ 8 files changed, 24 insertions(+), 17 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index ee1225c..7c8cafb 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -8,7 +8,7 @@ android { targetSdkVersion 28 versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } buildTypes { release { @@ -29,11 +29,11 @@ repositories { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'androidx.appcompat:appcompat:1.0.0' implementation project(':capacitor-android') testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' implementation project(':capacitor-cordova-android-plugins') } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index eb5f15e..0eca287 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -31,7 +31,7 @@ diff --git a/android/app/src/main/res/layout/activity_main.xml b/android/app/src/main/res/layout/activity_main.xml index 03c6eed..b5ad138 100644 --- a/android/app/src/main/res/layout/activity_main.xml +++ b/android/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,5 @@ - - + diff --git a/android/app/src/main/res/xml/config.xml b/android/app/src/main/res/xml/config.xml index 82219bf..1b1b0e0 100644 --- a/android/app/src/main/res/xml/config.xml +++ b/android/app/src/main/res/xml/config.xml @@ -1,5 +1,6 @@ - + - \ No newline at end of file + + \ No newline at end of file diff --git a/android/capacitor-cordova-android-plugins/build.gradle b/android/capacitor-cordova-android-plugins/build.gradle index a5a876d..304a4c3 100644 --- a/android/capacitor-cordova-android-plugins/build.gradle +++ b/android/capacitor-cordova-android-plugins/build.gradle @@ -1,20 +1,24 @@ +ext { + cordovaAndroidVersion = project.hasProperty('cordovaAndroidVersion') ? rootProject.ext.cordovaAndroidVersion : '7.0.0' +} + buildscript { repositories { - jcenter() google() + jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.6.1' } } apply plugin: 'com.android.library' android { - compileSdkVersion 28 + compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 29 defaultConfig { - minSdkVersion 21 - targetSdkVersion 28 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21 + targetSdkVersion targetSdkVersion = project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 29 versionCode 1 versionName "1.0" } @@ -38,7 +42,7 @@ repositories { dependencies { implementation fileTree(dir: 'src/main/libs', include: ['*.jar']) - implementation 'org.apache.cordova:framework:7.0.0' + implementation "org.apache.cordova:framework:$cordovaAndroidVersion" // SUB-PROJECT DEPENDENCIES START // SUB-PROJECT DEPENDENCIES END diff --git a/android/capacitor-cordova-android-plugins/cordova.variables.gradle b/android/capacitor-cordova-android-plugins/cordova.variables.gradle index e9d4176..68a95df 100644 --- a/android/capacitor-cordova-android-plugins/cordova.variables.gradle +++ b/android/capacitor-cordova-android-plugins/cordova.variables.gradle @@ -1,6 +1,6 @@ // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN ext { - cdvMinSdkVersion = 21 + cdvMinSdkVersion = project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21 // Plugin gradle extensions can append to this to have code run at the end. cdvPluginPostBuildExtras = [] } \ No newline at end of file diff --git a/android/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml b/android/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml index b57606e..0f88b77 100644 --- a/android/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml +++ b/android/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ - + diff --git a/android/gradle.properties b/android/gradle.properties index aac7c9b..9e6fce1 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -9,6 +9,8 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. +android.enableJetifier=true +android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode.