googleads / googleads-consent-sdk-android

Consent SDK
https://developers.google.com/admob/android/eu-consent
Apache License 2.0
100 stars 82 forks source link

Many crasches "tgkill" in Google Play Console #51

Open SzymonDe opened 6 years ago

SzymonDe commented 6 years ago

Hi.

After adding the Consent SDK, the application displays errors in the Google Play console. Errors occur in about 2 per 1000 updates and apply only to European users.

I was able to make a similar error when I turned off the browser in my device. Then, after clicking the link to the Privacy policy (Google Partners or own link) in Consent Form, an error occurred.

I wonder if the Constent SDK should not check if the user has a web browser installed..

The error snapshots look like:

backtrace:

00 pc 000000000003a2e8 /system/lib/libc.so (tgkill+12)

01 pc 0000000000013739 /system/lib/libc.so (pthread_kill+52)

02 pc 0000000000014357 /system/lib/libc.so (raise+10)

03 pc 0000000000010c7d /system/lib/libc.so (__libc_android_abort+36)

04 pc 000000000000f1c4 /system/lib/libc.so (abort+4)

05 pc 00000000000374d3 /data/app/com.google.android.webview-2/lib/arm/libwebviewchromium.so

or..

backtrace:

00 pc 000000000004a948 /system/lib/libc.so (tgkill+12)

01 pc 00000000000480c3 /system/lib/libc.so (pthread_kill+34)

02 pc 000000000001dc4d /system/lib/libc.so (raise+10)

03 pc 0000000000019341 /system/lib/libc.so (__libc_android_abort+34)

04 pc 00000000000173a8 /system/lib/libc.so (abort+4)

05 pc 0000000000799ae3 /data/app/com.android.chrome-2/base.apk

I added the Google Analytics tracking code to onConsentFormError(String errorDescription) and caught the following errors:

errorDescription: com.android.webview.chromium.WebViewContentsClientAdapter$WebResourceErrorImpl@213a2fe

The error occurs regardless of the android version and the brand of the device.

I will be grateful for suggestions and information if someone has a similar problem.

Regards Szymon

CHXAIOGE commented 6 years ago

source code did not check or catch the exception. Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlString)); context.startActivity(browserIntent);

frankyxcs commented 6 years ago

i have the same problem too. do you think this is related to no browser is installed on the phone ??

there are so many problems and it seems that the google developer is not working since monday.. we got this sdk 2 days before ultimum and we have so many problems :( :( :(

CHXAIOGE commented 6 years ago

The stack is not relate to ActiviyNotFoundException. But the source code still have some bugs.So I customized the code. :). I think it's worth to do it for now.

SzymonDe commented 6 years ago

Hi. I was able to fix the problem using try-catch statement in ConsentForm.java.

private void handleOpenBrowser(String urlString) {
        if (TextUtils.isEmpty(urlString)) {
            listener.onConsentFormError("No valid URL for browser navigation.");
            return;
        }
        try {
            Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlString));
            context.startActivity(browserIntent);
        } catch (Exception e) {
            Toast.makeText(context, "Can not open the link. Visit: " + urlString, Toast.LENGTH_LONG).show();
        }
    }

I add also try-catch in my app source.

try {
     consentForm.show();
} catch (Exception e) {
      // ...........
}

These changes allowed me to reduce "tgkill" crasches to 0.

Regards Szymon Dyja

frankyxcs commented 6 years ago

Hi SzymonDe maybe your solution is not bad but then the consent form will never load on theses devices to get consent :(

frankyxcs commented 6 years ago

Hi i have still the same problem and crashes ! now on Sony Xperia X Compact (F5321), 3072MB RAM, Android 8.0

Is no one from google developers here willing to take a look at this problem ? Almost one week now nothing happened anymore here.

SnnYsf commented 5 years ago

where is a solution ?

Izzyjm commented 5 years ago

@SnnYsf I think it's fixed in the latest update