shorebirdtech / shorebird

Code Push for Flutter and other tools for Flutter businesses.
https://shorebird.dev
Other
2.27k stars 135 forks source link

Build is not made when using shorebird command for making apk #2518

Open mansigupta07091998 opened 1 week ago

mansigupta07091998 commented 1 week ago

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>
bryanoltman commented 1 week ago

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

keven-cerrado commented 1 week ago

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

NiltoPires commented 1 week ago

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 commented 1 week ago

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 commented 6 days ago

tried the solution you suggested but getting same error

mansigupta07091998 commented 5 days ago

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

Screenshot 2024-10-14 141904

](url)

eseidel commented 4 days ago

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 commented 4 days ago

From Discord:

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

mansigupta07091998 commented 4 days ago

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 commented 4 days ago

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

mansigupta07091998 commented 4 days ago

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 commented 4 days ago

As @eseidel mentioned above, we are looking into it

felangel commented 4 days ago

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 commented 3 days ago

[Uploading 1728449243655_shorebird.log…]()

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

bryanoltman commented 3 days ago
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 commented 3 days ago

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 commented 3 days ago

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 commented 2 days ago

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 commented 2 days ago

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: dc2770f4d869cd57347a7336c91aab47e5247d73

[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: dc2770f4d869cd57347a7336c91aab47e5247d73