【发布时间】:2013-02-26 00:14:03
【问题描述】:
我试图将一个简单的 Java 类转换为一个 PhoneGap 插件,但我无法加载它,我现在没有想法。
这是课程: https://gist.github.com/kowdermeister/5013353
我已将以下内容添加到 /res/xml/config/xml/config.xml
<plugin name="MediaPlayerStateWrapper" value="org.apache.cordova.plugins.MediaPlayerStateWrapper"/>
这是尝试加载 MP3 的 JS
cordova.exec( function () {
// Success
cordova.exec(function(){ alert('playing') }, function () {
// Failed to start
},'MediaPlayerStateWrapper', 'play');
}, function (e) {
alert(e)
}, 'MediaPlayerStateWrapper','setDataSource', ['http://...']);
我的环境是:
Eclipse (ADT)
目标:Android 4.2
PhoneGap SDK:cordova-2.4.0rc1.js
【问题讨论】:
-
您在“adb logcat”中看到的错误是什么?
-
应用程序:com.clouddeck 标签:System.out 文本:“添加插件 org.apache.cordova.pluguins.MediaPlayerStateWrapper 时出错”(我知道我忘了提什么)
-
插件当然是错别字
-
抱歉,这是否意味着您在评论或 config.xml 中输入错误,这会导致您看到的问题。
-
我这里打错了,logcat 无法复制文本 :( logcat 中的路径是正确的。