gpt4 book ai didi

Android 构建因 cordova-whitelist-plugin 而失败

转载 作者:行者123 更新时间:2023-11-30 02:03:02 25 4
gpt4 key购买 nike

我是 Cordova 的新手,我正在为 cordova 使用几个插件,其中一个是白名单插件。当我将白名单插件添加到我的 cordova 项目并从 eclipse 在 android 设备上运行时,出现以下错误。

-compile:
[javac] Compiling 31 source files to D:\software\eclipse\configuration\org.eclipse.osgi\1099\data\proj_gen\GoFindoMobile\android\bin\classes
[javac] D:\software\eclipse\configuration\org.eclipse.osgi\1099\data\proj_gen\GoFindoMobile\android\src\org\apache\cordova\whitelist\WhitelistPlugin.java:42: error: no suitable method found for parse(Context)
[javac] new CustomConfigXmlParser().parse(context);
[javac] ^
[javac] method ConfigXmlParser.parse(XmlResourceParser) is not applicable
[javac] (actual argument Context cannot be converted to XmlResourceParser by method invocation conversion)
[javac] method ConfigXmlParser.parse(Activity) is not applicable
[javac] (actual argument Context cannot be converted to Activity by method invocation conversion)
[javac] D:\software\eclipse\configuration\org.eclipse.osgi\1099\data\proj_gen\GoFindoMobile\android\src\org\apache\cordova\whitelist\WhitelistPlugin.java:46: error: no suitable method found for parse(XmlPullParser)
[javac] new CustomConfigXmlParser().parse(xmlParser);
[javac] ^
[javac] method ConfigXmlParser.parse(XmlResourceParser) is not applicable
[javac] (actual argument XmlPullParser cannot be converted to XmlResourceParser by method invocation conversion)
[javac] method ConfigXmlParser.parse(Activity) is not applicable
[javac] (actual argument XmlPullParser cannot be converted to Activity by method invocation conversion)
[javac] D:\software\eclipse\configuration\org.eclipse.osgi\1099\data\proj_gen\GoFindoMobile\android\src\org\apache\cordova\whitelist\WhitelistPlugin.java:64: error: no suitable method found for parse(Context)
[javac] new CustomConfigXmlParser().parse(webView.getContext());
[javac] ^
[javac] method ConfigXmlParser.parse(XmlResourceParser) is not applicable
[javac] (actual argument Context cannot be converted to XmlResourceParser by method invocation conversion)
[javac] method ConfigXmlParser.parse(Activity) is not applicable
[javac] (actual argument Context cannot be converted to Activity by method invocation conversion)
[javac] D:\software\eclipse\configuration\org.eclipse.osgi\1099\data\proj_gen\GoFindoMobile\android\src\org\apache\cordova\whitelist\WhitelistPlugin.java:69: error: method does not override or implement a method from a supertype
[javac] @Override
[javac] ^
[javac] D:\software\eclipse\configuration\org.eclipse.osgi\1099\data\proj_gen\GoFindoMobile\android\src\org\apache\cordova\whitelist\WhitelistPlugin.java:106: error: method does not override or implement a method from a supertype
[javac] @Override
[javac] ^
[javac] D:\software\eclipse\configuration\org.eclipse.osgi\1099\data\proj_gen\GoFindoMobile\android\src\org\apache\cordova\whitelist\WhitelistPlugin.java:111: error: method does not override or implement a method from a supertype
[javac] @Override
[javac] ^
[javac] D:\software\eclipse\configuration\org.eclipse.osgi\1099\data\proj_gen\GoFindoMobile\android\src\org\apache\cordova\whitelist\WhitelistPlugin.java:119: error: method does not override or implement a method from a supertype
[javac] @Override
[javac] ^
[javac] D:\software\eclipse\configuration\org.eclipse.osgi\1099\data\proj_gen\GoFindoMobile\android\src\org\apache\cordova\whitelist\WhitelistPlugin.java:130: error: method does not override or implement a method from a supertype
[javac] @Override
[javac] ^
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 8 errors

构建失败

当我不使用白名单插件时它编译正常。

最佳答案

这很可能是因为您使用的是旧版本的 Cordova (<= v4.x) 和最新的白名单插件 (>= v5.x)。在 Cordova 5 中,他们将 ConfigXmlParser api 切换为采用 Context 而不是 Activity

关于Android 构建因 cordova-whitelist-plugin 而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31185103/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com