Android的 - 科尔多瓦3.5.0安装媒体插件后deviceready不触发科尔、插件、多瓦、媒体

2023-09-06 09:29:27 作者:痴心疯

这是有趣和奇怪的问题。

This is interesting and weird issue.

首先,我创建了科尔多瓦项目本地。我没有使用屋宇署。 使用

First I created Cordova project locally. I'm not using Bd. using

科尔多瓦创建测试com.test.project.story测试

成功地工作!

然后我说机器人平台,采用

科尔多瓦平台添加的android

成功合作。

然后,我用建项目

科尔多瓦构建

合作过,再次。

我打开Eclipse中的项目,并运行它的模拟器。 正确的工作。

I opened the project from Eclipse and ran it on emulator. Worked properly.

然后我想用加入了一些插件在我的项目

Then I thought of adding some plugins in my project using

cordova plugin add org.apache.cordova.file
cordova plugin add org.apache.cordova.media

删除Android平台,并再次加入该平台。然后,建成并运行在模拟器项目。

Removed the android platform and added the platform again. Then built and ran the project on emulator.

屏幕被困在连接到设备,直到永远。

The screen was stuck on Connecting to device forever.

我复查,如果我用的是正确的 cordova.js 为android平台。 这是正确的,它说

I rechecked if I was using the correct cordova.js for android platform. It is correct, and it says

// Platform: android
// 3.5.0

经过亚行日志,有很多可疑的东西怎么回事。

Checked ADB log and there are a lot of suspicious things going on.

D/CordovaWebViewClient( 1581): onPageFinished(file:///android_asset/www/index.html)
D/CordovaActivity( 1581): onMessage(onPageFinished,file:///android_asset/www/index.html)
D/CordovaActivity( 1581): onMessage(spinner,stop)
D/TilesManager( 1581): new EGLContext from framework: 2a1a2a10 
D/GLWebViewState( 1581): Reinit shader
D/dalvikvm(  270): GC_CONCURRENT freed 322K, 46% free 9831K/17991K, paused 813ms+21ms, total 2252ms
D/dalvikvm(  270): WAIT_FOR_CONCURRENT_GC blocked 906ms
D/GLWebViewState( 1581): Reinit transferQueue
W/ApplicationContext( 1581): Unable to create external files directory
D/        ( 1581): HostConnection::get() New Host Connection established 0x4a5f8558, tid 1605
E/PluginManager( 1581): Uncaught exception from plugin
E/PluginManager( 1581): java.lang.NullPointerException
E/PluginManager( 1581):     at org.apache.cordova.file.FileUtils.requestAllPaths(FileUtils.java:866)
E/PluginManager( 1581):     at org.apache.cordova.file.FileUtils.execute(FileUtils.java:348)
E/PluginManager( 1581):     at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65)
E/PluginManager( 1581):     at org.apache.cordova.PluginManager.execHelper(PluginManager.java:242)
E/PluginManager( 1581):     at org.apache.cordova.PluginManager.exec(PluginManager.java:227)
E/PluginManager( 1581):     at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
E/PluginManager( 1581):     at org.apache.cordova.CordovaChromeClient.onJsPrompt(CordovaChromeClient.java:227)
E/PluginManager( 1581):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:655)
E/PluginManager( 1581):     at android.os.Handler.dispatchMessage(Handler.java:99)
E/PluginManager( 1581):     at android.os.Looper.loop(Looper.java:137)
E/PluginManager( 1581):     at android.app.ActivityThread.main(ActivityThread.java:4745)
E/PluginManager( 1581):     at java.lang.reflect.Method.invokeNative(Native Method)
E/PluginManager( 1581):     at java.lang.reflect.Method.invoke(Method.java:511)
E/PluginManager( 1581):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
E/PluginManager( 1581):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/PluginManager( 1581):     at dalvik.system.NativeStart.main(Native Method)
D/dalvikvm(  270): GC_FOR_ALLOC freed 593K, 48% free 9509K/17991K, paused 275ms, total 280ms
I/dalvikvm-heap(  270): Grow heap (frag case) to 10.559MB for 1286224-byte allocation
D/dalvikvm(  270): GC_FOR_ALLOC freed 2K, 41% free 10763K/17991K, paused 182ms, total 186ms
D/dalvikvm(  270): GC_CONCURRENT freed 61K, 38% free 11284K/17991K, paused 41ms+11ms, total 304ms
D/CordovaActivity( 1581): onMessage(spinner,stop)
D/dalvikvm(  270): GC_CONCURRENT freed 2676K, 43% free 10293K/17991K, paused 16ms+29ms, total 130ms
D/CordovaLog( 1581): file:///android_asset/www/cordova.js: Line 1154 : deviceready has not fired after 5 seconds.
I/Web Console( 1581): deviceready has not fired after 5 seconds. at file:///android_asset/www/cordova.js:1154
D/CordovaLog( 1581): file:///android_asset/www/cordova.js: Line 1147 : Channel not fired: onFileSystemPathsReady
I/Web Console( 1581): Channel not fired: onFileSystemPathsReady at file:///android_asset/www/cordova.js:1147
E/ThrottleService(  149): problem during onPollAlarm: java.lang.IllegalStateException: problem parsing stats: java.io.FileNotFoundException: /proc/net/xt_qtaguid/iface_stat_all: open failed: ENOENT (No such file or directory)
D/dalvikvm(  251): GC_CONCURRENT freed 384K, 9% free 6556K/7175K, paused 7ms+5ms, total 67ms
D/dalvikvm(  251): GC_CONCURRENT freed 384K, 9% free 6556K/7175K, paused 6ms+13ms, total 62ms
I/EventLogService(  240): Aggregate from 1403981475023 (log), 1403981475023 (data)
E/ThrottleService(  149): problem during onPollAlarm: java.lang.IllegalStateException: problem parsing stats: java.io.FileNotFoundException: /proc/net/xt_qtaguid/iface_stat_all: open failed: ENOENT (No such file or directory)

这是怎么回事吗?

What's going on here?

更新:

工作正常的iOS。

推荐答案

我碰到了同样的问题。

I ran into the same issue.

什么工作对我来说是使用不同版本的文件的插件在这里找到: https://github.com/onflapp/cordova-plugin-file

What worked for me was using a different version of the File plugin found here: https://github.com/onflapp/cordova-plugin-file

相关主题:Cordova文件的插件从未变成就绪Android中