0

ST2 を使用して試用アプリを作成しました。ST2 のみを使用している間は問題なく動作しますが、PhoneGap を使用して Android エミュレーターでこのアプリを実行しようとすると、html5/JS ST2 ファイルの読み込みに失敗し、java.io がスローされるようです。 .FileNotFoundException: www/event/Dispatcher.js ...

結果 -> 白い画面

スタックトレース:

07-10 12:15:52.701: I/CordovaLog(536): Changing log level to DEBUG(3)
07-10 12:15:52.701: I/CordovaLog(536): Found preference for useBrowserHistory=false
07-10 12:15:52.711: D/CordovaLog(536): Found preference for useBrowserHistory=false
07-10 12:15:52.721: D/DroidGap(536): DroidGap.init()
07-10 12:15:52.771: I/dalvikvm(536): threadid=3: reacting to signal 3
07-10 12:15:52.841: D/CordovaWebView(536): >>>loadUrl(file:///android_asset/www/index.html)
07-10 12:15:52.841: D/PluginManager(536): init()
07-10 12:15:52.871: I/dalvikvm(536): Wrote stack traces to '/data/anr/traces.txt'
07-10 12:15:52.891: D/CordovaWebView(536): >>> loadUrlNow()
07-10 12:15:52.921: D/SoftKeyboardDetect(536): Ignore this event
07-10 12:15:53.011: W/webcore(536): java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.
07-10 12:15:53.011: W/webcore(536):     at android.webkit.WebViewCore$EventHub.removeMessages(WebViewCore.java:1683)
07-10 12:15:53.011: W/webcore(536):     at android.webkit.WebViewCore$EventHub.access$7900(WebViewCore.java:926)
07-10 12:15:53.011: W/webcore(536):     at android.webkit.WebViewCore.removeMessages(WebViewCore.java:1795)
07-10 12:15:53.011: W/webcore(536):     at android.webkit.WebView.sendOurVisibleRect(WebView.java:2917)
07-10 12:15:53.011: W/webcore(536):     at android.webkit.ZoomManager.setZoomScale(ZoomManager.java:593)
07-10 12:15:53.011: W/webcore(536):     at android.webkit.ZoomManager.access$1700(ZoomManager.java:49)
07-10 12:15:53.011: W/webcore(536):     at android.webkit.ZoomManager$PostScale.run(ZoomManager.java:984)
07-10 12:15:53.011: W/webcore(536):     at android.os.Handler.handleCallback(Handler.java:605)
07-10 12:15:53.011: W/webcore(536):     at android.os.Handler.dispatchMessage(Handler.java:92)
07-10 12:15:53.011: W/webcore(536):     at android.os.Looper.loop(Looper.java:137)
07-10 12:15:53.011: W/webcore(536):     at android.app.ActivityThread.main(ActivityThread.java:4424)
07-10 12:15:53.011: W/webcore(536):     at java.lang.reflect.Method.invokeNative(Native Method)
07-10 12:15:53.011: W/webcore(536):     at java.lang.reflect.Method.invoke(Method.java:511)
07-10 12:15:53.011: W/webcore(536):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-10 12:15:53.011: W/webcore(536):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-10 12:15:53.011: W/webcore(536):     at dalvik.system.NativeStart.main(Native Method)
07-10 12:15:53.011: D/SoftKeyboardDetect(536): Ignore this event
07-10 12:15:53.041: D/gralloc_goldfish(536): Emulator without GPU emulation detected.
07-10 12:15:53.441: D/DroidGap(536): onMessage(onPageStarted,file:///android_asset/www/index.html)
07-10 12:15:53.631: D/dalvikvm(536): GC_CONCURRENT freed 181K, 4% free 9316K/9607K, paused 6ms+4ms
07-10 12:15:56.681: E/generateWebResourceResponse(536): www/event/Dispatcher.js
07-10 12:15:56.681: E/generateWebResourceResponse(536): java.io.FileNotFoundException: www/event/Dispatcher.js
07-10 12:15:56.681: E/generateWebResourceResponse(536):     at android.content.res.AssetManager.openAsset(Native Method)
07-10 12:15:56.681: E/generateWebResourceResponse(536):     at android.content.res.AssetManager.open(AssetManager.java:315)
07-10 12:15:56.681: E/generateWebResourceResponse(536):     at org.apache.cordova.CordovaWebViewClient.generateWebResourceResponse(CordovaWebViewClient.java:492)
07-10 12:15:56.681: E/generateWebResourceResponse(536):     at org.apache.cordova.CordovaWebViewClient.shouldInterceptRequest(CordovaWebViewClient.java:465)
07-10 12:15:56.681: E/generateWebResourceResponse(536):     at android.webkit.CallbackProxy.shouldInterceptRequest(CallbackProxy.java:1078)
07-10 12:15:56.681: E/generateWebResourceResponse(536):     at android.webkit.BrowserFrame.shouldInterceptRequest(BrowserFrame.java:951)
07-10 12:15:56.681: E/generateWebResourceResponse(536):     at android.webkit.JWebCoreJavaBridge.nativeServiceFuncPtrQueue(Native Method)
07-10 12:15:56.681: E/generateWebResourceResponse(536):     at android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:113)
07-10 12:15:56.681: E/generateWebResourceResponse(536):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-10 12:15:56.681: E/generateWebResourceResponse(536):     at android.os.Looper.loop(Looper.java:137)
07-10 12:15:56.681: E/generateWebResourceResponse(536):     at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:728)
07-10 12:15:56.681: E/generateWebResourceResponse(536):     at java.lang.Thread.run(Thread.java:856)
07-10 12:15:56.721: E/generateWebResourceResponse(536): www/event/publisher/Dom.js
07-10 12:15:56.721: E/generateWebResourceResponse(536): java.io.FileNotFoundException: www/event/publisher/Dom.js
07-10 12:15:56.721: E/generateWebResourceResponse(536):     at android.content.res.AssetManager.openAsset(Native Method)
07-10 12:15:56.721: E/generateWebResourceResponse(536):     at android.content.res.AssetManager.open(AssetManager.java:315)
07-10 12:15:56.721: E/generateWebResourceResponse(536):     at org.apache.cordova.CordovaWebViewClient.generateWebResourceResponse(CordovaWebViewClient.java:492)
07-10 12:15:56.721: E/generateWebResourceResponse(536):     at org.apache.cordova.CordovaWebViewClient.shouldInterceptRequest(CordovaWebViewClient.java:465)
07-10 12:15:56.721: E/generateWebResourceResponse(536):     at android.webkit.CallbackProxy.shouldInterceptRequest(CallbackProxy.java:1078)
07-10 12:15:56.721: E/generateWebResourceResponse(536):     at android.webkit.BrowserFrame.shouldInterceptRequest(BrowserFrame.java:951)
07-10 12:15:56.721: E/generateWebResourceResponse(536):     at android.webkit.JWebCoreJavaBridge.nativeServiceFuncPtrQueue(Native Method)
07-10 12:15:56.721: E/generateWebResourceResponse(536):     at android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:113)
07-10 12:15:56.721: E/generateWebResourceResponse(536):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-10 12:15:56.721: E/generateWebResourceResponse(536):     at android.os.Looper.loop(Looper.java:137)
07-10 12:15:56.721: E/generateWebResourceResponse(536):     at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:728)
07-10 12:15:56.721: E/generateWebResourceResponse(536):     at java.lang.Thread.run(Thread.java:856)
07-10 12:15:56.731: D/chromium(536): Unknown chromium error: -6
07-10 12:15:56.731: D/chromium(536): Unknown chromium error: -6
07-10 12:15:56.731: D/Cordova(536): onPageFinished(file:///android_asset/www/index.html)
07-10 12:15:56.731: D/CordovaWebView(536): >>> loadUrlNow()
07-10 12:15:56.731: D/DroidGap(536): onMessage(onNativeReady,null)
07-10 12:15:56.731: D/DroidGap(536): onMessage(onPageFinished,file:///android_asset/www/index.html)
07-10 12:15:56.911: I/SqliteDatabaseCpp(536): sqlite returned: error code = 14, msg = cannot open file at line 27701 of [8609a15dfa], db=/data/data/clearitm.mobility.hellosenchacordova/databases/webview.db
07-10 12:15:56.911: I/SqliteDatabaseCpp(536): sqlite returned: error code = 14, msg = os_unix.c: open() at line 27701 - "" errno=2 path=/CachedGeoposition.db, db=/data/data/clearitm.mobility.hellosenchacordova/databases/webview.db
07-10 12:15:57.042: D/DroidGap(536): onMessage(networkconnection,3g)
07-10 12:15:58.789: D/DroidGap(536): onMessage(spinner,stop)

index.html コード:

<!DOCTYPE html>
<html>
<header>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Sencha Touch 2 Teste</title>
      <link rel="stylesheet" href="sencha-touch.css" type="text/css">
      <script type="text/javascript" src="sencha-touch.js"></script>
      <script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
  <script type="text/javascript" charset="utf-8" src="app/app.js"></script>
</header>
<body>
</body>
</html>

app.js:

Ext.Loader.setConfig({
    enable: true
});

Ext.application({

    name:'Touch2Demo',

    views: [
        'ContatosList',
        'ContatosForm'
    ],

    models: [
        'Contato'
    ],

    controllers: [
        'Main'
],

stores: [
    'Contatos'
],

viewport:{
    layout:{
        type: 'card',
        animation: {
            type: 'slide',
            duration: 1000
        }
    }
},

launch: function(){




}

});

メイン Java クラス:

import org.apache.cordova.DroidGap;
import android.os.Bundle;

public class HelloSenchaCordovaActivity extends DroidGap {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.loadUrl("file:///android_asset/www/index.html");
    }
}

資産フォルダー構造:

    assets>
           www>
               app>
                   app.js
                   controller
                   data
                   model
                   profile
                   store
                   view
               sencha>
                      resources>
                      sencha-touch.js
               cordova-1.9.0.js
               sencha-touch.js
               sencha-touch.css
               index.html

この種の問題に関する他の質問を検索しましたが、これらの解決策のどれも私の問題を解決できませんでした:/ここで何が問題なのかの手がかりはありますか?

ありがとう !

4

1 に答える 1

2

どうにかうまくいきましたが、問題は、sencha-touch-all.js を使用する必要があるときに sencha-touch.js を使用していたことです :) 今では魅力的に機能しています。このような問題を抱えている他の人に役立つことを願っています。

于 2012-07-10T18:11:26.743 に答える