From ed51e93a1da05bf4db70f3b98eb9879b9283c92e Mon Sep 17 00:00:00 2001 From: Priyank Date: Sun, 13 Oct 2019 02:18:44 -0400 Subject: [PATCH 1/8] Add AndroidX support --- .../app/src/main/res/layout/activity_main.xml | 4 ++-- android-template/gradle.properties | 4 ++++ .../java/com/getcapacitor/BridgeActivity.java | 4 +++- .../main/java/com/getcapacitor/Dialogs.java | 4 ++-- .../main/java/com/getcapacitor/Plugin.java | 6 ++++-- .../java/com/getcapacitor/plugin/Browser.java | 12 ++++++----- .../java/com/getcapacitor/plugin/Camera.java | 4 +++- .../java/com/getcapacitor/plugin/Modals.java | 20 +------------------ .../com/getcapacitor/plugin/Permissions.java | 5 +++-- .../plugin/PushNotifications.java | 4 +++- .../plugin/background/BackgroundTask.java | 4 ++-- .../background/BackgroundTaskService.java | 4 +++- .../plugin/camera/CameraUtils.java | 3 ++- .../LocalNotificationManager.java | 16 +++++++++------ .../getcapacitor/plugin/util/AssetUtil.java | 4 +++- .../ui/ModalsBottomSheetDialogFragment.java | 11 ++++++---- .../main/res/layout/bridge_layout_main.xml | 4 ++-- android/gradle.properties | 4 ++++ .../app/src/main/res/layout/activity_main.xml | 4 ++-- example/android/gradle.properties | 4 ++++ plugin-template/android/gradle.properties | 4 ++++ .../main/res/layout/bridge_layout_main.xml | 4 ++-- 22 files changed, 77 insertions(+), 56 deletions(-) diff --git a/android-template/app/src/main/res/layout/activity_main.xml b/android-template/app/src/main/res/layout/activity_main.xml index 03c6eedd96..b5ad138701 100644 --- a/android-template/app/src/main/res/layout/activity_main.xml +++ b/android-template/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,5 @@ - - + diff --git a/android-template/gradle.properties b/android-template/gradle.properties index aac7c9b461..2dbcb07109 100644 --- a/android-template/gradle.properties +++ b/android-template/gradle.properties @@ -15,3 +15,7 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true + +# Supports AndroidX +android.useAndroidX=true +android.enableJetifier=true \ No newline at end of file diff --git a/android/capacitor/src/main/java/com/getcapacitor/BridgeActivity.java b/android/capacitor/src/main/java/com/getcapacitor/BridgeActivity.java index 423bcc048a..ca85c4f935 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/BridgeActivity.java +++ b/android/capacitor/src/main/java/com/getcapacitor/BridgeActivity.java @@ -4,9 +4,11 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.webkit.WebView; + +import androidx.appcompat.app.AppCompatActivity; + import com.getcapacitor.android.R; import com.getcapacitor.cordova.MockCordovaInterfaceImpl; import com.getcapacitor.cordova.MockCordovaWebViewImpl; diff --git a/android/capacitor/src/main/java/com/getcapacitor/Dialogs.java b/android/capacitor/src/main/java/com/getcapacitor/Dialogs.java index 97bbf2e14f..8022e7c68f 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/Dialogs.java +++ b/android/capacitor/src/main/java/com/getcapacitor/Dialogs.java @@ -6,10 +6,10 @@ import android.content.DialogInterface; import android.os.Handler; import android.os.Looper; -import android.support.v4.app.ActivityCompat; -import android.support.v7.app.AppCompatActivity; import android.widget.EditText; +import androidx.appcompat.app.AppCompatActivity; + import com.getcapacitor.ui.ModalsBottomSheetDialogFragment; import org.json.JSONException; diff --git a/android/capacitor/src/main/java/com/getcapacitor/Plugin.java b/android/capacitor/src/main/java/com/getcapacitor/Plugin.java index cedd7c7b96..93f8062b83 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/Plugin.java +++ b/android/capacitor/src/main/java/com/getcapacitor/Plugin.java @@ -6,9 +6,11 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.os.Bundle; -import android.support.v4.app.ActivityCompat; -import android.support.v7.app.AppCompatActivity; import android.util.Log; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; + import org.json.JSONException; import org.json.JSONObject; diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/Browser.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/Browser.java index c7fac9a85a..9079528909 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/Browser.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/Browser.java @@ -5,12 +5,14 @@ import android.graphics.Color; import android.net.Uri; import android.os.Bundle; -import android.support.customtabs.CustomTabsCallback; -import android.support.customtabs.CustomTabsClient; -import android.support.customtabs.CustomTabsIntent; -import android.support.customtabs.CustomTabsServiceConnection; -import android.support.customtabs.CustomTabsSession; import android.util.Log; + +import androidx.browser.customtabs.CustomTabsCallback; +import androidx.browser.customtabs.CustomTabsClient; +import androidx.browser.customtabs.CustomTabsIntent; +import androidx.browser.customtabs.CustomTabsServiceConnection; +import androidx.browser.customtabs.CustomTabsSession; + import com.getcapacitor.JSArray; import com.getcapacitor.JSObject; import com.getcapacitor.NativePlugin; diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/Camera.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/Camera.java index ccdba058e5..99f43ee4b8 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/Camera.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/Camera.java @@ -9,9 +9,11 @@ import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; -import android.support.v4.content.FileProvider; import android.util.Base64; import android.util.Log; + +import androidx.core.content.FileProvider; + import com.getcapacitor.Dialogs; import com.getcapacitor.FileUtils; import com.getcapacitor.JSObject; diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/Modals.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/Modals.java index 21f1eb25f3..828e38efb5 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/Modals.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/Modals.java @@ -1,20 +1,7 @@ package com.getcapacitor.plugin; -import android.annotation.SuppressLint; import android.app.Activity; -import android.app.Dialog; -import android.graphics.Color; -import android.support.annotation.NonNull; -import android.support.design.widget.BottomSheetBehavior; -import android.support.design.widget.BottomSheetDialogFragment; -import android.support.design.widget.CoordinatorLayout; -import android.util.Log; -import android.view.View; -import android.view.Window; -import android.widget.LinearLayout; -import android.widget.TextView; - -import com.getcapacitor.Bridge; + import com.getcapacitor.Dialogs; import com.getcapacitor.JSArray; import com.getcapacitor.JSObject; @@ -24,11 +11,6 @@ import com.getcapacitor.PluginMethod; import com.getcapacitor.ui.ModalsBottomSheetDialogFragment; -import org.json.JSONException; -import org.json.JSONObject; - -import java.util.List; - /** * Common popup modals */ diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/Permissions.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/Permissions.java index 9d9efc1477..59ae8e20ef 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/Permissions.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/Permissions.java @@ -2,8 +2,9 @@ import android.Manifest; import android.content.pm.PackageManager; -import android.support.v4.app.NotificationManagerCompat; -import android.support.v4.content.ContextCompat; + +import androidx.core.app.NotificationManagerCompat; +import androidx.core.content.ContextCompat; import com.getcapacitor.JSObject; import com.getcapacitor.NativePlugin; diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/PushNotifications.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/PushNotifications.java index f958ddce8a..6dec03c352 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/PushNotifications.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/PushNotifications.java @@ -5,11 +5,13 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; -import android.support.v4.app.NotificationCompat; import android.net.Uri; import android.util.Log; + +import androidx.core.app.NotificationCompat; + import com.getcapacitor.Bridge; import com.getcapacitor.JSArray; import com.getcapacitor.JSObject; diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/background/BackgroundTask.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/background/BackgroundTask.java index 3be2d03917..c08c88a65a 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/background/BackgroundTask.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/background/BackgroundTask.java @@ -5,8 +5,8 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.support.v4.content.LocalBroadcastManager; -import android.util.Log; + +import androidx.localbroadcastmanager.content.LocalBroadcastManager; import com.getcapacitor.Bridge; import com.getcapacitor.JSObject; diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/background/BackgroundTaskService.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/background/BackgroundTaskService.java index 95ed6d2025..460da214f8 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/background/BackgroundTaskService.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/background/BackgroundTaskService.java @@ -2,8 +2,10 @@ import android.app.IntentService; import android.content.Intent; -import android.support.v4.content.LocalBroadcastManager; import android.util.Log; + +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + import com.getcapacitor.LogUtils; public class BackgroundTaskService extends IntentService { diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/camera/CameraUtils.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/camera/CameraUtils.java index 31a6c546e8..4789c84cfa 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/camera/CameraUtils.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/camera/CameraUtils.java @@ -3,9 +3,10 @@ import android.app.Activity; import android.net.Uri; import android.os.Environment; -import android.support.v4.content.FileProvider; import android.util.Log; +import androidx.core.content.FileProvider; + import com.getcapacitor.LogUtils; import java.io.File; diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/notification/LocalNotificationManager.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/notification/LocalNotificationManager.java index effd3ca49b..d560343949 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/notification/LocalNotificationManager.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/notification/LocalNotificationManager.java @@ -10,12 +10,14 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.NotificationCompat; -import android.support.v4.app.NotificationManagerCompat; -import android.support.v4.app.RemoteInput; import android.util.Log; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.app.NotificationCompat; +import androidx.core.app.NotificationManagerCompat; +import androidx.core.app.RemoteInput; + import com.getcapacitor.JSObject; import com.getcapacitor.LogUtils; import com.getcapacitor.PluginCall; @@ -27,6 +29,8 @@ import java.util.Date; import java.util.List; +import static androidx.core.app.NotificationCompat.VISIBILITY_PRIVATE; + /** * Contains implementations for all notification actions */ @@ -161,7 +165,7 @@ private void buildNotification(NotificationManagerCompat notificationManager, Lo mBuilder.setSound(soundUri); } - mBuilder.setVisibility(Notification.VISIBILITY_PRIVATE); + mBuilder.setVisibility(VISIBILITY_PRIVATE); mBuilder.setOnlyAlertOnce(true); mBuilder.setSmallIcon(localNotification.getSmallIcon(context)); diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/util/AssetUtil.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/util/AssetUtil.java index 78392b795d..d38664649a 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/util/AssetUtil.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/util/AssetUtil.java @@ -8,8 +8,10 @@ import android.graphics.BitmapFactory; import android.net.Uri; import android.os.StrictMode; -import android.support.v4.content.FileProvider; import android.util.Log; + +import androidx.core.content.FileProvider; + import com.getcapacitor.LogUtils; import java.io.File; diff --git a/android/capacitor/src/main/java/com/getcapacitor/ui/ModalsBottomSheetDialogFragment.java b/android/capacitor/src/main/java/com/getcapacitor/ui/ModalsBottomSheetDialogFragment.java index 4a3c3c3e11..f3ef5b6108 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/ui/ModalsBottomSheetDialogFragment.java +++ b/android/capacitor/src/main/java/com/getcapacitor/ui/ModalsBottomSheetDialogFragment.java @@ -3,18 +3,21 @@ import android.annotation.SuppressLint; import android.app.Dialog; import android.graphics.Color; -import android.support.annotation.NonNull; -import android.support.design.widget.BottomSheetBehavior; -import android.support.design.widget.BottomSheetDialogFragment; -import android.support.design.widget.CoordinatorLayout; import android.util.Log; import android.view.View; import android.view.Window; import android.widget.LinearLayout; import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.coordinatorlayout.widget.CoordinatorLayout; + import com.getcapacitor.JSArray; import com.getcapacitor.JSObject; import com.getcapacitor.LogUtils; +import com.google.android.material.bottomsheet.BottomSheetBehavior; +import com.google.android.material.bottomsheet.BottomSheetDialogFragment; + import org.json.JSONException; import org.json.JSONObject; diff --git a/android/capacitor/src/main/res/layout/bridge_layout_main.xml b/android/capacitor/src/main/res/layout/bridge_layout_main.xml index 1a6f336cd7..12f0b8fc88 100644 --- a/android/capacitor/src/main/res/layout/bridge_layout_main.xml +++ b/android/capacitor/src/main/res/layout/bridge_layout_main.xml @@ -1,5 +1,5 @@ - - + diff --git a/android/gradle.properties b/android/gradle.properties index aac7c9b461..2dbcb07109 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -15,3 +15,7 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true + +# Supports AndroidX +android.useAndroidX=true +android.enableJetifier=true \ No newline at end of file diff --git a/example/android/app/src/main/res/layout/activity_main.xml b/example/android/app/src/main/res/layout/activity_main.xml index 980b7ade86..f5d3888774 100644 --- a/example/android/app/src/main/res/layout/activity_main.xml +++ b/example/android/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,5 @@ - - + diff --git a/example/android/gradle.properties b/example/android/gradle.properties index aac7c9b461..2dbcb07109 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -15,3 +15,7 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true + +# Supports AndroidX +android.useAndroidX=true +android.enableJetifier=true \ No newline at end of file diff --git a/plugin-template/android/gradle.properties b/plugin-template/android/gradle.properties index aac7c9b461..2dbcb07109 100644 --- a/plugin-template/android/gradle.properties +++ b/plugin-template/android/gradle.properties @@ -15,3 +15,7 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true + +# Supports AndroidX +android.useAndroidX=true +android.enableJetifier=true \ No newline at end of file diff --git a/plugin-template/android/src/main/res/layout/bridge_layout_main.xml b/plugin-template/android/src/main/res/layout/bridge_layout_main.xml index b69e589a91..56fec1546a 100644 --- a/plugin-template/android/src/main/res/layout/bridge_layout_main.xml +++ b/plugin-template/android/src/main/res/layout/bridge_layout_main.xml @@ -1,5 +1,5 @@ - - + From 0c04e932bc7b7bab0bfef9b9e9db0b150c3f50c2 Mon Sep 17 00:00:00 2001 From: Priyank Date: Sun, 13 Oct 2019 03:36:33 -0400 Subject: [PATCH 2/8] Add gradle cli arguments for Androidx Support --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b94c9d0eba..674b2c277a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,7 @@ jobs: steps: - checkout - run: - command: ./gradlew clean build -b capacitor/build.gradle + command: ./gradlew clean build -b capacitor/build.gradle -Pandroid.useAndroidX=true -Pandroid.enableJetifier=true working_directory: /tmp/workspace/android workflows: From e6e45a1ea1df7ca639e49cc06e6d96309c1c5d88 Mon Sep 17 00:00:00 2001 From: Priyank Date: Fri, 25 Oct 2019 16:09:25 -0400 Subject: [PATCH 3/8] Replace test instrumentation/dependency for androidx support --- android/capacitor/build.gradle | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/android/capacitor/build.gradle b/android/capacitor/build.gradle index 360549b795..9d80153b30 100644 --- a/android/capacitor/build.gradle +++ b/android/capacitor/build.gradle @@ -21,7 +21,7 @@ android { targetSdkVersion 28 versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { @@ -42,14 +42,14 @@ repositories { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'androidx.appcompat:appcompat:1.0.0' implementation 'com.android.support:support-compat:28.0.0' implementation 'com.android.support:design:28.0.0' implementation 'com.android.support:customtabs:28.0.0' implementation 'com.google.firebase:firebase-messaging:18.0.0' 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 'org.apache.cordova:framework:7.0.0' } @@ -68,5 +68,3 @@ publish { desc = 'Capacitor Android Runtime' website = 'https://github.com/ionic-team/capacitor' } - - From 63d9ac3bcbb889822962052ab7ee6855dc2c5534 Mon Sep 17 00:00:00 2001 From: Priyank Date: Fri, 25 Oct 2019 16:22:45 -0400 Subject: [PATCH 4/8] Add androidx support for example --- android-template/app/build.gradle | 8 ++++---- android-template/app/src/main/AndroidManifest.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android-template/app/build.gradle b/android-template/app/build.gradle index cf041a62ac..0907faa153 100644 --- a/android-template/app/build.gradle +++ b/android-template/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-template/app/src/main/AndroidManifest.xml b/android-template/app/src/main/AndroidManifest.xml index de4589027e..9e28b68d49 100644 --- a/android-template/app/src/main/AndroidManifest.xml +++ b/android-template/app/src/main/AndroidManifest.xml @@ -32,7 +32,7 @@ From 79ad0e224137116354945335225bcf5ccf368457 Mon Sep 17 00:00:00 2001 From: Priyank Patel Date: Mon, 11 Nov 2019 14:00:20 -0500 Subject: [PATCH 5/8] Bump gradle wrapper, build tool, gms google service --- android-template/build.gradle | 4 ++-- android/capacitor/build.gradle | 2 +- android/gradle/wrapper/gradle-wrapper.properties | 2 +- capacitor-cordova-android-plugins/build.gradle | 2 +- example/android/build.gradle | 2 +- plugin-template/android/build.gradle | 3 +-- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/android-template/build.gradle b/android-template/build.gradle index 937411e8ff..c23144cdee 100644 --- a/android-template/build.gradle +++ b/android-template/build.gradle @@ -7,8 +7,8 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' - classpath 'com.google.gms:google-services:4.2.0' + classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'com.google.gms:google-services:4.3.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/android/capacitor/build.gradle b/android/capacitor/build.gradle index 9d80153b30..bdfec76d3d 100644 --- a/android/capacitor/build.gradle +++ b/android/capacitor/build.gradle @@ -4,7 +4,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.5.2' classpath 'com.novoda:bintray-release:0.9.1' } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index f715fac113..9bbaef5f88 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip diff --git a/capacitor-cordova-android-plugins/build.gradle b/capacitor-cordova-android-plugins/build.gradle index 759dfbfddf..78c474f930 100644 --- a/capacitor-cordova-android-plugins/build.gradle +++ b/capacitor-cordova-android-plugins/build.gradle @@ -4,7 +4,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.5.2' } } diff --git a/example/android/build.gradle b/example/android/build.gradle index 2c2f10b9ca..5c2fba5ae1 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.5.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/plugin-template/android/build.gradle b/plugin-template/android/build.gradle index a73bc99756..79cf85c081 100644 --- a/plugin-template/android/build.gradle +++ b/plugin-template/android/build.gradle @@ -4,7 +4,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.android.tools.build:gradle:3.5.2' } } @@ -44,4 +44,3 @@ dependencies { androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' } - From ffe7a5eee30b2f6c951018cb2c73f6d10c6ec33c Mon Sep 17 00:00:00 2001 From: Priyank Patel Date: Mon, 11 Nov 2019 14:28:22 -0500 Subject: [PATCH 6/8] Revert "Bump gradle wrapper, build tool, gms google service" This reverts commit 79ad0e224137116354945335225bcf5ccf368457. --- android-template/build.gradle | 4 ++-- android/capacitor/build.gradle | 2 +- android/gradle/wrapper/gradle-wrapper.properties | 2 +- capacitor-cordova-android-plugins/build.gradle | 2 +- example/android/build.gradle | 2 +- plugin-template/android/build.gradle | 3 ++- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/android-template/build.gradle b/android-template/build.gradle index c23144cdee..937411e8ff 100644 --- a/android-template/build.gradle +++ b/android-template/build.gradle @@ -7,8 +7,8 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.2' - classpath 'com.google.gms:google-services:4.3.2' + classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.google.gms:google-services:4.2.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/android/capacitor/build.gradle b/android/capacitor/build.gradle index bdfec76d3d..9d80153b30 100644 --- a/android/capacitor/build.gradle +++ b/android/capacitor/build.gradle @@ -4,7 +4,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'com.android.tools.build:gradle:3.3.2' classpath 'com.novoda:bintray-release:0.9.1' } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 9bbaef5f88..f715fac113 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip diff --git a/capacitor-cordova-android-plugins/build.gradle b/capacitor-cordova-android-plugins/build.gradle index 78c474f930..759dfbfddf 100644 --- a/capacitor-cordova-android-plugins/build.gradle +++ b/capacitor-cordova-android-plugins/build.gradle @@ -4,7 +4,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'com.android.tools.build:gradle:3.3.2' } } diff --git a/example/android/build.gradle b/example/android/build.gradle index 5c2fba5ae1..2c2f10b9ca 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'com.android.tools.build:gradle:3.3.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/plugin-template/android/build.gradle b/plugin-template/android/build.gradle index 79cf85c081..a73bc99756 100644 --- a/plugin-template/android/build.gradle +++ b/plugin-template/android/build.gradle @@ -4,7 +4,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'com.android.tools.build:gradle:3.3.2' } } @@ -44,3 +44,4 @@ dependencies { androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' } + From bd22ee59cf4d05ad88f6a23cab92f71e2e459be3 Mon Sep 17 00:00:00 2001 From: Priyank Patel Date: Wed, 12 Feb 2020 23:25:31 -0500 Subject: [PATCH 7/8] Fix androidx FileProvider import --- .../capacitor/src/main/java/com/getcapacitor/plugin/Share.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/Share.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/Share.java index d9c5d37537..70d8ab877d 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/Share.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/Share.java @@ -2,9 +2,10 @@ import android.content.Intent; import android.net.Uri; -import android.support.v4.content.FileProvider; import android.webkit.MimeTypeMap; +import androidx.core.content.FileProvider; + import com.getcapacitor.NativePlugin; import com.getcapacitor.Plugin; import com.getcapacitor.PluginCall; From f039aa10c114eeb7293272eb4fbffbe17a813874 Mon Sep 17 00:00:00 2001 From: Priyank Patel Date: Wed, 12 Feb 2020 23:25:53 -0500 Subject: [PATCH 8/8] Replace androidx artifact mappings --- android/capacitor/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/capacitor/build.gradle b/android/capacitor/build.gradle index 9d80153b30..305e367398 100644 --- a/android/capacitor/build.gradle +++ b/android/capacitor/build.gradle @@ -43,9 +43,9 @@ repositories { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.0.0' - implementation 'com.android.support:support-compat:28.0.0' - implementation 'com.android.support:design:28.0.0' - implementation 'com.android.support:customtabs:28.0.0' + implementation 'androidx.core:core:1.2.0' + implementation 'com.google.android.material:material:1.1.0-rc02' + implementation 'androidx.browser:browser:1.2.0' implementation 'com.google.firebase:firebase-messaging:18.0.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1'