android - 电话间隙命名空间 'gap'未绑定(bind)错误

标签 android cordova paypal phonegap-plugins phonegap-build

我是电话间隙的新手。我在 config.xml 中遇到错误。实际上我正在进行 Paypal 集成。

在 config.xml 中显示电话间隙命名空间未绑定(bind)。

当我运行时显示错误:(117) 解析 XML 时出错:未绑定(bind)前缀

错误:任务“:app:processDebugResources”执行失败。

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Sradhanjali\AppData\Local\Android\sdk\build-tools\23.0.2\aapt.exe'' finished with non-zero exit value 1

建议我。谢谢

下面是config.xml的编码

<?xml version="1.0" encoding="UTF-8"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
-->
<widget xmlns     = "http://www.w3.org/ns/widgets"
        id        = "io.cordova.helloCordova"
        version   = "2.0.0">
    <name>Hello Cordova</name>

    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>

    <author href="http://cordova.io" email="<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e98d8c9fa98a869b8d869f88c78899888a818cc7869b8e" rel="noreferrer noopener nofollow">[email protected]</a>">
        Apache Cordova Team
    </author>

    <access origin="*" subdomains="true"/>


    <content src="index.html" />

    <preference name="loglevel" value="DEBUG" />
    <!--
      <preference name="splashscreen" value="resourceName" />
      <preference name="backgroundColor" value="0xFFF" />
      <preference name="loadUrlTimeoutValue" value="20000" />
      <preference name="InAppBrowserStorageEnabled" value="true" />
      <preference name="disallowOverscroll" value="true" />
    -->
    <!-- CHINU -->
    <preference name="orientation" value="portrait" />
    <preference name="orientation" value="landscape" />



    <feature name="App">
      <param name="android-package" value="org.apache.cordova.App"/>
    </feature>
    <feature name="Geolocation">
      <param name="android-package" value="org.apache.cordova.GeoBroker"/>
    </feature>
    <feature name="Device">
      <param name="android-package" value="org.apache.cordova.Device"/>
    </feature>
    <feature name="Accelerometer">
      <param name="android-package" value="org.apache.cordova.AccelListener"/>
    </feature>
    <feature name="Compass">
      <param name="android-package" value="org.apache.cordova.CompassListener"/>
    </feature>
    <feature name="Media">
      <param name="android-package" value="org.apache.cordova.AudioHandler"/>
    </feature>
    <feature name="Camera">
      <param name="android-package" value="org.apache.cordova.CameraLauncher"/>
    </feature>
    <feature name="Contacts">
      <param name="android-package" value="org.apache.cordova.ContactManager"/>
    </feature>
    <feature name="File">
      <param name="android-package" value="org.apache.cordova.FileUtils"/>
    </feature>
    <feature name="NetworkStatus">
      <param name="android-package" value="org.apache.cordova.NetworkManager"/>
    </feature>
    <feature name="Notification">
      <param name="android-package" value="org.apache.cordova.Notification"/>
    </feature>
    <feature name="Storage">
      <param name="android-package" value="org.apache.cordova.Storage"/>
    </feature>
    <feature name="FileTransfer">
      <param name="android-package" value="org.apache.cordova.FileTransfer"/>
    </feature>
    <feature name="Capture">
      <param name="android-package" value="org.apache.cordova.Capture"/>
    </feature>
    <feature name="Battery">
      <param name="android-package" value="org.apache.cordova.BatteryListener"/>
    </feature>
    <feature name="SplashScreen">
      <param name="android-package" value="org.apache.cordova.SplashScreen"/>
    </feature>
    <feature name="Echo">
      <param name="android-package" value="org.apache.cordova.Echo"/>
    </feature>
    <feature name="Globalization">
      <param name="android-package" value="org.apache.cordova.Globalization"/>
    </feature>
    <feature name="InAppBrowser">
      <param name="android-package" value="org.apache.cordova.InAppBrowser"/>
    </feature>


    <feature name="ToastPlugin">
        <param name="android-package" value="com.example.playtradewin.ToastPlugin" />
    </feature>

    <!-- Deprecated plugins element. Remove in 3.0 -->
    <plugins>
        <gap:plugin name="com.paypal.cordova.mobilesdk" version="3.1.8" />
    </plugins>


</widget>

最佳答案

为了使用<gap:plugin>您需要在<widget>上通知phonegap xml命名空间的标签标签

添加

xmlns:gap="http://phonegap.com/ns/1.0"

所以你的小部件标签看​​起来像

<widget xmlns     = "http://www.w3.org/ns/widgets"
    xmlns:gap="http://phonegap.com/ns/1.0"
    id        = "io.cordova.helloCordova"
    version   = "2.0.0">

它应该可以正常工作,如 this issue 中所示。

关于android - 电话间隙命名空间 'gap'未绑定(bind)错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34654917/

相关文章:

c# - ngrok + 本地 IIS : how to expose a website

java - Android + WS-* 服务?

javascript - Cordova 3.5.0 上的 SQLite 插件无法正常工作

ios - phonegap iOS 旋转

web-services - 对于不受支持的国家/地区, Paypal 有哪些替代方案?

paypal - PayPal 沙盒一直要求我添加信用卡

java - Android ScrollView 将不再滚动

Android添加mipmap-xxxhdpi图标

android - TextureView 的裁剪相机预览

android - 如何将外部 npm 包添加到 phonegap?