在phonegap版本cli 5.2.0上构建之后,屏幕不显示 [英] Splash screen is not display after build on phonegap version cli 5.2.0

查看:153
本文介绍了在phonegap版本cli 5.2.0上构建之后,屏幕不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了电话gapap应用程序的启动屏幕,但升级后我的启动屏幕不显示我有在cofig文件中编写的代码是如下所示,并且我已经添加屏幕为每个phonegap启动屏幕文档。并且我已在项目中添加了默认屏幕图像。

I have made splash screen for phonegap application but after upgrade my splash screen is not display i have written code in cofig file is as below and also i have added screen as per phonegap splash screen documentation. and also i have added default screen image in project.

  <widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.abc.mobileapp" version="1.0.0" versionCode = "10">
  <name>abc</name>
  <description></description>
  <author email="admin@abc.com">abc</author>
  <content src="abc.html"/>
  <preference name='phonegap-version'/>
  <preference name="permissions" value="none"/>
  <preference name="orientation" value="default"/>
  <preference name="target-device" value="universal"/>
  <preference name="fullscreen" value="false"/>
  <preference name="webviewbounce" value="true"/>
  <preference name="prerendered-icon" value="true"/>
  <preference name="stay-in-webview" value="false"/>
  <preference name="ios-statusbarstyle" value="black-opaque"/>
  <preference name="detect-data-types" value="true"/>
  <preference name="exit-on-suspend" value="false"/>
  <preference name="show-splash-screen-spinner" value="true"/>
  <preference name="auto-hide-splash-screen" value="true"/>
  <preference name="disable-cursor" value="false"/>
  <preference name="android-minSdkVersion" value="14"/>
  <preference name="android-installLocation" value="auto"/>
  <!--<preference name="SplashScreen" value="screen" />-->
  <preference name="SplashScreenDelay" value="5000" />
  <!--<preference name="splash-screen-duration" value="6000" />-->

  <!--<gap:plugin name="org.apache.cordova.battery-status"/>
  <gap:plugin name="org.apache.cordova.camera"/>
  <gap:plugin name="org.apache.cordova.media-capture"/>
  <gap:plugin name="org.apache.cordova.console"/>
  <gap:plugin name="org.apache.cordova.contacts"/>
  <gap:plugin name="org.apache.cordova.device"/>
  <gap:plugin name="org.apache.cordova.device-motion"/>
  <gap:plugin name="org.apache.cordova.device-orientation"/>
  <gap:plugin name="org.apache.cordova.dialogs"/>
  <gap:plugin name="org.apache.cordova.file"/>
  <gap:plugin name="org.apache.cordova.file-transfer"/>
  <gap:plugin name="org.apache.cordova.geolocation"/>
  <gap:plugin name="org.apache.cordova.globalization"/>-->
  <gap:plugin name="org.apache.cordova.device" source="npm"/>
  <gap:plugin name="cordova-plugin-inappbrowser" source="npm" />
  <gap:plugin name="nl.x-services.plugins.socialsharing" source="plugins.cordova.io" />

  <gap:plugin name="org.apache.cordova.network-information"  version="0.2.12" source="npm"/>
  <gap:plugin name="org.apache.cordova.splashscreen" version="0.3.4" source="npm" />
  <gap:plugin name="org.apache.cordova.vibration" version="0.3.11" source="npm"/>
  <gap:plugin name="com.phonegap.plugins.facebookconnect" version="0.9.0">
    <param name="APP_ID" value="0000000000000000" />
    <param name="APP_NAME" value="abc" />
  </gap:plugin>

  <!-- Third party plugins -->
  <!-- A list of available plugins are available at https://build.phonegap.com/plugins -->
  <!--<gap:plugin name="com.phonegap.plugins.barcodescanner" />-->

  <!--https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin/blob/2fdfde7/README.md
  <gap:plugin name="nl.x-services.plugins.toast" version="2.0.2" />-->

  <icon src="icon.png"/>
  <icon src="res/icon/android/icon-36-ldpi.png" gap:platform="android" gap:qualifier="ldpi"/>
  <icon src="res/icon/android/icon-48-mdpi.png" gap:platform="android" gap:qualifier="mdpi"/>
  <icon src="res/icon/android/icon-72-hdpi.png" gap:platform="android" gap:qualifier="hdpi"/>
  <icon src="res/icon/android/icon-96-xhdpi.png" gap:platform="android" gap:qualifier="xhdpi"/>
  <icon src="res/icon/blackberry/icon-80.png" gap:platform="blackberry"/>
  <icon src="res/icon/blackberry/icon-80.png" gap:platform="blackberry" gap:state="hover"/>
  <icon src="res/icon/ios/icon-57.png" gap:platform="ios" width="57" height="57"/>
  <icon src="res/icon/ios/icon-72.png" gap:platform="ios" width="72" height="72"/>
  <icon src="res/icon/ios/icon-57-2x.png" gap:platform="ios" width="114" height="114"/>
  <icon src="res/icon/ios/icon-72-2x.png" gap:platform="ios" width="144" height="144"/>
  <icon src="res/icon/webos/icon-64.png" gap:platform="webos"/>
  <icon src="res/icon/windows-phone/icon-48.png" gap:platform="winphone"/>
  <icon src="res/icon/windows-phone/icon-173-tile.png" gap:platform="winphone" gap:role="background"/>

  <gap:splash src="res/screen/default.png" />
  <gap:splash src="res/screen/android/screen-ldpi-portrait.png" gap:platform="android" gap:qualifier="port-ldpi"/>
  <gap:splash src="res/screen/android/screen-mdpi-portrait.png" gap:platform="android" gap:qualifier="port-mdpi"/>
  <gap:splash src="res/screen/android/screen-hdpi-portrait.png" gap:platform="android" gap:qualifier="port-hdpi"/>
  <gap:splash src="res/screen/android/screen-xhdpi-portrait.png" gap:platform="android" gap:qualifier="port-xhdpi"/>
  <gap:splash src="res/screen/blackberry/screen-225.png" gap:platform="blackberry"/>
  <gap:splash src="res/screen/ios/screen-iphone-portrait.png" gap:platform="ios" width="320" height="480"/>
  <gap:splash src="res/screen/ios/screen-iphone-portrait-2x.png" gap:platform="ios" width="640" height="960"/>
  <gap:splash src="res/screen/ios/screen-iphone-portrait-568h-2x.png" gap:platform="ios" width="640" height="1136"/>
  <gap:splash src="res/screen/ios/screen-ipad-portrait.png" gap:platform="ios" width="768" height="1024"/>
  <gap:splash src="res/screen/ios/screen-ipad-landscape.png" gap:platform="ios" width="1024" height="768"/>
  <gap:splash src="res/screen/windows-phone/screen-portrait.jpg" gap:platform="winphone"/>
  <access origin="*"/>
  <!--<access origin="*xitstage-001-site3.mysitepanel.net"/>-->
  <gap:plugin name="cordova-plugin-whitelist" version="1" source="npm"/>
  <allow-intent href="http://*/*"/>
  <allow-intent href="https://*/*"/>
  <allow-intent href="tel:*"/>
  <allow-intent href="sms:*"/>
  <allow-intent href="mailto:*"/>
  <allow-intent href="geo:*"/>
  <platform name="android">
    <allow-intent href="market:*"/>
  </platform>
  <platform name="ios">
    <allow-intent href="itms:*"/>
    <allow-intent href="itms-apps:*"/>
  </platform>
</widget>

与upgarde的phonegap应用程序有什么变化。

What changeset i have to do with upgarde of phonegap application.

推荐答案

@vatsal,

好​​吧,你有很多错误,到Cordova / Phonegap。

@vatsal,
Okay, you have a quite a few mistakes that are common to developers new to Cordova/Phonegap.

首先阅读,只是本文档中的 BOLD 点,因为您将首先修复您的内容,更细致的细节。

First read, just the BOLD points in this document, because you will want to fix your stuff first, then get the finer details.

开发者对Cordova / Phonegap的新错误

第一次 / strong>你想做的是为你的编译器设置一个版本。对于此读
6。不为您的编译器设置phonegap版本

The FIRST THING you want to do is set a version for your compiler. For this read
6. Not setting the "phonegap version" for your compiler

我QUOTE


使用CLI版本,如果您不为您的平台分配版本(..)(和)如果你不幸运,你会得到一套级联错误。

With the CLI version, if you do not assign a version for your platform (..)(and) If you are not lucky, you'll get a set of cascading error.

BTWS,你不幸运。这样做不会修复错误,但它很重要。

BTWS, you are not lucky. Doing this will NOT fix the mistakes, but it is important. You can read the entire document later for a better understanding.

下一步 您需要获得所有核心插件 NPM从现在开始。并确保为此设置版本。为此,请读取

11。

NEXT THING you need to get ALL your core plugins from NPM from now on. And make sure to set the versions for this. For this read
11. You need to get your plugins from NPM now.

例如,您需要将splashscreen插件作为 cordova-plugin-splashscreen 。 config.xml中的条目如下所示:

As an example, you need to source your splashscreen plugin as cordova-plugin-splashscreen. The entry in config.xml would look like this:

< gap:plugin name =cordova-plugin-splashscreenversion =2.1 .0source =npm/>

注意,名称的拼写不同,版本号较高。

NOTE, the the different spelling for the name, and the higher version number.

更新:2016-02-11 自2015年11月19日起,该声明不再是真的。您可以使用< plugin(...)> < gap:plugin(...)> 。有关详情,请参见博文
还有,如果你正在使用 Phonegap Build ,那么我给你的例子还行。如果您使用Cordova CLI或Phonegap CLI,则不要使用 gap:plugin

Update: 2016-02-11 As of 19 Nov, 2015, the statement is not longer true. You can use either <plugin (...)> or <gap:plugin (...)>. See the blog post for details. ALSO, if you are using Phonegap Build, then the examples I am giving you are okay. If you are using Cordova CLI or Phonegap CLI, you do not use gap:plugin.

如果您使用CLI,请再次阅读 6。 - 它有如何使用插件版本的答案。但请注意,她的示例是针对非NPM的,因此正确的名称位于 NPM存储库

If you are using a CLI, then read 6. again - it has the answer on how to use versions with plugins. But be aware, her examples are for the non-NPM, so the correct names are in NPM repository from now on.

最后,我无法检查您的图片。所以,你可能不会得到闪屏显示。我有一个演示,您可以在这里查看: Phonegap-Splashscreen-Test 。但是,它是建立在版本 phonegap-version = 3.5.0 。所以,你可以检查你的文件路径和名称,但不是代码。此外,该代码存储库有注释为什么文件名需要是什么。


我知道一些是混乱的,所以只是进行更改,然后我们可能需要再次通过它。


Best of Luck

One last thing, I have no way to check your images. So, you MAY not get the splash screens to show up. I have a demo you can check here: Phonegap-Splashscreen-Test. However, it is built on version phonegap-version=3.5.0. So, you can check your file paths and names, but not the code. Also, that code repository has notes on why the filenames need to be what they are.

I know some of this is confusing, so just make the changes, then we might need to walk through it again.

Best of Luck

这篇关于在phonegap版本cli 5.2.0上构建之后,屏幕不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆