2016-09-19 40 views
-1

我試圖在科爾多瓦開發一個插件,它看起來有效。科爾多瓦插件的開發和更新

W/System.err(12878): java.lang.ClassNotFoundException: com.xiaoyi.action 

W/System.err(12878): at java.lang.Class.classForName(Native Method) 

W/System.err(12878): at java.lang.Class.forName(Class.java:251) 

W/System.err(12878): at java.lang.Class.forName(Class.java:216) 

W/System.err(12878): at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:490) 

W/System.err(12878): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:170) 

W/System.err(12878): at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:98) 

W/System.err(12878): at org.apache.cordova.PluginManager.init(PluginManager.java:87) 

W/System.err(12878): at org.apache.cordova.CordovaWebViewImpl.init(CordovaWebViewImpl.java:116) 

W/System.err(12878): at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:144) 

W/System.err(12878): at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:214) 

W/System.err(12878): at com.ionicframework.beekcontrolapp845287.MainActivity.onCreate(MainActivity.java:32) 

W/System.err(12878): at android.app.Activity.performCreate(Activity.java:5541) 

W/System.err(12878): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093) 

W/System.err(12878): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2411) 

W/System.err(12878): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2507) 

W/System.err(12878): at android.app.ActivityThread.access$900(ActivityThread.java:172) 

W/System.err(12878): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308) 

W/System.err(12878): at android.os.Handler.dispatchMessage(Handler.java:102) 

W/System.err(12878): at android.os.Looper.loop(Looper.java:146) 

W/System.err(12878): at android.app.ActivityThread.main(ActivityThread.java:5692) 

W/System.err(12878): at java.lang.reflect.Method.invokeNative(Native Method) 

W/System.err(12878): at java.lang.reflect.Method.invoke(Method.java:515) 

W/System.err(12878): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) 

W/System.err(12878): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) 

W/System.err(12878): at dalvik.system.NativeStart.main(Native Method) 

W/System.err(12878): Caused by: java.lang.NoClassDefFoundError: com/xiaoyi/action 

W/System.err(12878): ... 25 more 

W/System.err(12878): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.xiaoyi.action" on path: DexPathList[[zip file 

我猜,這位來自plugin.xml的未來

<?xml version="1.0" encoding="UTF-8"?> 

科爾多瓦插件易

<!-- android --> 
<platform name="android"> 
    <js-module src="www/plugin.js" name="plugin"> 
    <runs/> 

    <clobbers target="XiaomiYi" /> 
    </js-module> 
    <config-file target="res/xml/config.xml" parent="/*"> 
    <feature name="CordovaXiaomiYi"> 
     <param name="android-package" value="com.xiaoyi.action" /> 
     <param name="onload" value="true" /> 
    </feature> 
    </config-file> 

    <source-file src="src/android/com/xiaoyi/XiaomiYiCordovaPlugin.java" target-dir="src/com/xiaoyi/action" /> 
</platform> 

:當我嘗試運行我的應用程序崩潰我的問題是,我該如何解決這個問題?我是否在插件目錄中進行更改並刪除,然後爲每次嘗試重新安裝插件 - 還是我要對Android平臺文件夾或Cordova/Plugins目錄進行更改!?

+1

在我的情況下,我在''標籤內的''標籤外有''標籤。關於你的問題:我會在插件目錄中進行更改。刪除它,添加它,檢查它的工作正常後,建立並繼續。如果您在/ platform文件夾下執行更改,則每次您要構建項目時,都必須手動一次又一次實現這些更改。 – nyluje

回答

0

感謝看來我可以直接在平臺上直接編輯Java,一旦插件工作正常就安裝而言。完成後我會更新插件。