Last active
July 1, 2023 21:15
-
-
Save richard-flosi/8b43c06732d296f1145b8f5d12bf194e to your computer and use it in GitHub Desktop.
Netlify Build command script to deploy a Flutter Web App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
FLUTTER_BRANCH=`grep channel: .metadata | sed 's/ channel: //g'` | |
FLUTTER_REVISION=`grep revision: .metadata | sed 's/ revision: //g'` | |
git clone https://github.com/flutter/flutter.git | |
cd flutter | |
git checkout $FLUTTER_BRANCH | |
git pull origin $FLUTTER_BRANCH | |
git checkout $FLUTTER_REVISION | |
cd .. | |
flutter/bin/flutter config --enable-web | |
flutter/bin/flutter build web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[build] | |
command = "./flutter-netlify-build.sh" | |
publish = "build/web" |
@fisforfaheem This example is pretty old now and it looks like Netlify is reporting your build failed. I'd probably work on getting the build to work locally first and there is probably a better way to do this now. Have you read through the Flutter web docs here? https://docs.flutter.dev/platform-integration/web/building
yes did all the stuff no luck
[image: Mailtrack]
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&>
Sender
notified by
Mailtrack
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&>
07/02/23,
02:12:27 AM
…On Sat, Jul 1, 2023 at 1:54 AM Richard Flosi ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
@fisforfaheem <https://github.com/fisforfaheem> This example is pretty
old now and it looks like Netlify is reporting your build failed. I'd
probably work on getting the build to work locally first and there is
probably a better way to do this now. Have you read through the Flutter web
docs here? https://docs.flutter.dev/platform-integration/web/building
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/richard-flosi/8b43c06732d296f1145b8f5d12bf194e#gistcomment-4615611>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIRXJSDOUBBHL4TID3PJWALXN44HJBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTAMBQHA2TGMRXU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you were mentioned.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
i tried
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to fix this error: 12:18:29 PM: Exception: Failed to compile application for the Web.
12:18:29 PM:
12:18:29 PM: build.command failed
12:18:29 PM: ────────────────────────────────────────────────────────────────
12:18:29 PM:
12:18:29 PM: Error message
12:18:29 PM: Command failed with exit code 1: if cd flutter; then git pull && cd ..; else git clone https://github.com/flutter/flutter.git; fi && flutter/bin/flutter config --enable-web && flutter/bin/flutter build web --release (https://ntl.fyi/exit-code-1)
12:18:29 PM:
12:18:29 PM: Error location
12:18:29 PM: In Build command from Netlify app:
12:18:29 PM: if cd flutter; then git pull && cd ..; else git clone https://github.com/flutter/flutter.git; fi && flutter/bin/flutter config --enable-web && flutter/bin/flutter build web --release
12:18:29 PM:
12:18:29 PM: Resolved config
12:18:29 PM: build:
12:18:29 PM: command: if cd flutter; then git pull && cd ..; else git clone https://github.com/flutter/flutter.git; fi && flutter/bin/flutter config --enable-web && flutter/bin/flutter build web --release
12:18:29 PM: commandOrigin: ui
12:18:29 PM: environment:
12:18:29 PM: - REVIEW_ID
12:18:29 PM: publish: /opt/build/repo/build/web
12:18:29 PM: publishOrigin: ui
12:18:31 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:18:31 PM: Failing build: Failed to build site
12:18:32 PM: Finished processing build request in 1m21.142s