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

android build fail without upgrade #366

Closed
lisovyk opened this issue May 20, 2024 · 6 comments
Closed

android build fail without upgrade #366

lisovyk opened this issue May 20, 2024 · 6 comments

Comments

@lisovyk
Copy link

lisovyk commented May 20, 2024

Hello! I started having an error with my android app, without any updates to pubspec.yaml and packages. Yesterday it was building fine and the app built successfully, today with minor changes to widgets it fails with super_native_extensions related error.

Here is a build log:

Run flutter build appbundle
  flutter build appbundle
  shell: /usr/bin/bash -e ***0***
  env:
    RELEASE_STORE_FILE: ***
    RELEASE_STORE_PASSWORD: ***
    RELEASE_KEY_ALIAS: ***
    RELEASE_KEY_PASSWORD: ***
    JAVA_HOME: ..
    JAVA_HOME_12_X64: ..
    VERSION_NAME: 4.8.8
    VERSION_CODE: ..
    FLUTTER_ROOT: /opt/hostedtoolcache/flutter/stable-3.22.0-x64
    PUB_CACHE: /home/runner/.pub-cache

Running Gradle task 'bundleRelease'...                          
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply

You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply

Checking the license for package Android Emulator in /usr/local/lib/android/sdk/licenses
License for package Android Emulator accepted.
Preparing "Install Android Emulator (revision: 34.2.13)".
"Install Android Emulator (revision: 34.2.13)" ready.
Installing Android Emulator in /usr/local/lib/android/sdk/emulator
"Install Android Emulator (revision: 34.2.13)" complete.
"Install Android Emulator (revision: 34.2.13)" finished.
...
Note: Recompile with -Xlint:deprecation for details.
Resolving dependencies...
Downloading packages...
+ adaptive_number 1.0.0
+ args 2.4.2 (2.5.0 available)
+ async 2.11.0
+ build_tool 1.0.0 from path /home/runner/.pub-cache/hosted/pub.dev/irondash_engine_context-0.5.3/cargokit/build_tool
+ collection 1.18.0
+ convert 3.1.1
+ crypto 3.0.3
+ ed25519_edwards 0.3.1
+ fixnum 1.1.0
+ github 9.17.0 (9.24.0 available)
+ hex 0.2.0
+ http 1.1.0 (1.2.1 available)
+ http_parser 4.0.2
+ json_annotation 4.9.0
+ logging 1.2.0
+ meta 1.15.0
+ path 1.8.0 (1.9.0 available)
+ petitparser 5.4.0 (6.0.2 available)
+ source_span 1.10.0
+ string_scanner 1.2.0
+ term_glyph 1.2.1
+ toml 0.14.0 (0.15.0 available)
+ typed_data 1.3.2
+ version 3.0.0 (3.0.2 available)
+ yaml 3.1.2
Changed 25 dependencies!
7 packages have newer versions incompatible with dependency constraints.
Try `dart pub outdated` for more information.
Compiling bin/build_tool_runner.dart to kernel file bin/build_tool_runner.dill.
INFO: Precompiled binaries are disabled
INFO: Installing Rust target: armv7-linux-androideabi
INFO: Building irondash_engine_context_native for armv7-linux-androideabi
INFO: Installing NDK 23.1.7779620
INFO: Installing Rust target: aarch64-linux-android
INFO: Building irondash_engine_context_native for aarch64-linux-android
INFO: Installing Rust target: x86_64-linux-android
INFO: Building irondash_engine_context_native for x86_64-linux-android
Resolving dependencies...
Downloading packages...
+ adaptive_number 1.0.0
+ args 2.4.2 (2.5.0 available)
+ async 2.0
+ build_tool 1.0.0 from path /home/runner/.pub-cache/hosted/pub.dev/super_native_extensions-0.8.5/cargokit/build_tool
+ collection 1.18.0
+ convert 3.1.1
+ crypto 3.0.3
+ ed25519_edwards 0.3.1
+ fixnum 1.1.0
+ github 9.17.0 (9.24.0 available)
+ hex 0.2.0
+ http 1.1.0 (1.2.1 available)
+ http_parser 4.0.2
+ json_annotation 4.9.0
+ logging 1.2.0
+ meta 1.15.0
+ path 1.8.0 (1.9.0 available)
+ petitparser 5.4.0 (6.0.2 available)
+ source_span 1.10.0
+ string_scanner 1.2.0
+ term_glyph 1.2.1
+ toml 0.14.0 (0.15.0 available)
+ typed_data 1.3.2
+ version 3.0.0 (3.0.2 available)
+ yaml 3.1.2
Changed 25 dependencies!
7 packages have newer versions incompatible with dependency constraints.
Try `dart pub outdated` for more information.
Compiling bin/build_tool_runner.dart to kernel file bin/build_tool_runner.dill.
INFO: Precompiled binaries are disabled
INFO: Installing Rust toolchain: nightly
INFO: Installing Rust target: armv7-linux-androideabi
INFO: Building super_native_extensions for armv7-linux-androideabi
SEVERE: ================================================================================
SEVERE: Cargokit BuildTool failed with error:
SEVERE: --------------------------------------------------------------------------------
SEVERE: External Command: rustup "run" "nightly" "cargo" "build" "-Z" "build-std=panic_abort,std" "--manifest-path" "/home/runner/.pub-cache/hosted/pub.dev/super_native_extensions-0.8.5/rust/Cargo.toml" "-p" "super_native_extensions" "--release" "--target" "armv7-linux-androideabi" "--target-dir" "/home/runner/work/app/my-app/build/super_native_extensions/build"
SEVERE: Returned Exit Code: 101
SEVERE: --------------------------------------------------------------------------------
SEVERE: STDOUT:
SEVERE: --------------------------------------------------------------------------------
SEVERE: STDERR:
SEVERE: Updating git repository `https://github.com/knopp/mime_guess.git`
SEVERE:     Updating crates.io index
SEVERE:  Downloading crates ...
SEVERE:   Downloaded atk-sys v0.17.0
SEVERE:   Downloaded time-core v0.1.1
SEVERE:   Downloaded url v2.4.0
....
SEVERE:    Compiling unicode-bidi v0.3.13
SEVERE:    Compiling super_native_extensions v0.1.0 (/home/runner/.pub-cache/hosted/pub.dev/super_native_extensions-0.8.5/rust)
SEVERE:    Compiling time v0.3.25
SEVERE:    Compiling idna v0.4.0
SEVERE: error[E0282]: type annotations needed for `Box<_>`
SEVERE:   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.25/src/format_description/parse/mod.rs:83:9
SEVERE:    |
SEVERE: 83 |     let items = format_items
SEVERE:    |         ^^^^^
SEVERE: ...
SEVERE: 86 |     Ok(items.into())
SEVERE:    |              ---- type must be known at this point
SEVERE:    |
SEVERE: help: consider giving `items` an explicit type, where the placeholders `_` are specified
SEVERE:    |
SEVERE: 83 |     let items: Box<_> = format_items
SEVERE:    |              ++++++++
SEVERE: 
SEVERE: For more information about this error, try `rustc --explain E0282`.
SEVERE: error: could not compile `time` (lib) due to 1 previous error
SEVERE: warning: build failed, waiting for other jobs to finish...
SEVERE: --------------------------------------------------------------------------------
SEVERE: #0      runCommand (package:build_tool/src/util.dart:1[18](https://../actions/runs/9162829783/job/25192034653#step:9:19):5)
SEVERE: #1      RustBuilder.build (package:build_tool/src/builder.dart:139:5)
SEVERE: <asynchronous suspension>
SEVERE: #2      ArtifactProvider.getArtifacts (package:build_tool/src/artifacts_provider.dart:68:25)
SEVERE: <asynchronous suspension>
SEVERE: #3      BuildGradle.build (package:build_tool/src/build_gradle.dart:32:23)
SEVERE: <asynchronous suspension>
SEVERE: #4      BuildGradleCommand.runBuildCommand (package:build_tool/src/build_tool.dart:62:5)
SEVERE: <asynchronous suspension>
SEVERE: #5      BuildCommand.run (package:build_tool/src/build_tool.dart:34:5)
SEVERE: <asynchronous suspension>
SEVERE: #6      CommandRunner.runCommand (package:args/command_runner.dart:[21](https://../actions/runs/9162829783/job/25192034653#step:9:22)2:13)
SEVERE: <asynchronous suspension>
SEVERE: #7      runMain (package:build_tool/src/build_tool.dart:248:5)
SEVERE: <asynchronous suspension>
SEVERE: --------------------------------------------------------------------------------
SEVERE: BuildTool arguments: [build-gradle]
SEVERE: ================================================================================

FAILURE: Build failed with an exception.

* Where:
Script '/home/runner/.pub-cache/hosted/pub.dev/super_native_extensions-0.8.5/cargokit/gradle/plugin.gradle' line: 59

* What went wrong:
Execution failed for task ':super_native_extensions:cargokitCargoBuildSuper_native_extensionsRelease'.
> Process 'command '/home/runner/.pub-cache/hosted/pub.dev/super_native_extensions-0.8.5/cargokit/gradle/../run_build_tool.sh'' finished with non-zero exit value 1

* Try:
> 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.

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

BUILD FAILED in 5m 37s
Running Gradle task 'bundleRelease'...                            [33](https://../actions/runs/9162829783/job/25192034653#step:9:34)7.7s
Gradle task bundleRelease failed with exit code 1
Error: Process completed with exit code 1.

Please, advise. Build is ran on github actions' ubuntu instance, yaml files and package versions are identical.

@knopp
Copy link
Collaborator

knopp commented May 20, 2024

This is fixed in 0.8.15. You're still on 0.8.5. I'd recommend to update.

@knopp
Copy link
Collaborator

knopp commented May 20, 2024

If this is on CI this likely happened because of Rust update.

@lisovyk
Copy link
Author

lisovyk commented May 20, 2024

You're right!, this is on CI part, thank you. Just checked and local build works fine

@lisovyk
Copy link
Author

lisovyk commented May 20, 2024

Do you know if I can revert the rust version? I see that it's used internally by build_tool_runner.dart, I have no idea if I can change it by myself

@knopp
Copy link
Collaborator

knopp commented May 20, 2024

Depends on your CI but I'd not recommend doing that. You can upgrade the package to 0.8.15 which fixes the build issue.

@lisovyk
Copy link
Author

lisovyk commented May 21, 2024

Gotcha. As the package is a sub-dep of flutter_quill and for other reasons I am sticking with flutter_quill: 9.2.3 for now – I added an override:

dependency_overrides:
  super_native_extensions: ^0.8.15

Updated other dependencies and JDK to version 17. Now the CI build works successfully. Thank you @knopp !

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

No branches or pull requests

2 participants