Class androidx.browser.customtabs.CustomTabsIntent does not exist?

Sorry to be so annoying, but my project isn’t compiling. The reason is that “package androidx.browser.customtabs does not exist”. However, it is right in the Google Developers documentation!

Just to be sure, I enabled AndroidX support.

My code:

package com.gordonlu.customtabs;

import android.content.Context;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import java.lang.Object;

import androidx.browser.customtabs.CustomTabsIntent;
import androidx.core.content.ContextCompat;


        version = 1,
        description = "A non-visible component that opens web pages as custom tabs on Google Chrome.",
        category = ComponentCategory.EXTENSION,
        nonVisible = true,
        iconName = "")

@SimpleObject(external = true)
@UsesLibraries(libraries = "")
@UsesPermissions(permissionNames = "")

public class CustomTabs extends AndroidNonvisibleComponent{

    //Activity and Context
    private Context context;
    private Activity activity;
    public String url = "";
    public int col = -16711936;

    public CustomTabs(ComponentContainer container){
        this.activity = container.$context();
        this.context = container.$context();

    @SimpleProperty(category = PropertyCategory.BEHAVIOR,
      description = "The URL to load in the custom tab. The URL must start with 'http://' or 'https://'.")
    public String URL() {
        return url;

    @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING,
      defaultValue = "")
    public void URL(String url) {
        this.url = url;

    @SimpleProperty(category = PropertyCategory.BEHAVIOR,
      description = "Specifies the color of the toolbar.")
    public int ToolbarColor() {
        return col;

    @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_INTEGER,
      defaultValue = "-16711936")
    public void ToolbarColor(int argb) {
        this.col = col;

    @SimpleFunction(description = "Use this block to open the custom tab.")
    public void OpenCustomTab() {
        CustomTabsIntent.Builder customIntent = new CustomTabsIntent.Builder();
        customIntent.setToolbarColor(ContextCompat.getColor(MainActivity.this, R.color.purple_200));
        openCustomTab(MainActivity.this,, Uri.parse(url));

    public static void OpenCustomTabOpenPage(Activity activity, CustomTabsIntent customTabsIntent, Uri uri) {
        String packageName = "";
        activity.startActivity(new Intent(Intent.ACTION_VIEW, uri));

Error message:

Started Compiling Project CustomTabs
Buildfile: /compiler/androidX/build.xml

[mkdir] Created dir: /compiler/androidX/build/HoWSX/classes
[javac] Compiling 1 source file to /compiler/androidX/build/HoWSX/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] Note: Wrote file file:/compiler/androidX/build/HoWSX/classes/simple_components.json
[javac] Note: Wrote file file:/compiler/androidX/build/HoWSX/classes/simple_components.txt
[javac] Note: Wrote file file:/compiler/androidX/build/HoWSX/classes/simple_components_build_info.json
[javac] Note: Wrote file file:/compiler/androidX/build/HoWSX/classes/
[javac] Note: Wrote file file:/compiler/androidX/build/HoWSX/classes/
[javac] /compiler/androidX/src/HoWSX/com/gordonlu/customtabs/ error: package androidx.browser.customtabs does not exist
[javac] import androidx.browser.customtabs.CustomTabsIntent;
[javac] ^
[javac] /compiler/androidX/src/HoWSX/com/gordonlu/customtabs/ error: cannot find symbol
[javac] public static void OpenCustomTabOpenPage(Activity activity, CustomTabsIntent customTabsIntent, Uri uri) {
[javac] ^
[javac] symbol: class CustomTabsIntent
[javac] location: class CustomTabs
[javac] 2 errors

What is the name of your project?
is your project name and class name the same?

It’s an easy-to-fix issue. It is due to some time Niotron doesn’t save the latest update what we do in the project.

For example: you added a component you are seeing in niotron web but when you try to build it it will be missing for niotron backend server.

This issue is most common in google chrome.

FIx is just clear cache of your browser and then add the component again

No, they are different.

I cleared the browser cache and compiled it again, but still the compilation failed.

Make both same and try again

I made them the same, still failed.

@Gordon_Lu I need permission from you to copy your code and can i try compiling it in Rush made by @Shreyash

Ok sure, you can.