简体   繁体   English

无法将cordova-plugin-uid添加到Visual Studio 2013项目

[英]Cannot add cordova-plugin-uid to Visual Studio 2013 project

When trying to add https://github.com/hygieiasoft/cordova-plugin-uid to visual studio via the config.xml designer, it "recognises" there is a plugin, but ends with blank fields for all the properties (version, plugin id, etc.), even if you wait for minutes (most others find all properties in seconds). 尝试通过config.xml设计器将https://github.com/hygieiasoft/cordova-plugin-uid添加到Visual Studio时,它“识别”有一个插件,但以所有属性(版本,插件ID等),即使您等待了几分钟(大多数其他人会在几秒钟内找到所有属性)。 If you then try and add it, it simply crashes VS and restarts. 如果随后尝试添加它,它只会使VS崩溃并重新启动。 I have tried with plugins that do not support ALL platforms, with success, but not this one. 我尝试使用不支持所有平台的插件成功,但是不成功。

Has anyone had any luck adding this to VS or have any ideas. 有没有人有幸将其添加到VS或有任何想法。 Since the project is cross platform, I would prefer to use the recommended way, even though this is android only, but am open to suggestions. 由于该项目是跨平台的,因此我宁愿使用推荐的方式,即使这仅是android,但也欢迎提出建议。 Ultimately, I am only looking for IMEI. 最终,我只在寻找IMEI。

A user suggested using Telerik App Studio, as the process is simpler to copy the plugin into the www folder, but apart from the cost, I would, as noted, prefer keep within the confines of a somewhat recommended way that will continue working when upgrading to VS 2015 and beyond. 用户建议使用Telerik App Studio,因为将插件复制到www文件夹的过程更简单,但除了成本外,我还指出,我宁愿将其保留在某种推荐方法的范围内,该方法将在升级时继续工作VS 2015及更高版本。

Do the following steps - 执行以下步骤-

1) Download the plugin on your windows desktop. 1)在Windows桌面上下载插件。 Unzip the downloaded file. 解压缩下载的文件。

2) Add facebookconnect.xml file to the folder where plugin.xml is present. 2)将facebookconnect.xml文件添加到存在plugin.xml的文件夹中。 Add your app id and application name. 添加您的应用ID和应用名称。 Place the below tags inside resources tag - 将以下标签放在资源标签内-

<string name="fb_app_id"></string>
<string name="fb_app_name"></string>

3) Modify the plugin.xml file to include facebookconnect.xml file. 3)修改plugin.xml文件,使其包含facebookconnect.xml文件。 It should look like below - 它应如下所示-

    <config-file target="res/xml/config.xml" parent="/*">
        <feature name="FacebookConnectPlugin">
            <param name="android-package" value="org.apache.cordova.facebook.ConnectPlugin" />
        </feature>
        <access origin="https://m.facebook.com" />
        <access origin="https://graph.facebook.com" />
        <access origin="https://api.facebook.com" />
        <access origin="https://*.fbcdn.net" />
        <access origin="https://*.akamaihd.net" />
    </config-file>

    <source-file src="platforms/android/res/values/facebookconnect.xml" target-dir="res/values" />

    <config-file target="AndroidManifest.xml" parent="application">
        <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/fb_app_id"/>
        <activity android:label="@string/fb_app_name" android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
    </config-file>

    <framework src="platforms/android/FacebookLib" custom="true" />

    <!-- cordova plugin src files -->
    <source-file src="platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java" target-dir="src/org/apache/cordova/facebook" />

</platform>

4) Now Go into Visual Studio and add the plugin from the directory where plugin files are present. 4)现在进入Visual Studio,从存在插件文件的目录中添加插件。 It will take some time to be added. 这将需要一些时间来添加。

Hope this helps you fix the problem. 希望这可以帮助您解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM