Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cordova-plugin-browsertab is no longer maintained #12

Open
dlebee opened this issue Jul 6, 2021 · 5 comments
Open

cordova-plugin-browsertab is no longer maintained #12

dlebee opened this issue Jul 6, 2021 · 5 comments

Comments

@dlebee
Copy link

dlebee commented Jul 6, 2021

Hello,

it seems cordova-plugin-browsertab is no longer maintained according to

google/cordova-plugin-browsertab#39

They propose to use a different plugin in the issue

https://github.com/TobyEb/cordova-plugin-colored-browser-tabs


On android capacitor build it creates this issue

/Users/davidlebee/Dev/Thygeson/thygeson-app/android/capacitor-cordova-android-plugins/src/main/java/com/google/cordova/plugin/BrowserTab.java:21: error: cannot find symbol
import android.support.customtabs.CustomTabsIntent;
                                 ^
  symbol:   class CustomTabsIntent
  location: package android.support.customtabs
@CarlosDez23
Copy link

Hey @dlebee could u fix your issue?

@dlebee
Copy link
Author

dlebee commented Aug 3, 2021

@CarlosDez23 Hi carlos the issue is still there, but there is a way if you are using Capacitor 3 to specify the plugins you want to include for a specific platform.

{
  "appId": "com.lebee.thygeson",
  "appName": "thygeson",
  "webDir": "www",
  "bundledWebRuntime": false,
  "android": {
    "includePlugins": [
      "@capacitor/app",
      "@capacitor/haptics",
      "@capacitor/keyboard",
      "@capacitor/status-bar",
      "ionic-plugin-deeplinks"
    ]
  }
}

this allows me to exclude the plugin cordova-plugin-browsertab from android and successfully build.

@CarlosDez23
Copy link

Thanks mate! If you are still in problems (is my case) with keycloak auth, I will be testing this package (a basic openid client for angular): https://github.com/damienbod/angular-auth-oidc-client

@Nivani
Copy link

Nivani commented Aug 24, 2022

What worked for me is to use patch-package to update import android.support.customtabs.CustomTabsIntent; to import androidx.browser.customtabs.CustomTabsIntent in https://github.com/google/cordova-plugin-browsertab/blob/master/plugin/src/android/BrowserTab.java

This is the patch file:
cordova-plugin-browsertab+0.2.0.patch

diff --git a/node_modules/cordova-plugin-browsertab/src/android/BrowserTab.java b/node_modules/cordova-plugin-browsertab/src/android/BrowserTab.java
index 5f8e56a..0aeda0a 100644
--- a/node_modules/cordova-plugin-browsertab/src/android/BrowserTab.java
+++ b/node_modules/cordova-plugin-browsertab/src/android/BrowserTab.java
@@ -18,7 +18,7 @@ import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.net.Uri;
-import android.support.customtabs.CustomTabsIntent;
+import androidx.browser.customtabs.CustomTabsIntent;
 import android.util.Log;
 
 import java.util.Iterator;

I've seen other people with similar problems with react-native suggest using jetifier, but did not try it myself.

@athyla
Copy link

athyla commented Oct 27, 2022

I have tried Jetifier recently, although being deprecated, it still makes cordova-plugin-browsertab usable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants