My Android app features an activity where a script is injected into a WebView after a XHTML page is loaded from disk (not the internet).
The app was originally targeted at API level 12 and compiled to the same SDK level, but I had to update it and new rules made me target API level 26.
I also compiled to various SDK level like 17, 19 because I had to use the @JavascriptInterface annotation on public methods of an object that allows the script to call methods that are in Java code.
What I experience is that the WebView is stuck because an error occurs "Uncaught SyntaxError: Unexpected end of input" (no further information with Chrome remote debugging) and this just happens if I test the app on an Android 7 device, while the app works on a Android 4 device even if its API level is not targeted or compiled to.
I read many answers about syntax errors leading to this kind of error, or commented lines in the code, but it is very strange because the old device has no problems and the app works very well.
I tried many combinations in the gradle file.
Is there any other possibility to consider to have my app working?