Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fail on expo eas build #31

Open
bhyoo99 opened this issue Dec 14, 2023 · 7 comments
Open

build fail on expo eas build #31

bhyoo99 opened this issue Dec 14, 2023 · 7 comments

Comments

@bhyoo99
Copy link

bhyoo99 commented Dec 14, 2023

in eas prebuild [Android, iOS]

yarn run v1.22.19
$ /home/expo/workingdir/build/node_modules/.bin/expo prebuild --no-install --platform android
- Creating native project directories (./ios and ./android) and updating .gitignore
✔ Created native project | gitignore skipped
- Updating your package.json scripts, dependencies, and main file
✔ Updated package.json and added index.js entry point for iOS and Android
- Config syncing
Using node to generate images. This is much slower than using native packages.
› Optionally you can stop the process and try again after successfully running `npm install -g sharp-cli`.
- Config syncing
✖ Config sync failed
Error: [android.dangerous]: withAndroidDangerousBaseMod: Unrecognised filter type - 255
Error: [android.dangerous]: withAndroidDangerousBaseMod: Unrecognised filter type - 255
    at n._reverseFilterLine (/home/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:238258)
    at e.process (/home/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:40580)
    at e.process (/home/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:511680)
    at t.exports (/home/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:420110)
    at e.read [as image/png] (/home/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:1865)
    at Jimp.parseBitmap (/home/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:125704)
    at Jimp.parseBitmap (/home/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:8514)
    at /home/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:7613
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
error Command failed with exit code 1.

draft solution
using v0.0.13 it works!
fail in ios too

@bhyoo99
Copy link
Author

bhyoo99 commented Feb 14, 2024

@yjose Do you have any experience with this problem?

@yjose
Copy link
Member

yjose commented Feb 14, 2024

@bhyoo99 I am a bit confused because we are not using jimp-compact, so the error is probably not related to the plugin. Can you confirm that if you disable the plugin, the rebuild works correctly?

@bhyoo99
Copy link
Author

bhyoo99 commented Feb 15, 2024

Yes, I try without plugin, it works.

I'll test it in more ways and leave an additional message THX

@patlux
Copy link

patlux commented Feb 25, 2024

Same issue locally with expo 50

PREBUILD] Error: [ios.dangerous]: withIosDangerousBaseMod: Could not find MIME for Buffer <null>piling react-native-screens Pods/RNScreens » RNSScreen.mm
[PREBUILD] Error: [ios.dangerous]: withIosDangerousBaseMod: Could not find MIME for Buffer <null>
[PREBUILD]     at Jimp.parseBitmap (/private/var/folders/b3/qq1v4qhj0h94_d12flgnqx840000gn/T/eas-build-local-nodejs/9e25bcba-b852-4352-89cf-201aed349a8a/build/node_modules/jimp-compact/dist/jimp.js:1:125518)
[PREBUILD]     at Jimp.parseBitmap (/private/var/folders/b3/qq1v4qhj0h94_d12flgnqx840000gn/T/eas-build-local-nodejs/9e25bcba-b852-4352-89cf-201aed349a8a/build/node_modules/jimp-compact/dist/jimp.js:1:8514)
[PREBUILD]     at /private/var/folders/b3/qq1v4qhj0h94_d12flgnqx840000gn/T/ea
s-build-local-nodejs/9e25bcba-b852-4352-89cf-201aed349a8a/build/node_modules/jimp-compact/dist/jimp.js:1:7613
[PREBUILD]     at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)
[PREBUILD] error: "expo" exited with code 1
[PREBUILD] 
Error: bun expo prebuild --no-install --platform ios exited with non-zero code: 1
    at ChildProcess.completionListener (/Users/patwoz/.npm/_npx/1a85490733db6fa1/node_modules/@expo/spawn-async/build/spawnAsync.js:42:23)
    at Object.onceWrapper (node:events:633:26)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:518:28)
    at Pipe.<anonymous> (node:net:337:12)
    ...
    at spawnAsync (/Users/patwoz/.npm/_npx/1a85490733db6fa1/node_modules/@expo/spawn-async/build/spawnAsync.js:7:23)
    at spawn (/Users/patwoz/.npm/_npx/1a85490733db6fa1/node_modules/@expo/turtle-spawn/dist/index.js:16:47)
    at runExpoCliCommand (/Users/patwoz/.npm/_npx/1a85490733db6fa1/node_modules/@expo/build-tools/dist/utils/project.js:37:47)
    at prebuildAsync (/Users/patwoz/.npm/_npx/1a85490733db6fa1/node_modules/@expo/build-tools/dist/common/prebuild.js:25:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/patwoz/.npm/_npx/1a85490733db6fa1/node_modules/@expo/build-tools/dist/builders/ios.js:58:13
    at async BuildContext.runBuildPhase (/Users/patwoz/.npm/_npx/1a85490733db6fa1/node_modules/@expo/build-tools/dist/context.js:98:28)
    at async buildAsync (/Users/patwoz/.npm/_npx/1a85490733db6fa1/node_modules/@expo/build-tools/dist/builders/ios.js:49:9)
    at async runBuilderWithHooksAsync (/Users/patwoz/.npm/_npx/1a85490733db6fa1/node_modules/@expo/build-tools/dist/builders/common.js:12:13)
    at async Object.iosBuilder (/Users/patwoz/.npm/_npx/1a85490733db6fa1/node_modules/@expo/build-tools/dist/builders/ios.js:28:16)

Build failed
Unknown error. See logs of the Prebuild build phase for more information.
npx exited with non-zero code: 1
    Error: build command failed.
error: script "ios" exited with code 1

@Harjot1Singh
Copy link

Harjot1Singh commented Apr 18, 2024

I'm also seeing the same fairly frequently - sometimes it works, and sometimes it doesn't:

Error: [android.dangerous]: withAndroidDangerousBaseMod: Could not find MIME for Buffer <null>
Error: [android.dangerous]: withAndroidDangerousBaseMod: Could not find MIME for Buffer <null>
    at Jimp.parseBitmap (/home/runner/work/mobile/mobile/node_modules/jimp-compact/dist/jimp.js:1:1255[18](https://github.com/shabados/mobile/actions/runs/8746039107/job/24002149044#step:7:19))
    at Jimp.parseBitmap (/home/runner/work/mobile/mobile/node_modules/jimp-compact/dist/jimp.js:1:8514)
    at /home/runner/work/mobile/mobile/node_modules/jimp-compact/dist/jimp.js:1:7613
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)

I currently suspect that sometimes the wrong file is being read in as an icon - that's what produces the error. Will dig in to see if there's anywhere this is possible...

@yjose
Copy link
Member

yjose commented Apr 23, 2024

@Harjot1Singh Ok, Maybe I know what is causing the issue.

Normally, the function we are calling to add the badge is async, but the problem is that the config plugin don't support running async function and we mainly running it without await to prevent this issue.

Apparently, this is working for most cases but may cause this issue to appear sometimes. The solution is to look at how we can run the function using await and ensure that the new images are generated before updating the icon in the config.

@SihamBen can you help on that whenever you have some free time 🙏

@Harjot1Singh
Copy link

Sounds about right, @yjose, thansk for getting back! I can think of 2 solutions:

  1. Export this as a mod instead of a plugin. This seems like a good use-case for a mod, which can be asynchronous
  2. "Cheat async" by blocking the return of the function until the promises have returned (by setting some sort of flag in a .finally call and polling with setTimeout etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants