Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebView errors #11

Closed
Aiosa opened this issue Dec 21, 2017 · 9 comments
Closed

WebView errors #11

Aiosa opened this issue Dec 21, 2017 · 9 comments
Labels

Comments

@Aiosa
Copy link

Aiosa commented Dec 21, 2017

Hi again,

this Webview is having a lot of errors, simply by launching it. Even with try-out code from either "Adding to your XML Layout" or "Adding at runtime". Just adding this into app causes:

W/art: Attempt to remove non-JNI local reference, dumping thread
W/chromium: [WARNING:resource_bundle.cc(285)] locale_file_path.empty()
E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
E/BluetoothAdapter: Bluetooth binder is null
E/DataReductionProxySettingListener: No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp
W/art: Attempt to remove non-JNI local reference, dumping thread
W/AwContents: onDetachedFromWindow called when already detached. Ignoring
D/KhanAcademyKatexView: Hex Color:#000000
W/chromium: [WARNING:data_reduction_proxy_config.cc(423)] SPDY proxy OFF at startup


        [ 12-21 21:26:51.490  3641: 3708 D/         ]
        HostConnection::get() New Host Connection established 0x9c7e0f90, tid 3708
W/BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 3641
E/emuglGLESv2_enc: device/generic/goldfish-    opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glVertexAttribPointer:290 GL error 0x501

Any ideas?
Thanks

@lingarajsankaravelu
Copy link
Owner

lingarajsankaravelu commented Dec 29, 2017

@Aiosa Still now no idea on why this happening. I will have a look into the code and update you on the same by 10 AM IST tmrw.

@Aiosa
Copy link
Author

Aiosa commented Dec 29, 2017

@lingarajsankaravelu thanks a lot, I also tried kexanie's MathView, also based on webview and got the same errors. What if some Android Studio settings or version causes those errors? Or maybe some android version, on my phone it works like charm, but on my friend's phone it crashes every time. I have android 7 MIUI (xiaomi version), IDK what he has, but I can ask him..

Also, simply adding mathView into some XML file causes similar problem while rendering view, as described there both your and kexanie MathViews - same problems (although my emulator displays it correctly)

Main build.grandle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

Local grandle:

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "cz.education"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    testCompile 'junit:junit:4.12'
    compile 'com.github.ybq:Android-SpinKit:1.1.0'
    compile 'in.hourglass.mathrender:katexmathview:1.0'
    compile 'io.github.kexanie.library:MathView:0.0.6'
    compile 'com.google.android.gms:play-services-ads:11.0.4'

}

If you need any additional info, just tell me.
Thanks!

PS:
also tried to copy all the MathView class into app and using it from inside, after deleting all unnecessary -for me- things like set background color, set text color, and even all the settings with stylable, still got same errors. Even replacing loadBaseUrl with loadData (which only doesn't support \n) didn't solve anything so maybe the source of all of this is because of javascript files within HTML structure...

maybe some minor lead.. NO DRP KEY from stack overflow

@Aiosa
Copy link
Author

Aiosa commented Dec 31, 2017

Ok, tried once more, just adding simple webView inside activity caused all the errors as well. Idk why, last time I used webView everything worked just fine so I thought webview is OK, but trying out my old webview suddenly caused all the errors too, even though it was OK at times.
Adding xmlns:android="http://schemas.android.com/apk/res/android" inside XML tag solved:

W/BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 3641

But other errors are remaining...

Do you know why? All that changed was updating A Studio a bit, and now everything causes plenty of errors, even running simple examples (e.g. https://www.mkyong.com/android/android-webview-example/) - which should be fine..

But still, this doesn't apply for XML render error, that one are having many people even with kexanie MathView...
there: jianzhongli/MathView#29
and there: jianzhongli/MathView#38

Seems nobody knows a solution for this one...

@moliata
Copy link

moliata commented Jan 5, 2018

Please update to Android Studio v3, I also had a lot of errors when I was trying to use either of these libs on older version.

@Aiosa
Copy link
Author

Aiosa commented Jan 5, 2018

Ok, thanks. I already installed it - now need to solve all new errors with crossing from v2 to v3 (I have ASCI chars in my paths to grandle etc..). Still, why this app while trying to show MathView on my friend's phone shuts itself down? Shouldn't be based on my version of AndoidStudio, what's more, normally it displays you option to send errors to developer as a report, but this time nothing shows up. I will try it once again with new version and update you about it...

@moliata
Copy link

moliata commented Jan 5, 2018

@Aiosa sure, at least that fixed an issue for me.

@Aiosa
Copy link
Author

Aiosa commented Jan 6, 2018

Finally managed to run everything - now I have one instead of two EGL_BAD_DISPLAY, and nice flow of W/art:

W/cr_media: Requires BLUETOOTH permission
D/cr_Ime: [InputMethodManagerWrapper.java:30] Constructor
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
D/KhanAcademyKatexView: Hex Color:#000000
I/cr_Ime: ImeThread is not enabled.
E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es

                     [ 01-06 10:24:56.831  5962: 6003 D/         ]
                     HostConnection::get() New Host Connection established 0x9157aac0, tid 6003

W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 5962
E/AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/themes/style.css
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread

And XML layout error still persists..
(btw why it wants Bluetooth? I don't use it anywhere...)

... though all the java errors are because of WebView itself, so it shouldn't be MathView problem, however that XML error is a different matter.

(

The following classes could not be instantiated:
- katex.hourglass.in.mathlib.MathView (Open Class, Show Exception, Clear Cache)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE. If this is an unexpected error you can also try to build the project, then manually refresh the layout. Exception Details java.lang.NoSuchMethodError: katex.hourglass.in.mathlib.MathView.getSettings()Landroid/webkit/WebSettings;   at katex.hourglass.in.mathlib.MathView.configurationSettingWebView(MathView.java:82)   at katex.hourglass.in.mathlib.MathView.(MathView.java:39)   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)   at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:863)   at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
...

)

@moliata
Copy link

moliata commented Jan 6, 2018

Probably you are using old library's version or there is something else wrong, I can't replicate this

@lingarajsankaravelu
Copy link
Owner

I think the errors which the webview were throwing is mostly because of the emulator. When i try to debug and fix the issue. it was showing these errors in some emulators were host CPU/GPU is enabled and in real devices it never throw any errors. I have enabled hardware acceleration for the view for time being.

lingarajsankaravelu added a commit that referenced this issue May 3, 2019
@lingarajsankaravelu lingarajsankaravelu added this to the release v_1.0.1 milestone May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants