[英]Ionic Android build error after updating cordova-plugin-x-socialsharing plugin
我有一个 Ionic 3 应用程序,我刚刚更新了cordova-plugin-x-socialsharing
插件。
离子信息..
$ ionic info
Ionic:
ionic (Ionic CLI) : 4.5.0 (C:\Users\peter\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.6.1
@ionic/app-scripts : 3.2.2
Cordova:
cordova (Cordova CLI) : 7.0.1
Cordova Platforms : android 6.2.3, ios 4.3.1, windows 5.0.0
Cordova Plugins : no whitelisted plugins (16 plugins total)
System:
Android SDK Tools : 26.1.1 (C:\Users\peter\AppData\Local\Android\sdk)
NodeJS : v10.15.0 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
我现在收到以下构建错误..
* Where:
Build file 'D:\dev\myapp\platforms\android\build.gradle' line: 252
* What went wrong:
A problem occurred evaluating root project 'android'.
> Could not get unknown property 'ANDROID_SUPPORT_V4_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
在 build.grade 的那一行,我有以下内容……
此外,在我的 package.json 中,我注意到我现在有以下内容……
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
},
我已经计划好移植到 Ionic 4,我可能会在那里重新添加我所有的平台,但在那之前,有谁知道我该如何解决这个问题?
提前致谢
这里建议降级到5.4.0版本。 在撰写本文时,插件的当前版本是 5.6.3。 所以这对我来说并不是真正的解决方法,而是一个临时的解决方法。 但我试过了,它似乎有效。
5.4.0 是 plugin.xml 中硬编码版本的最后一个版本:
<framework src="com.android.support:support-v4:24.1.1+" />
后来的版本使用了一个变量,当 Cordova 为 Android 创建 build.gradle 文件时,这个变量似乎没有得到解决:
<framework src="com.android.support:support-v4:$ANDROID_SUPPORT_V4_VERSION" />
<preference name="ANDROID_SUPPORT_V4_VERSION" default="24.1.1+"/>
见差异: 5.4.0...5.4.4
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.