首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带有Cordova默认应用程序XML错误的Eclipse THyM

带有Cordova默认应用程序XML错误的Eclipse THyM
EN

Stack Overflow用户
提问于 2016-08-25 10:10:55
回答 1查看 723关注 0票数 0

目前,我正在使用Cordova,并且刚刚开始考虑是否可以从Eclipse Neon开发。

下载了最新的JBoss tools并安装在我的Javascript上,这样我就可以使用新的混合移动开发功能。

使用新项目向导创建默认混合移动(Cordova)应用程序项目。添加了安卓平台(cordova-android@5.2.2)。

Eclipse构建和配置新项目,但会出现一些有关XML验证的错误。我可以在我的android设备或cordova模拟器上运行这个示例应用程序。它运行并显示OK,但是在eclipse代码上仍然标记错误。

,这是我遇到的错误:

代码语言:javascript
复制
cvc-attribute.3: The value 'loglevel' of attribute 'name' on element 'preference' is not valid with respect to its type, 'null'.    defaults.xml    /Test/platforms/android/cordova line 25 XML Problem

cvc-enumeration-valid: Value 'loglevel' is not facet-valid with respect to enumeration '[AllowInlineMediaPlayback, AndroidLaunchMode, android-maxSdkVersion, android-targetSdkVersion, AppendUserAgent, BackgroundColor, BackupWebStorage, ChildBrowser, CordovaWebViewEngine, DefaultVolumeStream, DisallowOverscroll, EnableViewportScale, EnableWebGL, ErrorUrl, FullScreen, GapBetweenPages, HideKeyboardFormAccessoryBar, HideMousePointer, InAppBrowserStorageEnabled, KeepRunning, KeyboardDisplayRequiresUserAction, LoadUrlTimeoutValue, LoadingDialog, LogLevel, MediaPlaybackAllowsAirPlay, MediaPlaybackRequiresUserAction, Min/Max Version, Orientation, OSXLocalStoragePath, OverrideUserAgent, PageLength, PaginationBreakingMode, PaginationMode, PopupBlocker, SetFullscreen, ShowTitle, Suppresses3DTouchGesture, SuppressesIncrementalRendering, SuppressesLongPressGesture, TopActivityIndicator, UIWebViewDecelerationSpeed, WebSecurity, WindowSize, WindowsDefaultUriPrefix, WindowsStoreDisplayName, WindowsStoreIdentityName, WindowsStorePublisherName, WindowsToastCapable, deployment-target, target-device, windows-phone-target-version, windows-target-version]'. It must be a value from the enumeration.   defaults.xml    /Test/platforms/android/cordova line 25 XML Problem

cvc-attribute.3: The value 'loglevel' of attribute 'name' on element 'preference' is not valid with respect to its type, 'null'.    config.xml  /Test/platforms/android/res/xml line 22 XML Problem

cvc-enumeration-valid: Value 'loglevel' is not facet-valid with respect to enumeration '[AllowInlineMediaPlayback, AndroidLaunchMode, android-maxSdkVersion, android-targetSdkVersion, AppendUserAgent, BackgroundColor, BackupWebStorage, ChildBrowser, CordovaWebViewEngine, DefaultVolumeStream, DisallowOverscroll, EnableViewportScale, EnableWebGL, ErrorUrl, FullScreen, GapBetweenPages, HideKeyboardFormAccessoryBar, HideMousePointer, InAppBrowserStorageEnabled, KeepRunning, KeyboardDisplayRequiresUserAction, LoadUrlTimeoutValue, LoadingDialog, LogLevel, MediaPlaybackAllowsAirPlay, MediaPlaybackRequiresUserAction, Min/Max Version, Orientation, OSXLocalStoragePath, OverrideUserAgent, PageLength, PaginationBreakingMode, PaginationMode, PopupBlocker, SetFullscreen, ShowTitle, Suppresses3DTouchGesture, SuppressesIncrementalRendering, SuppressesLongPressGesture, TopActivityIndicator, UIWebViewDecelerationSpeed, WebSecurity, WindowSize, WindowsDefaultUriPrefix, WindowsStoreDisplayName, WindowsStoreIdentityName, WindowsStorePublisherName, WindowsToastCapable, deployment-target, target-device, windows-phone-target-version, windows-target-version]'. It must be a value from the enumeration.   config.xml  /Test/platforms/android/res/xml line 22 XML Problem

这是Eclipse生成的默认config.xml文件:

代码语言:javascript
复制
<?xml version='1.0' encoding='utf-8'?>
<widget id="org.adn.test" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Prueba</name>
    <description>
        A sample Apache Cordova application that responds to the
        deviceready
        event.
    </description>
    <author email="thym-dev@eclipse.org" href="http://www.eclipse.org/thym">
        Eclipse.org -
        Thym
    </author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <allow-intent href="market:*" />
    <preference name="loglevel" value="DEBUG" />
</widget>

这是defaults.xml文件,也是自动生成的:

代码语言:javascript
复制
<?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">

    <!-- Preferences for Android -->
    <preference name="loglevel" value="DEBUG" />
</widget>

安装在我的计算机上的Cordova版本是,但我不确定它是否与使用的版本相同.

我一直在搜索,但找不到任何关于Eclipse的教程或指南。甚至在eclipse项目的页面上也没有。这件事很难解决。我真的不明白为什么在自动生成的基本示例项目中会出现错误。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-08-25 10:17:32

我想我刚刚找到了我自己问题的答案:

对于Cordova文档,Eclipse生成的loglevelloglevel属性必须是LogLevel。该错误导致错误出现,正如错误描述的那样。

链接到科多瓦在Config.xml 这里上的医生。只要向下滚动直到你找到LogLevel。以防有人发现这个有用。

我真的不知道是否有报告Eclipse THyM团队这个问题,或者它甚至值得报告。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39142425

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档