Expo is not Building Android Apk app

I am stuck in this Issue I have checked my files and there is no /app/turtle/ directory. I do not understand error: failed to read PNG signature: file does not start with PNG signature for a shell notification png. I do not have that file in my project.

This is what log says.

[stderr]

FAILURE: Build failed with an exception.

102[stderr]

* What went wrong:

103[stderr]

Execution failed for task ':app:mergeReleaseResources'.

104[stderr]

> Multiple task action failures occurred:

105[stderr]

   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

106[stderr]

      > Android resource compilation failed

107[stderr]

        /app/turtle/workingdir/android/sdk40/android-shell-app/app/src/main/res/drawable-mdpi/shell_notification_icon.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.

108[stderr]

            

109[stderr]

        /app/turtle/workingdir/android/sdk40/android-shell-app/app/src/main/res/drawable-mdpi/shell_notification_icon.png: AAPT: error: file failed to compile.

110[stderr]

            

111[stderr]

   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

112[stderr]

      > Android resource compilation failed

113[stderr]

        /app/turtle/workingdir/android/sdk40/android-shell-app/app/src/main/res/mipmap-mdpi/ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.

114[stderr]

            

115[stderr]

        /app/turtle/workingdir/android/sdk40/android-shell-app/app/src/main/res/mipmap-mdpi/ic_launcher.png: AAPT: error: file failed to compile.

116[stderr]

            

117[stderr]

   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

118[stderr]

      > Android resource compilation failed

119[stderr]

        /app/turtle/workingdir/android/sdk40/android-shell-app/app/src/main/res/drawable-xhdpi/shell_notification_icon.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.

120[stderr]

            

121[stderr]

        /app/turtle/workingdir/android/sdk40/android-shell-app/app/src/main/res/drawable-xhdpi/shell_notification_icon.png: AAPT: error: file failed to compile.

122[stderr]

            

123[stderr]

   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

124[stderr]

      > Android resource compilation failed

125[stderr]

        /app/turtle/workingdir/android/sdk40/android-shell-app/app/src/main/res/mipmap-hdpi/ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.

126[stderr]

            

127[stderr]

        /app/turtle/workingdir/android/sdk40/android-shell-app/app/src/main/res/mipmap-hdpi/ic_launcher.png: AAPT: error: file failed to compile.

128[stderr]

            

129[stderr]

   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

130[stderr]

      > Android resource compilation failed

131[stderr]

        /app/turtle/workingdir/android/sdk40/android-shell-app/app/src/main/res/drawable-xxhdpi/shell_notification_icon.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.

132[stderr]

            

133[stderr]

        /app/turtle/workingdir/android/sdk40/android-shell-app/app/src/main/res/drawable-xxhdpi/shell_notification_icon.png: AAPT: error: file failed to compile.

134[stderr]

            

135[stderr]

   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

136[stderr]

      > Android resource compilation failed

137[stderr]

        /app/turtle/workingdir/android/sdk40/android-shell-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.

138[stderr]

            

139[stderr]

        /app/turtle/workingdir/android/sdk40/android-shell-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: AAPT: error: file failed to compile.

140[stderr]

            

141[stderr]

* Try:

142[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.

143[stderr]

* Get more help at https://help.gradle.org

144[stderr]

BUILD FAILED in 1m 12s

Hi

This is a path on the Expo build servers.

It looks like one or more of the images in your app is not a valid PNG.

What images do you have in your app?
What do you have in app.json?

This is what I have in app.json

{
“expo”: {
“name”: “AwesomeProject”,
“slug”: “AwesomeProject”,
“version”: “1.0.0”,
“orientation”: “default”,
“icon”: “./assets/icon.png”,
“splash”: {
“image”: “./assets/splash.png”,
“resizeMode”: “contain”,
“backgroundColor”: “#ffffff”
},
“updates”: {
“fallbackToCacheTimeout”: 0
},
“assetBundlePatterns”: [
“**/*”
],
“ios”: {
“supportsTablet”: true
},
“android”: {
“adaptiveIcon”: {
“foregroundImage”: “./assets/adaptive-icon.png”,
“backgroundColor”: “#FFFFFF”
},
“package”: “com.lokis.lokistream”

},
"web": {
  "favicon": "./assets/favicon.png"
}

}
}

I really haven’t changed Much.

Are the following all default images or did you replace any of them with your own images?

  "icon": "./assets/icon.png",
  "image": "./assets/splash.png",
  "foregroundImage": "./assets/adaptive-icon.png",
    "favicon": "./assets/favicon.png"

Also are there any other .png files in your app’s directory or subdirectories?

Does anything change if you change the assetBundlePatterns to the following?

"assetBundlePatterns": [
  "assets/**/*"
],

Also, if you’re on Linux or Mac, maybe try running something like the following and checking if any of the files are not detected as PNG files:

$ find . -type f -name '*.png' -print0 | xargs -0 file
1 Like

Changing it to this

“assetBundlePatterns”: [
“assets/**/*”
],

Worked For me thank you so much man. Really appreciate your help.

1 Like

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