Build keeps failing because of something that makes no sense to me

Hi there,
First of all, please forgive me if this has been solved elsewhere, I can’t seem to get mine to work with the solutions I’ve seen.
You can see from here that all my builds continue to fail and I’ve searched online and seen similar cases, where majority of them was to either do with assets having same file name but different extentions, or files using wrong extensions (.jpg really should be .png) or something to do with assets pattern.

expo diagnostics gives me:

  Expo CLI 3.11.9 environment info:
    System:
      OS: macOS 10.14.6
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 13.8.0 - ~/.nvm/versions/node/v13.8.0/bin/node
      Yarn: 1.21.1 - /usr/local/bin/yarn
      npm: 6.13.6 - ~/.nvm/versions/node/v13.8.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.5 AI-191.8026.42.35.6010548
      Xcode: 11.3/11C29 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~36.0.0 => 36.0.2
      react: ~16.9.0 => 16.9.0
      react-native: ~0.61.4 => 0.61.5
    npmGlobalPackages:
      expo-cli: 3.11.9

My builds: Log In — Expo

301 actionable tasks: 301 executed
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:mergeReleaseResources'.
[stderr] > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr]    > Android resource compilation failed
[stderr]      /app/turtle/workingdir/android/sdk36/android-shell-app/app/src/main/res/drawable-xxxhdpi/shell_launch_background_image.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr]          
[stderr]      /app/turtle/workingdir/android/sdk36/android-shell-app/app/src/main/res/drawable-xxxhdpi/shell_launch_background_image.png: AAPT: error: file failed to compile.
[stderr]          
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 1m 55s
Error: ./gradlew exited with non-zero code: 1
    at ChildProcess.completionListener (/app/turtle/node_modules/@expo/xdl/node_modules/@expo/spawn-async/build/spawnAsync.js:52:23)
    at Object.onceWrapper (events.js:317:30)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:915:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
    ...
    at spawnAsync (/app/turtle/node_modules/@expo/xdl/node_modules/@expo/spawn-async/build/spawnAsync.js:17:21)
    at spawnAsyncThrowError (/app/turtle/node_modules/@expo/xdl/build/detach/ExponentTools.js:235:45)
    at buildShellAppAsync (/app/turtle/node_modules/@expo/xdl/build/detach/AndroidShellApp.js:881:11)
    at <anonymous>

sdk version maybe ?

Okay, so after installing turtle-cli to my local machine and running

turtle build:android -u charismaconcept -p HAHA

I still get the following error:
/Users/charismaconcept/.turtle/workingdir/android/sdk36/android-shell-app/app/src/main/res/drawable-xxxhdpi/shell_launch_background_image.png: AAPT: error: file failed to compile

But this time I was able to check it and noticed it has the wrong extension.

file /Users/charismaconcept/.turtle/workingdir/android/sdk36/android-shell-app/app/src/main/res/drawable-xxxhdpi/shell_launch_background_image.png

Gives me:

/Users/charismaconcept/.turtle/workingdir/android/sdk36/android-shell-app/app/src/main/res/drawable-xxxhdpi/shell_launch_background_image.png: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=7, orientation=upper-left, xresolution=98, yresolution=106, resolutionunit=2, software=Adobe Photoshop CS6 (Macintosh), datetime=2020:02:03 20:47:05], baseline, precision 8, 1424x2436, frames 3

I believe this sdk version is downloaded, meaning this must be happening for everyone trying to build their apps ?

So it turns out, this file is actually my splash screen file which I reference in my app.json file.

 "splash": {
      "image": "./assets/imgs/etf-splash-final.png",
      "resizeMode": "cover"
    },

I’ve now saved a png version of it instead of jpeg.
Running the build again.

Thought I might as well note down my journey in case someone else experiences this.

I definitely have a png version of the file
etf-splash-final.png: PNG image data, 1424 x 2436, 8-bit/color RGB, non-interlaced
But after running the build, I still get the same.

This command:
file /Users/charismaconcept/.turtle/workingdir/android/sdk36/android-shell-app/app/src/main/res/drawable-xxxhdpi/shell_launch_background_image.png

Gives me:
/Users/charismaconcept/.turtle/workingdir/android/sdk36/android-shell-app/app/src/main/res/drawable-xxxhdpi/shell_launch_background_image.png: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=7, orientation=upper-left, xresolution=98, yresolution=106, resolutionunit=2, software=Adobe Photoshop CS6 (Macintosh), datetime=2020:02:03 20:47:05], baseline, precision 8, 1424x2436, frames 3

Okay, so I’ve definitely got the new png in my app.
I used the sketch template provided by expo,

I ran the turtle command again, the error is still the same, but the image its referencing is my old splash image, so clearly there is something being cached somewhere but I’m not sure where or even how to reset cache.

FINALLY GOT THERE!!
Final output
copied build to /Users/charismaconcept/expo-apps/@charismaconcept\event-traffic-warner-9funnynumbers-signed.aab

All I had to do was run expo publish then run the turtle command.
So it seems running the turtle command somehow looks at assets already uploaded for some reason instead of those on my local…

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.