Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android cordova图标和splashscreen不工作_Android_Cordova_Cordova Plugins - Fatal编程技术网

Android cordova图标和splashscreen不工作

Android cordova图标和splashscreen不工作,android,cordova,cordova-plugins,Android,Cordova,Cordova Plugins,我在这里面临着一个困境。我的cordova应用程序运行良好,但是图标和splashscreen没有,它们反映了默认的cordova图标和splashscreen。 我的config.xml如下所示,图标和图像存在于我的目录路径中,但它们没有被反映出来。cordova SplashScreen插件也已正确安装。我可能做错了什么 <?xml version='1.0' encoding='utf-8'?> <widget id="com.something.portal" vers

我在这里面临着一个困境。我的cordova应用程序运行良好,但是图标和splashscreen没有,它们反映了默认的cordova图标和splashscreen。 我的config.xml如下所示,图标和图像存在于我的目录路径中,但它们没有被反映出来。cordova SplashScreen插件也已正确安装。我可能做错了什么

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.something.portal" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Someapp</name>
    <description>
        Someapp
    </description>
    <author email="cliffjimmy27@gmail.com" href="https://gmail.com">
        Obonyo Jimmycliff
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" spec="1" />
    <access origin="*" />
    <access origin="cdvfile://*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <icon src="res/icon.png" />
    <platform name="android">
        <allow-intent href="market:*" />
        <splash src="res/screen/android/splash-land-hdpi.png" density="land-hdpi"/>
        <splash src="res/screen/android/splash-land-ldpi.png" density="land-ldpi"/>
        <splash src="res/screen/android/splash-land-mdpi.png" density="land-mdpi"/>
        <splash src="res/screen/android/splash-land-xhdpi.png" density="land-xhdpi"/>

        <splash src="res/screen/android/splash-port-hdpi.png" density="port-hdpi"/>
        <splash src="res/screen/android/splash-port-ldpi.png" density="port-ldpi"/>
        <splash src="res/screen/android/splash-port-mdpi.png" density="port-mdpi"/>
        <splash src="res/screen/android/splash-port-xhdpi.png" density="port-xhdpi"/>
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
    <preference name="AndroidPersistentFileLocation" value="Compatibility" />
    <plugin name="cordova-plugin-splashscreen" spec="~4.0.0" />
    <plugin name="cordova-plugin-camera" spec="~2.3.0" />
    <plugin name="cordova-plugin-file-transfer" spec="~1.6.0" />
    <plugin name="cordova-plugin-file" spec="~4.3.0" />
    <plugin name="cordova-plugin-geolocation" spec="~2.4.0" />
</widget>

Someapp
Someapp
奥博尼奥吉姆西克利夫酒店
当前开发版本:

  • cordova版本:6.0.0
  • 爱奥尼亚版本:1.7.14
请不要以为我能为自己说话:

我刚刚创建了一个testapp,虽然图标起作用,但我也遇到了与splash图像相同的问题。结果是,首选项延迟设置得太低。当您使用ionic创建cordova项目时,SplashScreenDelay被分配为2秒(2000秒),在我的例子中,这太低了。我一看到第一页,2秒钟就过去了

默认设置是5秒,但当我删除SplashScreenDelay时,我也没有看到任何飞溅图像,但当我为SplashScreenDelay指定5秒时,它就工作了。我还注意到,当我重新打开我的应用程序时,在关闭应用程序后,也没有飞溅图像再次显示。让我们说这里很奇怪

因此,我建议您使用该插件,以确保无论您是否为SplashScreenDelay指定了较低的值,您的飞溅图像始终显示

config.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.testapp128533" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <name>testapp</name>
  <description>
        An Ionic Framework and Cordova project.
    </description>
  <author email="you@example.com" href="http://example.com/">
      Your Name Here
    </author>
  <content src="index.html"/>
  <access origin="*"/>
  <preference name="SplashScreenDelay" value="5000"/>
  <icon src="icon.png" />
  <platform name="android">
    <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi/screen.png" />
    <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi/screen.png" />
    <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi/screen.png" />
    <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi/screen.png" />
    <splash density="hdpi" src="resources/android/splash/drawable-hdpi/screen.png" />
    <splash density="ldpi" src="resources/android/splash/drawable-ldpi/screen.png" />
    <splash density="mdpi" src="resources/android/splash/drawable-mdpi/screen.png" />
    <splash density="xhdpi" src="resources/android/splash/drawable-xhdpi/screen.png" />
    <splash density="land-xxhdpi" src="resources/android/splash/drawable-xhdpi/screen.png" />
    <splash density="land-xxxhdpi" src="resources/android/splash/drawable-xhdpi/screen.png" />
    <splash density="port-xxhdpi" src="resources/android/splash/drawable-xhdpi/screen.png" />
    <splash density="port-xxxhdpi" src="resources/android/splash/drawable-xhdpi/screen.png" />
    <splash density="xxhdpi" src="resources/android/splash/drawable-xhdpi/screen.png" />
    <splash density="xxxhdpi" src="resources/android/splash/drawable-xhdpi/screen.png" />
  </platform>
</widget>

特斯塔普
爱奥尼亚框架和科尔多瓦项目。

Cordova不支持所有ios设备。要用一个文件生成所有可能的图标和闪屏,我只能建议使用和


操作说明很简单,我在5分钟内就完成了所有操作。

您使用的是哪种Cordova版本?最近我不得不从6.4.x降级到6.3.1(不知道为什么,但它能工作)我使用的是6.4.x,嗯,让我试试,如果能工作,让我知道:)。所以我可以把它作为一个答案发布。你是否也尝试过删除平台包装器元素(android、ios)并用每个splash元素将平台定义为attribute?就像。@JimmyObonyoAbor我实际上也使用了cordova,这个例子应该能说明我的意思。我们都知道这两个框架之间几乎没有什么区别,所以我可以使用最少的splash平台属性,就像我在phonegap中使用它们一样。不幸的是,我不知道如何从phonegap版本确定cordova版本。