繁体   English   中英

混合应用无法在三星Galaxy 5或6上运行

[英]Hybrid app cant run on Samsung Galaxy 5 or 6

我目前在Play商店(The Stylista)上有一个混合应用程序,可以在不同平台上完美运行,直到将其加载到Samsung Galaxy 5或6上。

该应用程序打开时出现白色屏幕,并且我的加载gif只是旋转,无法继续前进-我缺少什么吗? 应该添加代码吗?

我一直在研究,发现这是一个许可问题。

白屏和加载gif

答案是将此代码段添加到配置文件中:

<gap:config-file platform="android" parent="/manifest">
  <application android:debuggable="true" />
</gap:config-file>

然后,我能够在浏览器中进行调试-还可以使用新的android版本进行调试,在测试与Cordova的连接时,它没有返回Connection变量,因此由于未定义而失败。 您可以将代码更改为:

function getData(tableName, data, onSuccess) {
if (navigator && navigator.connection && navigator.connection.type) {
    var networkState = navigator.connection.type;
    if (navigator.connection.type == 'none') {
        showMessage("You don't appear to be connected to the internet. Please check your connection.");

        return;
    }
}

而不是默认值:

function getData(tableName, data, onSuccess) {
if (navigator && navigator.connection && navigator.connection.type) {
    var networkState = navigator.connection.type;
    if (networkState == Connection.NONE) {
        showMessage("You don't appear to be connected to the internet. Please check your connection.");

        return;
    }
}

这将使您的混合应用再次运行:)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM