Skip to content

Cannot find symbol CustomTabsIntent #64

@kyle-n

Description

@kyle-n

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!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions