【问题标题】:How do I overcome this issue : ANDROID_SUPPORT_V4_VERSION in phonegap build我该如何克服这个问题:ANDROID_SUPPORT_V4_VERSION in phonegap build
【发布时间】:2019-05-11 02:37:32
【问题描述】:

我使用 phonegap 开发了一个应用程序。我尝试使用 phonegap build 为我的应用程序生成 apk,但在生成 apk 时遇到此问题(错误 - 您正在使用的插件需要首选项:ANDROID_SUPPORT_V4_VERSION)。

<plugin name="cordova-plugin-x-socialsharing" source="npm" />
<plugin name="cordova-plugin-whitelist" source="npm" />
<plugin name="cordova-plugin-screensize" source="npm" />

我在 phonegap 应用程序中使用了这三个插件。谁能帮我解决这个问题?

【问题讨论】:

    标签: android cordova phonegap-plugins phonegap-build phonegap


    【解决方案1】:

    @贾维斯J 我明白了:它是社交分享插件——所以基本上我们必须自己配置插件。我遇到过同样的问题。

    解决方案:

    在您的 config.xml 文件中,将 social-sharing-x 插件的版本号更改为 5.4.0

    见:

    <plugin name = "cordova-plugin-x-socialsharing" source="npm" version="5.4.0" />
    

    之后我可以构建它并且一切正常。

    最好的,

    托马斯

    【讨论】:

    【解决方案2】:

    Adobe PhoneGap 建议指定插件版本。 在您的 config.xml 文件中,指定使用的插件的规范版本。 以下是示例插件及其指定版本。

    <plugin name="cordova-plugin-device" spec="1.1.7" />
    <plugin name="cordova-plugin-device-motion" spec="1.2.5" />
    <plugin name="cordova-plugin-device-orientation" spec="1.0.7" />
    <plugin name="cordova-plugin-dialogs" spec="1.2.1" />
    <plugin name="cordova-plugin-globalization" spec="1.0.9" />
    <plugin name="cordova-plugin-inappbrowser" spec="1.3.0" />
    <plugin name="cordova-plugin-media" spec="2.2.0" />
    <plugin name="cordova-plugin-network-information" spec="1.2.1" />
    <plugin name="cordova-plugin-splashscreen" spec="3.2.2" />
    <plugin name="cordova-plugin-statusbar" spec="2.1.3" />
    <plugin name="cordova-plugin-whitelist" spec="1.2.2" />
    <plugin name="cordova-plugin-x-socialsharing" spec="5.4.0" />
    

    【讨论】:

      【解决方案3】:
      cordova-plugin-x-socialsharing 
      

      有问题并失败:

      FAILURE: Build failed with an exception.
      
      * Where:
      Build file '/home/mj/projects/benara-sales-client/platforms/android/build.gradle' line: 266
      
      * 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.
      
      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
      

      要修复,您可以安装 v5.4.0

      所以删除插件和正确的版本

      cordova plugin rm cordova-plugin-x-social-sharing
      cordova plugin add cordova-plugin-x-social-sharing@5.4.0
      

      希望这会有所帮助。

      【讨论】:

      • 只是一个快速修复:它是cordova-plugin-x-socialsharing。不是社交分享。
      猜你喜欢
      • 2017-02-28
      • 1970-01-01
      • 2011-09-11
      • 1970-01-01
      • 2021-05-08
      • 2023-03-04
      • 2020-02-29
      • 1970-01-01
      • 2020-03-25
      相关资源
      最近更新 更多