Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

net: ERR_UNKNOWN_URL_SCHEME with targetSdkVersion 30 #180

Closed
3 tasks done
benmesza opened this issue Oct 6, 2021 · 11 comments
Closed
3 tasks done

net: ERR_UNKNOWN_URL_SCHEME with targetSdkVersion 30 #180

benmesza opened this issue Oct 6, 2021 · 11 comments

Comments

@benmesza
Copy link

benmesza commented Oct 6, 2021

Bug Report

Problem

Use auth0 in Ionic cordova app, and when user sign in to app successfully cannot redirect to app because net: ERR_UNKNOWN_URL_SCHEME error. targetSdkVersion 29 was worked, but when upgrade to 30 get this error on Android 11 platform, but works on Android 10.

What is expected to happen?

Successfully redirect to app on Android 11

What does actually happen?

Get net: ERR_UNKNOWN_URL_SCHEME error.

Information

Command or Code

Auth0 integration

Environment, Platform, Device

Android 11

Version information

Cordova CLI: 10.0.0
Cordova platform: Cordova-Android 10.1.1
Frameworks: Ionic 5 with Angular 12.1.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@brassier
Copy link

brassier commented Nov 5, 2021

Hello -
We are seeing similar issues. Any suggestions or direction on this?
Thanks -

@cels
Copy link

cels commented Nov 8, 2021

Hi,
same problem here as it seems.
Any ideas for a quick fix?

Unfortunately it is no longer possible to build for sdk29 since 1st of November...

@alexneats
Copy link

alexneats commented Nov 10, 2021

There is a cordova-plugin-safariviewcontroller v2.0.1 (current is v2.0.0) that hasn't yet been merged that contains the fix for this issue. In the meantime, adding this to the end of my AndroidManifest.xml gets my app around this issue:

<queries> <intent> <action android:name="android.support.customtabs.action.CustomTabsService" /> </intent> </queries>

@alexneats
Copy link

@ciromart
Copy link

ciromart commented Nov 14, 2021

Ok guys i have temporarily resolved this issue before release of fixed plugin cordova-plugin-safariviewcontroller v2.0.1.

Thanks to @alexneats for suggestion.
You need to put this:

 <queries>
        <intent>
            <action android:name="android.support.customtabs.action.CustomTabsService" />
        </intent>
    </queries>

in AndroidManifest.xml (attention, this block must be placed outside the tag <application>).
If command ionic cordova build android return an error like this: C:\Users\folder\platforms\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:134: AAPT: error: une
you probably update your gradle version to > 3.3.0 (for me 3.5.4 is ok).
NOTE : gradle version must be updated in build.gradle file located under path
platforms\android\app\build.gradle and/or platforms\android\build.gradle
from

dependencies {
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

        classpath 'com.android.tools.build:gradle:3.3.0'
    }

to

 dependencies {
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

        classpath 'com.android.tools.build:gradle:3.5.4'
    }

You probably have an error also in this case, cause is necessary update distributionUrl located in gradle-wrapper.properties for updated gradle.
I suggest to use this:
distributionUrl=https://services.gradle.org/distributions/gradle-5.4.1-all.zip for gradle 3.5.4
After this changes ionic cordova build android works fine and problem fixed!!!!

@AnupDhariaMariswamy
Copy link

Thank you! You are awesome!

@cels
Copy link

cels commented Nov 16, 2021

If you don't want to manually edit your AndroidManifest.xml (e.g. clean automated builds via some CI) you can add this to your <platform name="android" ... section in your config.xml:

<edit-config file="app/src/main/AndroidManifest.xml" mode="add" target="/manifest/queries" xmlns:android="http://schemas.android.com/apk/res/android">
    <intent>
        <action android:name="android.support.customtabs.action.CustomTabsService" />
    </intent>
</edit-config>

The plugin cordova-custom-config might be required, I'm not entirely sure as this is just meant as a quick note to other people struggling. :-)

@anandbhaskaran
Copy link

We would love to see this fixed. For now, we are using the solution from @cels and it works well.

@vairam07
Copy link

It showing an error
{
"original": {
"crossDomain": true,
"method": "POST",
"url": "https://acredit.auth0.com/oauth/token"
},
"code": null,
"description": null,
"name": "Error"
}

@jcperuffo
Copy link

Having the same problem here with Android 11 and 12 (Ionic V3, Angular 5, Cordova 10.0.0) and the solution from @cels and @ciromart worked. I did not changed the graddle classpath (mine here is 'com.android.tools.build:gradle:4.0.0').

Thank you all!

@stevehobbsdev
Copy link
Contributor

Thanks @cels and @ciromart - looks like a good workaround 👍🏻 I've pinned this issue for visibility.

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

No branches or pull requests

10 participants