crosswalk-project / cordova-plugin-crosswalk-webview

Crosswalk WebView Cordova Plugin (UNMAINTAINED)
https://crosswalk-project.org/blog/crosswalk-final-release.html
Apache License 2.0
946 stars 350 forks source link

TextureView doesn't support displaying a background drawable #110

Open mtshare opened 7 years ago

mtshare commented 7 years ago

Since ionic browser has been removed i installed this plugin without any issue. Yesterday i tried my app on Android N i noticed that it crashes on start.

Any suggestions?

Here is the crash log:

02-16 10:37:51.971 10209 10209 E AndroidRuntime: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.UnsupportedOperationException: TextureView doesn't support displaying a background drawable
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.ReflectMethod.invoke(ReflectMethod.java:67)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.XWalkCoreWrapper.handlePostInit(XWalkCoreWrapper.java:129)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.XWalkLibraryLoader.finishInit(XWalkLibraryLoader.java:182)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.XWalkActivityDelegate.onActivateCompleted(XWalkActivityDelegate.java:171)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:349)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:317)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at android.os.AsyncTask.finish(AsyncTask.java:660)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at android.os.AsyncTask.-wrap1(AsyncTask.java)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:677)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:154)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6209)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
02-16 10:37:51.971 10209 10209 E AndroidRuntime: Caused by: java.lang.RuntimeException: java.lang.UnsupportedOperationException: TextureView doesn't support displaying a background drawable
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.ReflectConstructor.newInstance(ReflectConstructor.java:54)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.XWalkView.reflectionInit(XWalkView.java:2082)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.ReflectMethod.invoke(ReflectMethod.java:61)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    ... 14 more
02-16 10:37:51.971 10209 10209 E AndroidRuntime: Caused by: java.lang.UnsupportedOperationException: TextureView doesn't support displaying a background drawable
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at android.view.TextureView.setBackgroundDrawable(TextureView.java:302)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at android.view.View.setBackground(View.java:18187)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at android.view.View.setBackgroundColor(View.java:18149)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.chromium.content.browser.ContentViewRenderView.initTextureView(ContentViewRenderView.java:68)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.chromium.content.browser.ContentViewRenderView.<init>(ContentViewRenderView.java:145)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.internal.XWalkContent$2.<init>(XWalkContent.java:191)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.internal.XWalkContent.setNativeContent(XWalkContent.java:191)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.internal.XWalkContent.<init>(XWalkContent.java:151)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.internal.XWalkViewInternal.initXWalkContent(XWalkViewInternal.java:383)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.internal.XWalkViewBridge.<init>(XWalkViewBridge.java:72)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at java.lang.reflect.Constructor.newInstance0(Native Method)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    at org.xwalk.core.ReflectConstructor.newInstance(ReflectConstructor.java:48)
02-16 10:37:51.971 10209 10209 E AndroidRuntime:    ... 17 more
02-16 10:37:51.971 10209 10209 D AppTracker: App Event: crash
JochemR commented 7 years ago

Got the same issue. It seems to be a known problem with Crosswalk: https://crosswalk-project.org/jira/browse/XWALK-7214 Changing my targetSdkVersion from 24 back to 23 fixed it for me.

mtshare commented 7 years ago

@JochemR Thank you so much! Changing my targetSdkVersion worked for me too. đź‘Ť

graphefruit commented 7 years ago

@JochemR Thank you so much! You saved my entire day.

JochemR commented 7 years ago

Glad I could be of help!

okarakose commented 6 years ago

Downgrading targetSdkVersion is not a correct way to solve this problem. I am still using same way to avoid UnsupportedOperationException but Google finally decides to this :

In the second half of 2018, Play will require that new apps and app updates target a recent Android API level. This will be required for new apps in August 2018, and for updates to existing apps in November 2018. This is to ensure apps are built on the latest APIs optimized for security and performance.

August 2018: New apps required to target API level 26 (Android 8.0) or higher. November 2018: Updates to existing apps required to target API level 26 or higher. 2019 onwards: Each year the targetSdkVersion requirement will advance. Within one year following each Android dessert release, new apps and app updates will need to target the corresponding API level or higher.

https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html

so, if this problem not solved with a real solution, we can't update or publish our apps on Google Play Store.

marulka commented 6 years ago

Removing totally the targetSdkVersion from the Manifest file worked for me.

kmudov commented 6 years ago

As already mentioned by @okarakose we will not be able to update or publish our apps on Google Play Store. Finding real solution is critical.

Here is Google Play Store schedule: August 2018: New apps required to target API level 26 (Android 8.0) or higher. November 2018: Updates to existing apps required to target API level 26 or higher.

mhueserNDR commented 6 years ago

Hi, Im facing the same problem. Has anybody made any progress on this or a workaround with/without crosswalk?

ArMouReR commented 6 years ago

Same here. Do we have any solution to this problem ? Can't update my App because of current Google restrictions.

bonbonez commented 5 years ago

Same here, I have (as all of us) to at least targetSdkVersion 26 (in accordance with google play policy), but this blocker doesn't allow me to do that. Thanks for any help with that!

paramtrivedi commented 5 years ago

I tried all other alternatives to keep using crosswalk but I think it's time to switch back to Android Webview since it is in a mature state. My project is working well with targetSdkVersion 28.

To remove crosswalk - 1) ionic browser remove crosswalk 2) cordova plugin remove cordova-plugin-crosswalk-webview

PS - I have not yet verified what is the impact of the update from crosswalk to webview for local storage. I will provide more results tomorrow.

ArMouReR commented 5 years ago

Same here. I have removed crosswalk from our App and everything looks good. Needed only to set windowSoftInputMode to adjustPan.

rcha103 commented 5 years ago

Any update on this? I'm also experiencing the same issue. I have a mobile app which pretty much relies on this plugin as one of the core functionalities.

saki1010 commented 5 years ago

background="@null" is work for me, targetSdkVersion 26

chr4ss1 commented 5 years ago

@saki1010 could you elaborate more?

NivedhaL20 commented 5 years ago

@okarakose yeah, downgrading the targetSdkVersion might be the temporary solution unless we upload it in PlayStore. Is this issue due to CROSSWALK-WEBVIEW plugin ? Can anyone tell the real solution..??

NivedhaL20 commented 5 years ago

The issue is due to Crosswalk Webview plugin. In config.xml, set preference name="xwalkVersion" and value as "23+"

AEfremov commented 5 years ago

@nivebiju where is config.xml destination?