jellyfin-archive / jellyfin-android-original

Android Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
272 stars 65 forks source link

Support Android 4.4 #28

Open SenorSmartyPants opened 5 years ago

SenorSmartyPants commented 5 years ago

I know that Google's support for this version is dropping (dropped?) But it would be great as I have some 4.4 tablets.

I have no idea how much work it would be to continue to support 4.4.

Thank you for all your efforts on jellyfin.

SenorSmartyPants commented 5 years ago

I downloaded all versions of the 0.9.0 release from https://repo.jellyfin.org/releases/client/android/

None of them will install. I get a Parse error. "There was a problem parsing the package."

I also followed the new link to the play store. It reports that my 4.4 device is not compatible with the app.

z3ntu commented 4 years ago

I've just tried to launch the app on a Android 4.4 KitKat emulator but unfortunately it looks like the Jellyfin JavaScript code isn't compatible with the old webview provided by Android 4.4.

D/SystemWebChromeClient( 2336): file:///android_asset/www/plugins/org.jellyfin.mobile/www/apphost.js: Line 89 : Uncaught SyntaxError: Unexpected token =
I/chromium( 2336): [INFO:CONSOLE(89)] "Uncaught SyntaxError: Unexpected token =", source: file:///android_asset/www/plugins/org.jellyfin.mobile/www/apphost.js (89)
D/SystemWebChromeClient( 2336): file:///android_asset/www/plugins/cordova-plugin-chromecast/chrome.cast.js: Line 800 : Uncaught SyntaxError: Unexpected strict mode reserved word
I/chromium( 2336): [INFO:CONSOLE(800)] "Uncaught SyntaxError: Unexpected strict mode reserved word", source: file:///android_asset/www/plugins/cordova-plugin-chromecast/chrome.cast.js (800)
D/SystemWebChromeClient( 2336): file:///android_asset/www/cordova.js: Line 1324 : Uncaught Error: Module cordova-plugin-chromecast.ChromecastApi does not exist.
I/chromium( 2336): [INFO:CONSOLE(1324)] "Uncaught Error: Module cordova-plugin-chromecast.ChromecastApi does not exist.", source: file:///android_asset/www/cordova.js (1324)
D/CordovaWebViewImpl( 2336): onPageFinished(file:///android_asset/www/index.html)
D/SystemWebChromeClient( 2336): file:///android_asset/www/bundle.js?v=9: Line 539 : Uncaught SyntaxError: <unknown message reserved_word>
I/chromium( 2336): [INFO:CONSOLE(539)] "Uncaught SyntaxError: <unknown message reserved_word>", source: file:///android_asset/www/bundle.js?v=9 (539)
I/jdwp    ( 2293): Ignoring second debugger -- accepting and dropping
D/SystemWebChromeClient( 2336): file:///android_asset/www/cordova.js: Line 1205 : deviceready has not fired after 5 seconds.
I/chromium( 2336): [INFO:CONSOLE(1205)] "deviceready has not fired after 5 seconds.", source: file:///android_asset/www/cordova.js (1205)
D/SystemWebChromeClient( 2336): file:///android_asset/www/cordova.js: Line 1198 : Channel not fired: onPluginsReady
I/chromium( 2336): [INFO:CONSOLE(1198)] "Channel not fired: onPluginsReady", source: file:///android_asset/www/cordova.js (1198)
D/SystemWebChromeClient( 2336): file:///android_asset/www/cordova.js: Line 1198 : Channel not fired: onCordovaReady
I/chromium( 2336): [INFO:CONSOLE(1198)] "Channel not fired: onCordovaReady", source: file:///android_asset/www/cordova.js (1198)
diff --git a/config.xml b/config.xml
index e90a866ee..cab9d4584 100644
--- a/config.xml
+++ b/config.xml
@@ -19,7 +19,7 @@
     <preference name="KeyboardDisplayRequiresUserAction" value="false" />
     <icon src="res/icon.png" />
     <platform name="android">
-        <preference name="android-minSdkVersion" value="21" />
+        <preference name="android-minSdkVersion" value="19" />
         <preference name="android-targetSdkVersion" value="28" />
         <preference name="BackgroundColor" value="0x00000000" />
         <icon density="ldpi" src="res/android/ldpi/icon.png" />

I found a similar problem on StackOverflow and it appears that using Babel could solve this, but I personally don't have enough web & npm knowledge to try that ;)

dkanada commented 4 years ago

@z3ntu at the time we weren't sure if there were other issues. We have a pull request open right now for CoreJS support so you could maybe run some tests after that gets merged.

JustAMan commented 4 years ago

Is this fixed by https://github.com/jellyfin/jellyfin-web/pull/862 ?

z3ntu commented 4 years ago

It seems to be a different error now

D/WebViewCallback( 1823): onConsoleMessage: Uncaught SyntaxError: Unexpected identifier
D/SystemWebChromeClient( 1823): file:///android_asset/www/plugins/org.jellyfin.mobile/www/apphost.js: Line 89 : Uncaught SyntaxError: Unexpected identifier
I/chromium( 1823): [INFO:CONSOLE(89)] "Uncaught SyntaxError: Unexpected identifier", source: file:///android_asset/www/plugins/org.jellyfin.mobile/www/apphost.js (89)
D/WebViewCallback( 1823): onConsoleMessage: Uncaught SyntaxError: Unexpected token {
D/SystemWebChromeClient( 1823): file:///android_asset/www/plugins/cordova-plugin-chromecast/chrome.cast.js: Line 799 : Uncaught SyntaxError: Unexpected token {
I/chromium( 1823): [INFO:CONSOLE(799)] "Uncaught SyntaxError: Unexpected token {", source: file:///android_asset/www/plugins/cordova-plugin-chromecast/chrome.cast.js (799)
D/WebViewCallback( 1823): onConsoleMessage: Uncaught Error: Module cordova-plugin-chromecast.ChromecastApi does not exist.
D/SystemWebChromeClient( 1823): file:///android_asset/www/cordova.js: Line 1324 : Uncaught Error: Module cordova-plugin-chromecast.ChromecastApi does not exist.
I/chromium( 1823): [INFO:CONSOLE(1324)] "Uncaught Error: Module cordova-plugin-chromecast.ChromecastApi does not exist.", source: file:///android_asset/www/cordova.js (1324)

And line 89 of ./platforms/android/app/src/main/assets/www/plugins/org.jellyfin.mobile/www/apphost.js is let container = item.Container; so I assume it doesn't like the let keyword

z3ntu commented 4 years ago

Okay so I've added

diff --git a/package.json b/package.json
index 090d98f4b..be6dca72c 100644
--- a/package.json
+++ b/package.json
@@ -97,6 +97,7 @@
     "last 2 Safari versions",
     "last 2 iOS versions",
     "last 2 Edge versions",
+    "Android 4.4",
     "Chrome 27",
     "Chrome 38",
     "Chrome 47",

to the jellyfin-web repo and rebuilt again. Now it seems to complain about dependencies not being transpiled essentially

D/WebViewCallback( 2288): onConsoleMessage: Uncaught SyntaxError: Use of const in strict mode.
D/SystemWebChromeClient( 2288): file:///android_asset/www/bundle.js?v=1: Line 27 : Uncaught SyntaxError: Use of const in strict mode.
I/chromium( 2288): [INFO:CONSOLE(27)] "Uncaught SyntaxError: Use of const in strict mode.", source: file:///android_asset/www/bundle.js?v=1 (27)

I'm not really sure what I'm doing but it doesn't feel like progress :man_shrugging: Some help please? :)

JustAMan commented 4 years ago

paging @MrTimscampi for gulp and babel help