0

I am trying to update app icon before building app using Github action using this command

 - name: add icon
   run: curl https://www.example.org/precomposed.png  >  android/app/src/main/res/drawable/ic_launcher_milla.png  


This code make a black image or a blank image not the real image from url
How to fix this issue?

Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107
Midhilaj
  • 4,905
  • 9
  • 45
  • 88

1 Answers1

1

Are you sure that the issue is with curl? I tested it on publicly available file and all looks fine.

name: Curl PNG

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
  
  workflow_dispatch:

jobs:
  run_tests:
    runs-on: ubuntu-20.04
    steps:
    - name: add icon
      run:  curl https://i.pinimg.com/originals/ca/a9/df/caa9df0ae36595e7d4b9961596adc218.png > some.png
    - uses: actions/upload-artifact@v2
      with:
        name: my-artifact
        path: some.png

Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107
  • it is create a blank file only – Midhilaj Dec 03 '20 at 15:00
  • do we need to add any code for wait to finish download? – Midhilaj Dec 03 '20 at 15:06
  • Did you try to publish this file as artifact and check png? Did you try with another png file? You don't need to wait, curl is blocking here. – Krzysztof Madej Dec 03 '20 at 22:33
  • After finishing build i download the (artifact) apk file and decode it and i fount a black image not the remote image but it created new file with given name but it is a black image – Midhilaj Dec 04 '20 at 13:14
  • I don't try with your example may be it is working but what i need is to replace the image and take the apk build using github – Midhilaj Dec 04 '20 at 13:16
  • Why i ask for delay is it is showing as 0 sec that is why i thing about the delay for example we are suing await for thred – Midhilaj Dec 04 '20 at 13:18
  • I tried with diffrent image file and the result is same – Midhilaj Dec 04 '20 at 13:27
  • i try to add jpg file and when i open that image it is showing as 'The file “newjog.jpg” could not be opened because it is empty.' – Midhilaj Dec 04 '20 at 14:49
  • I understood. My point actually was to check with your file if this is sth related to download via curl, or not. Can you try to split that into 3 steps? First download your png file to some location. Second upload that file as artifact (to be sure that you download it correctly). Third copy that file to location where it can be used in your package. – Krzysztof Madej Dec 04 '20 at 21:14
  • I upload image as artifact and it is ok , but after that i move it to android folder but it is again blank image – Midhilaj Dec 05 '20 at 07:02
  • I got a new solution and thankyou for supporting – Midhilaj Dec 06 '20 at 05:02