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

Hybrid app cant run on Samsung Galaxy 5 or 6

本文关键字:运行 Galaxy 三星 应用程序 混合      更新时间:2023-09-26

我目前在play store上有一个混合应用程序(the Stylita),它可以在不同的平台上完美运行,直到加载到三星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;
    }
}

这将允许您的混合应用程序再次工作:)