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 is not made when using shorebird command for making apk #2518

Open
mansigupta07091998 opened this issue Oct 9, 2024 · 20 comments
Open
Labels
bug Something isn't working

Comments

@mansigupta07091998
Copy link

mansigupta07091998 commented Oct 9, 2024

getting the following error when using command shorebird release android --artifact apk while if making release apk using flutter build apk command its not giving any error.

[        ] FAILURE: Build failed with an exception.
[        ] * What went wrong:
[        ] Could not dispatch a message to the daemon.
[        ] * Try:
[        ] > Run with --debug option to get more log output.
[        ] > Run with --scan to get full insights.
[        ] * Exception is:
[        ] org.gradle.launcher.daemon.client.DaemonConnectionException: Could not dispatch a message to the daemon.
[        ] 	at org.gradle.launcher.daemon.client.DaemonClientConnection.dispatch(DaemonClientConnection.java:69)
[        ] 	at org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.java:209)
[        ] 	at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:153)
[        ] 	at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:99)
[        ] 	at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:57)
[        ] 	at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:210)
[        ] 	at org.gradle.launcher.cli.DefaultCommandLineActionFactory$ParseAndBuildAction.execute(DefaultCommandLineActionFactory.java:255)
[ +153 ms] 	at org.gradle.launcher.cli.DefaultCommandLineActionFactory$ParseAndBuildAction.execute(DefaultCommandLineActionFactory.java:226)
[        ] 	at org.gradle.launcher.cli.DebugLoggerWarningAction.execute(DebugLoggerWarningAction.java:82)
[        ] 	at org.gradle.launcher.cli.DebugLoggerWarningAction.execute(DebugLoggerWarningAction.java:30)
[        ] 	at org.gradle.launcher.cli.WelcomeMessageAction.execute(WelcomeMessageAction.java:96)
[        ] 	at org.gradle.launcher.cli.WelcomeMessageAction.execute(WelcomeMessageAction.java:40)
[        ] 	at org.gradle.launcher.cli.NativeServicesInitializingAction.execute(NativeServicesInitializingAction.java:44)
[        ] 	at org.gradle.launcher.cli.NativeServicesInitializingAction.execute(NativeServicesInitializingAction.java:26)
[        ] 	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:41)
[        ] 	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:26)
[        ] 	at org.gradle.launcher.cli.DefaultCommandLineActionFactory$WithLogging.execute(DefaultCommandLineActionFactory.java:357)
[ +188 ms] 	at org.gradle.launcher.Main.doAction(Main.java:35)
[        ] 	at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:50)
[        ] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[        ] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[        ] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[        ] 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[        ] 	at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
[        ] 	at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
[        ] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[        ] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[        ] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ +160 ms] 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[        ] 	at org.gradle.launcher.GradleMain.main(GradleMain.java:34)
[        ] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[        ] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[        ] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[        ] 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[        ] 	at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
[        ] 	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
[        ] 	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
[        ] Caused by: org.gradle.internal.remote.internal.MessageIOException: Could not write '/127.0.0.1:59949'.
[        ] 	at org.gradle.internal.remote.internal.inet.SocketConnection.flush(SocketConnection.java:140)
[        ] 	at org.gradle.launcher.daemon.client.DaemonClientConnection.dispatch(DaemonClientConnection.java:60)
[ +152 ms] 	... 36 more
[        ] Caused by: java.io.IOException: An established connection was aborted by the software in your host machine
[        ] 	at java.base/sun.nio.ch.SocketDispatcher.write0(Native Method)
[        ] 	at java.base/sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:54)
[        ] 	at java.base/sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:132)
[        ] 	at java.base/sun.nio.ch.IOUtil.write(IOUtil.java:76)
[        ] 	at java.base/sun.nio.ch.IOUtil.write(IOUtil.java:53)
[        ] 	at java.base/sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:532)
[        ] 	at org.gradle.internal.remote.internal.inet.SocketConnection$SocketOutputStream.writeWithNonBlockingRetry(SocketConnection.java:279)
[        ] 	at org.gradle.internal.remote.internal.inet.SocketConnection$SocketOutputStream.writeBufferToChannel(SocketConnection.java:267)
[        ] 	at org.gradle.internal.remote.internal.inet.SocketConnection$SocketOutputStream.flush(SocketConnection.java:261)
[        ] 	at org.gradle.internal.remote.internal.inet.SocketConnection.flush(SocketConnection.java:138)
[ +137 ms] 	... 37 more
[        ] * Get more help at https://help.gradle.org
[   +2 ms] Gradle task assembleRelease failed with exit code 1
[        ] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      AndroidGradleBuilder.buildGradleApp (package:flutter_tools/src/android/gradle.dart:500:9)
           <asynchronous suspension>
           #2      AndroidGradleBuilder.buildApk (package:flutter_tools/src/android/gradle.dart:224:5)
           <asynchronous suspension>
           #3      BuildApkCommand.runCommand (package:flutter_tools/src/commands/build_apk.dart:141:5)
           <asynchronous suspension>
           #4      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1408:27)
           <asynchronous suspension>
           #5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #6      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:420:9)
           <asynchronous suspension>
           #8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #9      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:5)
           <asynchronous suspension>
           #10     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:130:9)
           <asynchronous suspension>
           #11     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #12     main (package:flutter_tools/executable.dart:93:3)
           <asynchronous suspension>
@mansigupta07091998 mansigupta07091998 added the bug Something isn't working label Oct 9, 2024
@bryanoltman
Copy link
Contributor

Could you try this and let us know if it works?

@keven-cerrado
Copy link

I'm having the same problem here, since I updated shorebird

@eseidel eseidel added this to 1.1 Oct 10, 2024
@eseidel eseidel moved this to Customers in 1.1 Oct 10, 2024
@NiltoPires
Copy link

I'm trying to use Shorebird for the first time in my Flutter project, but I'm running into build errors. I followed the setup instructions, but the build keeps failing.

@eseidel
Copy link
Contributor

eseidel commented Oct 11, 2024

I'm trying to use Shorebird for the first time in my Flutter project, but I'm running into build errors. I followed the setup instructions, but the build keeps failing.

Are you able to share the failure log? We're also reachable on discord: https://discord.gg/shorebird and happy to debug with you.

The most common cause of failure is that the app expects a different version of Flutter than Shorebird is using. Shorebird always uses the latest to build by default unless --flutter-version is specified: https://docs.shorebird.dev/flutter-version/

@mansigupta07091998
Copy link
Author

tried the solution you suggested but getting same error

@mansigupta07091998
Copy link
Author

I tried only the command shorebird release android, its getting stuck at

Screenshot 2024-10-14 141904

@eseidel
Copy link
Contributor

eseidel commented Oct 15, 2024

I tried only the command shorebird release android, its getting stuck at Screenshot 2024-10-14 141904

This is likely a networking issue. @felangel is looking now.

@bryanoltman
Copy link
Contributor

From Discord:

Curiously, it only happens when I generate the apk, if I remove --artifact apk it works correctly

@mansigupta07091998
Copy link
Author

mansigupta07091998 commented Oct 15, 2024

From Discord:

Curiously, it only happens when I generate the apk, if I remove --artifact apk it works correctly

Why does this giving that error when using --artifact apk then

@bryanoltman
Copy link
Contributor

@mansigupta07091998 that's something we need to figure out 😄

@mansigupta07091998
Copy link
Author

I tried only the command shorebird release android, its getting stuck at Screenshot 2024-10-14 141904

This is likely a networking issue. @felangel is looking now.

does your team is looking into why this issue is coming?

@bryanoltman
Copy link
Contributor

As @eseidel mentioned above, we are looking into it

@felangel
Copy link
Contributor

We're working on adding improved logging and reachability checks to Shorebird CLI in v1.4.1 to better diagnose this type of issue. In the meantime are you able to share the full output for re-running the release command using the --verbose flag? Thanks!

@mansigupta07091998
Copy link
Author

mansigupta07091998 commented Oct 16, 2024

Uploading 1728449243655_shorebird.log…

When using shorebird android release command
Building app bundle with Flutter.txt

@bryanoltman
Copy link
Contributor

CacheUpdateFailure: Failed to download patch: ClientException: Connection closed before full header was received, uri=https://storage.googleapis.com/dop
If you're behind a firewall/proxy, please, make sure shorebird_cli is
allowed to access https://storage.googleapis.com/download.shorebird.dev/shorebird/033ec57900456ca7f8cd4bb59c2773a8ce27cb5d/patch-windows-x64.zip.       

This seems like it could be the issue. Can you download that file?

@bryanoltman
Copy link
Contributor

Also, our latest release of the shorebird tool includes some improved diagnostics for this kind of thing. If you upgrade, you can run shorebird doctor to run some reachability tests for various endpoints that we use.

@mansigupta07091998
Copy link
Author

by upgrading to new version the command shorebird release android is working fine, but when making the patch using command shorebird patch android its getting stuck at step
image

@keven-cerrado
Copy link

I updated to the latest version but I still have the same error when creating a release
Command used: shorebird release android --flavor stable --flutter-version 3.16.9 --artifact apk
1729172106014_shorebird.log
image

@mansigupta07091998
Copy link
Author

Following are the logs when making patch build :

ClientException: Connection closed while receiving data, uri=https://storage.googleapis.com/shorebird_release_artifacts/abf09f24-d1cc-436d-ba80-a9e205
4f2b26%2Fandroid%2Farm%2F112845%2Flibapp.so?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=patch-artifacts-storage-bucket%40code-push-prod.iam.gser
viceaccount.com%2F20241017%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20241017T173518Z&X-Goog-Expires=3600&X-Goog-SignedHeaders=host&X-Goog-Signature=
743aacaeccdfcb0464a605c6871a78ce943c9ba388761185b6274a64dfa43d684f5384a9f899405cc35a648b685e02c8dacfa47aad910b4e27fa52af16d55e94a1c709f25fbabdd29bb22252
83425870a12b61936637676b787e11f927e171807fd51ed7b42becd96bb79dc9ea9113b9ede48d8388d1dd18d3e36105d2efc82729e956417b3ffa41175cafb2e20d9c4e19571e58ca2797c2
7ad54fecd9789f5d5a0da1b3b4e13e8dcc15ce9c5b5eb07ead46c8981ca0ad50164ce5cdfc430319d8cc81b9834b2e8cc6ef7e8a782b356bcd130b89635221e594d99b44905c0a23a2f84246e80be5b858549d088fbf87eb33fe45e26c24980ec66fddb743cac006 (1009.6s)
[Process.run] git symbolic-ref HEAD (in C:\Users\Imart.shorebird\bin\cache)
Exited with code 0

stdout:
refs/heads/stable

[Process.run] git rev-parse --verify HEAD (in C:\Users\Imart.shorebird\bin\cache)
Exited with code 0

stdout:
dc2770f

[Process.run] git remote prune origin (in C:\Users\Imart.shorebird\bin\cache)
Exited with code 0
[Process.run] git fetch --tags (in C:\Users\Imart.shorebird\bin\cache)
Exited with code 0
[Process.run] git rev-parse --verify @{upstream} (in C:\Users\Imart.shorebird\bin\cache)
Exited with code 0

stdout:
dc2770f

@eseidel
Copy link
Contributor

eseidel commented Oct 25, 2024

We've made a bunch of improvements to shorebird's network diagnostics this week. I would encourage anyone having trouble with builds to try again with the latest shorebird and report back.

Our understanding is that there is some sort of Windows Defender bug which was affecting Shorebird but was patched in the latest Windows update (for both Windows 10 and 11):
#2532

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Customers
Development

No branches or pull requests

6 participants