美文网首页
自定义Cordova plugin总结

自定义Cordova plugin总结

作者: ouxuwen | 来源:发表于2019-05-23 17:20 被阅读0次

调试,直接打开cordova工程调试

  1. For ios, go to platforms/ios and open the debugPlugins.xcodeproj
  2. For android open android studio, go to File->New->Import Project and select the platforms/android folder

引入第三方arr包后,打包失败。

原因:应该是第三方包引用了com.android.support:appcompat-v7:21+ 等资源

解决办法:

插件plugin.xml <framework src="com.android.support:appcompat-v7:21+" />

以后类似情况可以这样处理。

参考:

http://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#framework

修改"AndroidManifest.xml"

<config-file target="AndroidManifest.xml" parent="/manifest/application">
             <activity
                android:name="de.wirecard.paymentsdk.ui.activity.ScannerActivity"
                android:theme="@style/Theme.AppCompat.Light.NoActionBar"
                android:screenOrientation="landscape">
            </activity>
        </config-file>
       
        <config-file target="res/values/strings.xml" parent='/resources' >
 
            <string name="card_number">card number</string>

        </config-file>
        
  <framework src="src/android/warecard.gradle" custom="true" type="gradleReference" />

cordova 插件添加build gradle 内容

<platform name="android">
    ...
    <framework src="src/android/FilePickerIO.gradle" custom="true" type="gradleReference" />
</platform>

相关文章

网友评论

      本文标题:自定义Cordova plugin总结

      本文链接:https://www.haomeiwen.com/subject/xwpbzqtx.html