DB没有在Cordova中创建

时间:2017-01-18 17:59:56

标签: android cordova

我在Android Studio-Cordova中的第一个应用程序有问题。 我用于我的应用程序html,css,jquery和sql。 该申请是正确的,因为我参加了有相关代码的在线课程。

它开始了,但创建db的消息没有出现。

Android Studio的日志是这样的:

Client not ready yet..Waiting for process to come online
Connected to process 2679 on device Nexus_5_API_19_armeabi_v7a [emulator-5554]
I/InstantRun: Instant Run Runtime started. Android package is com.videocorsi.test, real application class is null.
W/InstantRun: No instant run dex files added to classpath
I/CordovaLog: Changing log level to DEBUG(3)
I/CordovaActivity: Apache Cordova native platform version 6.0.0 is starting
D/CordovaActivity: CordovaActivity.onCreate()
I/dalvikvm: Could not find method android.app.Activity.checkSelfPermission, referenced from method org.apache.cordova.CordovaInterfaceImpl.hasPermission
W/dalvikvm: VFY: unable to resolve virtual method 2: Landroid/app/Activity;.checkSelfPermission (Ljava/lang/String;)I
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0023
I/dalvikvm: Could not find method android.app.Activity.requestPermissions, referenced from method org.apache.cordova.CordovaInterfaceImpl.requestPermissions
W/dalvikvm: VFY: unable to resolve virtual method 136: Landroid/app/Activity;.requestPermissions ([Ljava/lang/String;I)V
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0029
V/WebViewChromium: Binding Chromium to the background looper Looper (main, tid 1) {9dd95220}
I/chromium: [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserProcessMain: Initializing chromium process, renderers=0
W/chromium: [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
D/dalvikvm: GC_FOR_ALLOC freed 142K, 12% free 3463K/3892K, paused 86ms, total 88ms
I/dalvikvm-heap: Grow heap (frag case) to 6.078MB for 2536936-byte allocation
D/dalvikvm: GC_FOR_ALLOC freed 0K, 7% free 5941K/6372K, paused 58ms, total 58ms
I/dalvikvm: Could not find method android.webkit.CookieManager.setAcceptThirdPartyCookies, referenced from method org.apache.cordova.engine.SystemCookieManager.<init>
W/dalvikvm: VFY: unable to resolve virtual method 953: Landroid/webkit/CookieManager;.setAcceptThirdPartyCookies (Landroid/webkit/WebView;Z)V
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0046
I/dalvikvm: Could not find method android.webkit.CookieManager.flush, referenced from method org.apache.cordova.engine.SystemCookieManager.flush
W/dalvikvm: VFY: unable to resolve virtual method 947: Landroid/webkit/CookieManager;.flush ()V
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0019
W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/webkit/ClientCertRequest;)
W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/webkit/ClientCertRequest;)
I/dalvikvm: Could not find method android.webkit.WebViewClient.onReceivedClientCertRequest, referenced from method org.apache.cordova.engine.SystemWebViewClient.onReceivedClientCertRequest
W/dalvikvm: VFY: unable to resolve virtual method 1147: Landroid/webkit/WebViewClient;.onReceivedClientCertRequest (Landroid/webkit/WebView;Landroid/webkit/ClientCertRequest;)V
D/dalvikvm: VFY: replacing opcode 0x6f at 0x0031
W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/webkit/PermissionRequest;)
I/dalvikvm: Could not find method android.webkit.PermissionRequest.getResources, referenced from method org.apache.cordova.engine.SystemWebChromeClient.onPermissionRequest
W/dalvikvm: VFY: unable to resolve virtual method 964: Landroid/webkit/PermissionRequest;.getResources ()[Ljava/lang/String;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0023
I/dalvikvm: Could not find method android.webkit.WebChromeClient$FileChooserParams.createIntent, referenced from method org.apache.cordova.engine.SystemWebChromeClient.onShowFileChooser
W/dalvikvm: VFY: unable to resolve virtual method 969: Landroid/webkit/WebChromeClient$FileChooserParams;.createIntent ()Landroid/content/Intent;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0021
D/SystemWebViewEngine: CordovaWebView is running on device made by: unknown
D/PluginManager: init()
D/CordovaWebViewImpl: >>> loadUrl(file:///android_asset/www/index.html)
D/CordovaActivity: Started the activity.
D/CordovaActivity: Resumed the activity.
D/OpenGLRenderer: Enabling debug mode 0
I/Choreographer: Skipped 81 frames!  The application may be doing too much work on its main thread.
W/AwContents: nativeOnDraw failed; clearing to background color.
W/AwContents: nativeOnDraw failed; clearing to background color.
W/AwContents: nativeOnDraw failed; clearing to background color.
W/AwContents: nativeOnDraw failed; clearing to background color.
D/CordovaWebViewImpl: onPageDidNavigate(file:///android_asset/www/index.html)
D/JsMessageQueue: Set native->JS mode to EvalBridgeMode
I/chromium: [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
I/chromium: [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
I/Choreographer: Skipped 74 frames!  The application may be doing too much work on its main thread.
D/SystemWebChromeClient: file:///android_asset/www/cordova_plugins.js: Line 7 : Uncaught SyntaxError: Unexpected string
I/chromium: [INFO:CONSOLE(7)] "Uncaught SyntaxError: Unexpected string", source: file:///android_asset/www/cordova_plugins.js (7)
D/CordovaWebViewImpl: onPageFinished(file:///android_asset/www/index.html)
D/SystemWebChromeClient: file:///android_asset/www/js/index.js: Line 39 : Uncaught ReferenceError: listeningElement is not defined
I/chromium: [INFO:CONSOLE(39)] "Uncaught ReferenceError: listeningElement is not defined", source: file:///android_asset/www/js/index.js (39)
D/SystemWebChromeClient: file:///android_asset/www/index.html: Line 237 : Uncaught TypeError: Cannot call method 'transaction' of undefined
I/chromium: [INFO:CONSOLE(237)] "Uncaught TypeError: Cannot call method 'transaction' of undefined", source: file:///android_asset/www/index.html (237)

我该怎么办?

1 个答案:

答案 0 :(得分:0)

问题出在这个文件index.js中。我评论过这个:

receivedEvent:function(id){var parentElement = document.getElementById(id);

// var listeningElement = parentElement.querySelector(&#39; .listening&#39;); // var receivedElement = parentElement.querySelector(&#39; .received&#39;);  // listeningElement.setAttribute(&#39; style&#39;,&#39; display:none;&#39;); //receivedElement.setAttribute(&#39; style&#39;,&#39; display:block;&#39;);

console.log(&#39;收到的事件:&#39; + id); }

然后,我在标签的末尾用我的js / jquery代码移动标签脚本