与Samsung S5 Mini一起启动时未找到cordova.js

时间:2018-07-10 22:25:39

标签: android typescript cordova cordova-plugins html-framework-7

我正在尝试显示使用cordova-plugin-googlemaps生成的地图。 它似乎可以在较新的设备上运行,但不幸的是,不能在我的三星S5 Mini上运行。 到目前为止,我无法找到此问题的解决方案或解释。 如果有人可以给我关于这个问题的提示,我将非常高兴。

使用Framework7,Cordova,TS,JS和Require完全陌生。因此,也许我在做一些根本绝对错误的事情? :P

index.html的结尾:

<script type="text/javascript" src="./cordova.js"></script>
<script type="text/javascript" data-main="scripts/startup" src="lib/require.2.1.8.js" async></script>

startup.ts:

import * as Application from './application';
import { checkLogin } from "./loginManager";
import { initVirtualList} from "./virtualList";

declare var require: (modules: string[], ready: Function, errback: Function) => void;

// Try and load platform-specific code from the /merges folder.
// More info at http://taco.visualstudio.com/en-us/docs/configure-app/#Content.

declare var Framework7: any;
declare var routes: any;
export var app;

function initFramework7(): void {

   app = new Framework7({
    root: '#app', // App root element
    id: 'io.framework7.testapp', // App bundle ID
    name: 'Framework7', // App name
    theme: 'auto',
    // Automatic theme detection
    // App root data
    routes: routes

});

// Init/Create main view
var mainView = app.views.create('.view-main', {
    url: '/'
});

}


require(["./routes", "./platformOverrides"], () => {
initFramework7();
Application.initialize();
checkLogin();
initVirtualList("my-tasks", "Aufgabe", "id: ");
initVirtualList("find-grave", "Grab", "id: ");
},
() => alert("Initalising Error"));

application.ts:

"use strict";
import * as mm from "./mapManager";

export function initialize(): void {
document.addEventListener('deviceready', onDeviceReady, false);
}

function onDeviceReady(): void {
document.addEventListener('pause', onPause, false);
document.addEventListener('resume', onResume, false);

// TODO: Cordova has been loaded. Perform any initialization that requires Cordova here.

alert("Cordova Geladen");
mm.init();

}

function onPause(): void {

alert("Cordova Pause");
// TODO: This application has been suspended. Save application state here.
}

function onResume(): void {

alert("Cordova Resume");
// TODO: This application has been reactivated. Restore application state here.
}

mapManager.ts:

declare var Dom7;
declare var plugin:any


export function init(): void {

    Dom7(document).on('page:init', '.page[data-name="navigation"]', function (e)     {

    var div = document.getElementById("map");
    var map = plugin.google.maps.Map.getMap(div);

});
};

Project.properties:

target=android-23
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-googlemaps/myappa17616-tbxml-android.gradle
cordova.system.library.1=com.google.android.gms:play-services-maps:15.0.1
cordova.system.library.2=com.google.android.gms:play-services-location:15.0.1
cordova.system.library.3=com.android.support:support-core-utils:26.1.0

0 个答案:

没有答案