eltos / SimpleDialogFragments

An Android library to create dialogs with ease and handle user interaction reliably, using fragments and material design.
Apache License 2.0
119 stars 17 forks source link

Adding to gradel causes chrome to crash #21

Closed SirSaunders closed 6 years ago

SirSaunders commented 6 years ago

Steps to reproduce

  1. add compile 'com.github.eltos:simpledialogfragment:2.2.1' at module level
  2. open run with an app with a recylerView with a webview, causes chrome to crash
  3. removing from gradle and chrome does not crash (I also removed all web components, imports, and web view, and it still happened - not sure why)

Expected and actual behaviour

Expected: To be able to run an activity without chrome crashing (yes chrome, not my app). Behavior: Chrome crashes when added"com.github.eltos:simpledialogfragment" is added to project

Test Environment

. Version
Library supportLibVersion = '26.1.0'
Android 19 -17

Stack Trace

01-17 02:01:24.824 1915-1916/? E/ANDR-PERF-OPTSHANDLER: Warning: Resource [2, 0] not supported for core 1. Instead use resource for core 0
01-17 02:01:24.824 1915-1916/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [2, 2, 0]
01-17 02:01:30.632 18729-18729/? E//system/bin/webview_zygote32: Failed to make and chown /acct/uid_99164: Permission denied
01-17 02:01:30.633 18729-18729/? E/Zygote: createProcessGroup(99164, 0) failed: Permission denied
01-17 02:01:30.696 18756-18756/? E/asset: setgid: Operation not permitted
01-17 02:01:30.771 18729-18729/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: com.android.chrome:sandboxed_process0, PID: 18729
                                                   android.content.res.Resources$NotFoundException: Array resource ID #0x7f03000a
                                                       at android.content.res.Resources.obtainTypedArray(Resources.java:618)
                                                       at android.content.res.Resources.preloadFonts(Resources.java:380)
                                                       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5769)
                                                       at android.app.ActivityThread.-wrap1(Unknown Source:0)
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
                                                       at android.os.Handler.dispatchMessage(Handler.java:106)
                                                       at android.os.Looper.loop(Looper.java:164)
                                                       at android.app.ActivityThread.main(ActivityThread.java:6494)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
                                                       at com.android.internal.os.WebViewZygoteInit.main(WebViewZygoteInit.java:146)
SirSaunders commented 6 years ago

The issue does not appear to be affecting Version 1.1. I also believe it is actually not caused by the Web view, as I removed everything involving any Web View references and it still persisted. I beleive it has to do with textView's android:autoLink="all" When this is on and set to all or web it Chrome crashes, when removed it runs as expected.

eltos commented 6 years ago

What you are describing seems weird, I might have an idea, though. Could you paste your complete build.gradle file here or leave a link to your repo, so I can check it?

SirSaunders commented 6 years ago
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'

allprojects {
    repositories {
        mavenCentral()
        maven {
            url 'https://oss.sonatype.org/content/repositories/snapshots/'
        }
    }
}
ext {
    supportLibVersion = '26.1.0'
    fireBaseVersion = '11.4.2'
    firebaseUIVersion = '3.1.0'
}
android {
    signingConfigs {
        config {
            keyAlias 'AndroidMessenger'
            keyPassword '6'
            storeFile file('/home/johnathan/Documents/AndroidMessenger/AndroidMessenger/AndroidMessenger.jks')
            storePassword 'Test1234'
        }
    }
    compileSdkVersion 26
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId "us.mordor.AndroidMessenger"
        minSdkVersion 23
        targetSdkVersion 26
        versionCode 96
        versionName '1.6'
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        signingConfig signingConfigs.config
        multiDexEnabled true

        resConfigs "auto"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}
dependencies {
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
        compile "com.google.firebase:firebase-database:$fireBaseVersion"
        compile "com.google.firebase:firebase-storage:$fireBaseVersion"
        compile "com.google.firebase:firebase-auth:$fireBaseVersion"
        compile "com.google.firebase:firebase-perf:$fireBaseVersion"
        compile "com.google.firebase:firebase-crash:$fireBaseVersion"
        compile "com.google.firebase:firebase-messaging:$fireBaseVersion"
        compile "com.google.firebase:firebase-auth:$fireBaseVersion"
        compile "com.google.firebase:firebase-config:$fireBaseVersion"

        compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.3'
        compile 'de.hdodenhof:circleimageview:2.1.0'
        compile 'com.klinkerapps:android-smsmms:4.2.3'
        compile 'com.squareup.picasso:picasso:2.5.2'
        compile 'com.github.bumptech.glide:glide:3.7.0'

        compile 'com.github.chrisbanes:PhotoView:2.0.0'

        compile "com.android.support:support-v4:$supportLibVersion"
        compile "com.android.support:support-v13:$supportLibVersion"
        compile "com.android.support:cardview-v7:$supportLibVersion"
        compile "com.android.support:customtabs:$supportLibVersion"
        compile "com.android.support:support-emoji:$supportLibVersion"
        compile "com.android.support:support-emoji-appcompat:$supportLibVersion"
        compile "com.android.support:support-emoji-bundled:$supportLibVersion"
        //color picker
        compile 'com.github.eltos:simpledialogfragment:1.1'

        // FirebaseUI Database only
        compile "com.firebaseui:firebase-ui-database:firebaseUIVersion"

        // FirebaseUI Auth only
        compile "com.firebaseui:firebase-ui-auth:firebaseUIVersion"

        // FirebaseUI Storage only
        compile "com.firebaseui:firebase-ui-storage:firebaseUIVersion"

        // Single target that includes all FirebaseUI libraries above
        compile "com.firebaseui:firebase-ui:$firebaseUIVersion"

        debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
        releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
        testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'

        compile 'com.android.support:multidex:1.0.1'

    })
    compile "com.android.support:appcompat-v7:$supportLibVersion"
    compile "com.android.support:design:$supportLibVersion"
    testCompile 'junit:junit:4.12'
    compile "com.google.firebase:firebase-appindexing:$fireBaseVersion"
}
apply plugin: 'com.google.gms.google-services

Yeah I spent several hours tracking it down.

eltos commented 6 years ago

So here is my guess: I'd say the android:autoLink Attribute triggers some underlying method calls to Crome or Zygote. There – for what ever reason – a resource ID #0x7f03000a is needen but cannot be found thus causing the crash. I'd asume, this has to do with the different Support library version: You are using:

compile "com.android.support:appcompat-v7:26.1.0"
compile "com.android.support:design:26.1.0"

My library uses:

compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:design:25.1.1'

I remember having had a similar problem with support library versions and gcm a while ago.

I'd suggest you to play around with these version codes, change the order of the compile calls of my library and the support library in the buid file and using the following command to exclude implicit compiles:

compile ('com.github.eltos:simpledialogfragment:2.2.1') {
    exclude module: 'appcompat-v7';
}

Back then I was able to solve the problem using the exclude command and compiling the support library at the end. I hope this helps.

eltos commented 6 years ago

Did any of my suggestions solve the issue @SirSaunders?