Ionic-cli: ionic resources doesn't copy the android icon/splash into the android platform folder

Created on 17 Jan 2017  路  18Comments  路  Source: ionic-team/ionic-cli

_From @tones411 on January 16, 2017 19:44_

Ionic version: (check one with "x")
[ X] 2.x

I'm submitting a ... (check one with "x")
[ X] bug report

Current behavior:
Android icon and splash screen are not copied to the Android platform folders.

Expected behavior:
Android icon and launch screen would be generated and added to the Android platform

Steps to reproduce:
Create a new project by running: "ionic start TestResources --v2"
copy your splash.png and icon.png into the resources folder
run "ionic resources"
Navigate to ./TestResources/platforms/android/res" folders
You will see that the icon and splash images are still using the default Cordova images.

* Notes *
This works for iOS, but not Android

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Cordova CLI: 6.4.0 
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: 1.9.0 
ios-sim version: 3.1.1 
OS: macOS Sierra
Node Version: v6.9.4
Xcode version: Xcode 8.2.1 Build version 8C1002

_Copied from original issue: driftyco/ionic#10056_

old major version

Most helpful comment

I too had this issue generating the wrong icon.

Solved by:
ionic platform rm android
ionic platform add [email protected]

All 18 comments

_From @ghenry22 on January 17, 2017 0:38_

make sure you have at least android platform version 6.1, verison 6.0 of the android platform introduced this problem, it was a cordova issue not an ionic issue if it's the same one.

_From @tones411 on January 17, 2017 1:20_

I have now confirmed that I was on Android platform 6.0.

However, I just I created a new project and ran "ionic platform add [email protected]" and then ran "cordova platform version android" to confirm the version installed.

I ran "ionic resources" again but still no luck. It copies the files to the sub-directories within the ./resources/android/splash/ folder (with a naming convention like this: drawable-land-hdpi-screen.png), but in the corresponding ./platform/android/res/ folders I still have the original Cordova images.

_From @netsesame2 on January 17, 2017 3:54_

Yes, I confirm. I use android sdk 24, that is android 7.
Resources can't be applied in platform folder under windows.
However, MacOs will works well.

_From @tones411 on January 17, 2017 3:56_

Interesting. The issue happens to me on MacOS.

_From @tones411 on January 17, 2017 3:57_

@netsesame2 can you run "cordova platform version android" in your console and show the output?

_From @ghenry22 on January 17, 2017 3:59_

odd mine has been fine since the platform 6.1 update. I don't have a android 7 device to test on though currently.

_From @tones411 on January 17, 2017 4:1_

@ghenry22, the issue manifests itself without actually running it on a device, or even on an emulator. You run "ionic resources" and then browse the file system and you can see that it did not copy the images over to the android platform folder.

_From @netsesame2 on January 17, 2017 4:3_

By checking the platform version, I correct to confirm that I still use the [email protected].

So I update to [email protected] by now, it works.

_From @netsesame2 on January 17, 2017 4:5_

But I can say, on Macos I do use the default version which cordova platform offer, 6.0.0. It works on both android and ios.

_From @ghenry22 on January 17, 2017 4:6_

yes for some reason npm still provides v6.0 by default

_From @tones411 on January 17, 2017 4:8_

@ghenry22 I guess it's probably something wrong on my side. But just to clear up confusion in my mind, can someone explain how the issue is related to Cordova and not Ionic? I didn't think "ionic resources" was dependent on Cordova.

_From @ghenry22 on January 17, 2017 4:46_

@tones411 at lot of what the ionic cli does is passed through to the cordova cli. There was a specific bug with android platform version 6.0 which introduced this exact problem, android platform version 6.1 resolves the issue with never a change to ionic-cli. I suspect that the android platform defines the file names, sizes and locations and ionic generates them and puts them where the platform says.

_From @tones411 on January 17, 2017 4:55_

That makes sense. Thanks!

_From @fabiancarlos on January 17, 2017 6:5_

I update my ionic from 2.1.1 to 2.2.1 and have solved this problem building the android again.

@jgw96 my updated version on this project is "2.2.1".. what the solution from this conversation?

I too had this issue generating the wrong icon.

Solved by:
ionic platform rm android
ionic platform add [email protected]

@WebAddict thank you it solve my problem!!!

Thanks for the issue! This issue appears to be associated with an old version of the Ionic CLI. Please update to the latest CLI version, which supports all versions of the Ionic Framework. If the issue is relevant and if it persists after updating to the latest CLI version, please create a new issue.

Thank you for using Ionic!

Was this page helpful?
0 / 5 - 0 ratings