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

Cannot find symbol CustomTabsIntent #64

Open
kyle-n opened this issue Mar 21, 2020 · 1 comment
Open

Cannot find symbol CustomTabsIntent #64

kyle-n opened this issue Mar 21, 2020 · 1 comment

Comments

@kyle-n
Copy link

kyle-n commented Mar 21, 2020

Hello,

I have been struggling with a bug. I found a solution, but I am not sure why it works.

When I would run ./gradlew bundleRelease, I would get an error:

TabsModule.java:9: error: cannot find symbol import android.support.customtabs.CustomTabsIntent;

My android/gradle.properties looked like:

`android.useAndroidX=true

android.enableJetifier=true

MYAPP_UPLOAD_STORE_FILE={{keystore_here}}

MYAPP_UPLOAD_KEY_ALIAS={{alias_here}}

MYAPP_UPLOAD_STORE_PASSWORD={{password_here}}

MYAPP_UPLOAD_KEY_PASSWORD={{password_here}}

org.gradle.jvmargs=-XX:MaxHeapSize=512m -Xmx512m`

The solution was to open /node_modules/react-native-custom-tabs/android/src/main/java/com/github/droibit/android/reactnative/customtabs/CustomTabsModule.java and delete the line:

import android.support.customtabs.CustomTabsIntent;

and replace it with:

import androidx.browser.customtabs.CustomTabsIntent;

I got the idea looking at the Android documentation page for CustomTabsIntent, which notes that it is deprecated in favor of AndroidX. This is the documentation page for the AndroidX custom tabs package I used.

My questions:

  1. Why does this fix work?
  2. Is this repo still maintained? If so, would you all like a PR for this fix? I ask because I don't know if this fix is a good idea (I don't know why it works!)
@mratyunjaytr
Copy link

yes I think PR for fix is required

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

2 participants