0

깨끗한 Cordova 3.3 프로젝트에 LiveTile 플러그인 (가 있음)을 추가하려고했습니다. 그러나 나는 그것이 작동하도록 할 수 없습니다. 그것은 링크의 지시와 함께 작동하지만 Cordova 2.0.0을 사용합니다.Cordova의 Windows Phone 8 용 LiveTile 플러그인 3.3

 An exception of type 'System.InvalidCastException' occurred in System.ServiceModel.Web.ni.dll and wasn't handled before a managed/native boundary 
     A first chance exception of type 'System.InvalidCastException' occurred in System.ServiceModel.Web.ni.dll 
     An exception of type 'System.InvalidCastException' occurred in System.ServiceModel.Web.ni.dll and wasn't handled before a managed/native boundary 
     Unable to cast object of type 'System.Collections.Generic.List`1[System.Object]' to type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]'. 
     Failed to deserialize Cordova.Extension.Commands.LiveTiles+LiveTilesOptions with JSON value :: ["System.Collections.Generic.Dictionary`2[System.String,System.Object]","LiveTiles963855178"] 
     A first chance exception of type 'System.NullReferenceException' occurred in CordovaWP8_2.9.14.DLL 
     An exception of type 'System.NullReferenceException' occurred in CordovaWP8_2.9.14.DLL but was not handled in user code 
     A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.ni.dll 
     An exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary 
     ERROR: Exception in ProcessCommand :: Exception has been thrown by the target of an invocation. 
     ERROR: failed to InvokeMethodNamed :: createSecondaryTile on Object :: LiveTiles 
     The thread 0xbac has exited with code 259 (0x103). 
     Error occurred: Invalid action 

이 플러그인은 코르도바의 새로운 버전을 다르게 추가 또는 LiveTile 플러그인은 더 이상 단순히 호환되지 않습니다 : 나는 새로운 타일을 추가 할 때 나는 다음과 같은 출력을 얻을?

답변

0

이것은 어리석은 질문이었을 수도 있지만 문서가 너무 가난하기 때문에 어떤 질문도 벙어리라고 부르기가 어렵습니다. 그러나 저는 지금이 문제를 해결할 수있었습니다. 그리고 다른 누군가가 같은 문제에 빠지게 될 기회에 제가 한 일을 설명하려고 노력할 것입니다.

처음에는 질문에서 가장 최근 인 것처럼 보인 LiveTiles 플러그인의 this 구현을 발견했습니다. Visual Studio를 통해 새 프로젝트를 만드는 대신 CLI를 사용했습니다.

phonegap create hello com.example.hello HelloWorld 

그런 다음 위의 링크에 따라 플러그인을 설치하기 위해 plugman을 사용했습니다.

plugman install --project . --platform wp8 --plugin com.risingj.cordova.livetiles 

이제 내 파일을 살펴보고 무슨 일이 있었는지 확인했습니다.

config.xml에 - 새 파일이 생성 된

<?xml version='1.0' encoding='utf-8'?> 
    <widget> 
     <access origin="*" /> 
     <feature name="LiveTiles"> 
      <param name="wp-package" value="LiveTiles" /> 
     </feature> 
    </widget> 

일부 추가 : cordova_plugins.js 다음과 같은 내용으로 www가 폴더에 : 나는이 추가

cordova.define('cordova/plugin_list', function(require, exports, module) { 
module.exports = [ 
    { 
     "file": "plugins/livetiles.js", 
     "id": "com.risingj.cordova.livetiles.livetiles", 
     "clobbers": [ 
      "LiveTiles" 
     ] 
    } 
]; 
module.exports.metadata = 
// TOP OF METADATA 
{ 
    "com.risingj.cordova.livetiles": "0.1.0" 
} 
// BOTTOM OF METADATA 
}); 

파일을 Cordova Visual Studio 프로젝트에 보내면 효과가있었습니다! 그래서 나는 새로운 플러그인이 필요한지 추가되었는지 추측합니다.

0

는이 작업을 수행해야합니다

cordova plugin add path/to/your/plugin 

그것은 모든 물건을 할 것입니다.