Android – Cordova 3.5.0装置在安装媒体插件后不发射

前端之家收集整理的这篇文章主要介绍了Android – Cordova 3.5.0装置在安装媒体插件后不发射前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
这是有趣和奇怪的问题.

首先我在本地创建了Cordova项目.我没有使用Bd.
运用

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

哪个工作成功!

然后我添加android平台,使用

科尔多瓦平台添加android

成功工作

然后我使用了项目

科尔多瓦建造

再次工作

我从Eclipse开了这个项目,并在仿真器上运行它.
正常工作

然后我想到在我的项目中添加一些插件

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

移除了android平台,再次添加了平台.然后在仿真器上构建并运行该项目.

屏幕被卡在永久连接设备上.

我重新检查,如果我正在使用正确的cordova.js的Android平台.
这是正确的,它说

// Platform: android
// 3.5.0

检查了ADB日志,并且有很多可疑的事情发生.

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,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)

这里发生了什么?

更新:

在iOS上工作正常

解决方法

我遇到同样的问题.

对我来说有用的是使用不同版本的File插件
https://github.com/onflapp/cordova-plugin-file

相关主题Cordova File plugin never becomes ready in Android

猜你在找的Android相关文章