MobileDevOps / flutter-sdk-image

Docker image with Flutter SDK to build Android apps
https://hub.docker.com/r/mobiledevops/flutter-sdk-image/
MIT License
31 stars 31 forks source link

Cannot run build with DroneCI #23

Open ZantsuRocks opened 12 months ago

ZantsuRocks commented 12 months ago

When trying to run a build command in a docker-based DroneCI pipeline the "pub get" process fails when writing pubspec.lock

Expected behaviour

Build Process to complete as it succefully completes when running locally.

Actual behaviour

Build Process fails to write pubspec.lock

Steps to reproduce the behaviour

Which Docker version is used?

24.0.5

Which flutter-sdk-image version is used?

3.7.10

Which host operation system is used?

Log

+ ls -l
total 56
drwxr-xr-x  3 root root 4096 Sep  1 13:05 ConversorIRDB
-rw-r--r--  1 root root 3460 Sep  1 13:05 README.md
-rw-r--r--  1 root root 1453 Sep  1 13:05 analysis_options.yaml
drwxr-xr-x  6 root root 4096 Sep  1 13:05 android
drwxr-xr-x  9 root root 4096 Sep  1 13:05 assets
drwxr-xr-x  3 root root 4096 Sep  1 13:05 build
drwxr-xr-x  2 root root 4096 Sep  1 13:05 icon
drwxr-xr-x  6 root root 4096 Sep  1 13:05 ios
drwxr-xr-x  2 root root 4096 Sep  1 13:05 issue_template
drwxr-xr-x 12 root root 4096 Sep  1 13:05 lib
-rw-r--r--  1 root root 7569 Sep  1 13:05 pubspec.yaml
drwxr-xr-x  2 root root 4096 Sep  1 13:05 test
drwxr-xr-x  4 root root 4096 Sep  1 13:05 windows
+ flutter build apk
Running "flutter pub get" in src...
Resolving dependencies...
+ archive 3.3.7
+ args 2.0.0 (2.4.2 available)
+ async 2.10.0 (2.11.0 available)
+ auto_size_text 3.0.0-nullsafety.0 (3.0.0 available)
+ boolean_selector 2.1.1
+ characters 1.2.1 (1.3.0 available)
+ clock 1.1.1
+ collection 1.17.0 (1.18.0 available)
+ connectivity 3.0.6 (discontinued)
+ connectivity_for_web 0.4.0+1
+ connectivity_macos 0.2.1+2
+ connectivity_platform_interface 2.0.1
+ convert 3.1.1
+ crypto 3.0.2 (3.0.3 available)
+ cupertino_icons 1.0.0 (1.0.6 available)
+ dbus 0.7.3 (0.7.8 available)
+ equatable 2.0.5
+ event_bus 2.0.0
+ fake_async 1.3.1
+ ffi 1.2.1 (2.1.0 available)
+ file 6.1.4 (7.0.0 available)
+ fl_chart 0.51.0 (0.63.0 available)
+ flutter 0.0.0 from sdk flutter
+ flutter_barcode_scanner 2.0.0
+ flutter_intro 2.3.1 (3.0.3 available)
+ flutter_launcher_icons 0.9.0 (0.13.1 available)
+ flutter_local_notifications 9.4.0 (15.1.1 available)
+ flutter_local_notifications_linux 0.4.2 (4.0.0+1 available)
+ flutter_local_notifications_platform_interface 5.0.0 (7.0.0+1 available)
+ flutter_localizations 0.0.0 from sdk flutter
+ flutter_plugin_android_lifecycle 2.0.16
+ flutter_slidable 0.6.0 (3.0.0 available)
+ flutter_speed_dial 4.6.6 (7.0.0 available)
+ flutter_svg 0.22.0 (2.0.7 available)
+ flutter_test 0.0.0 from sdk flutter
+ flutter_web_plugins 0.0.0 from sdk flutter
+ google_maps_flutter 2.1.1 (2.5.0 available)
+ google_maps_flutter_platform_interface 2.4.1
+ http 0.13.3 (1.1.0 available)
+ http_parser 4.0.2
+ image 3.1.3 (4.0.17 available)
+ intl 0.17.0 (0.18.1 available)
+ js 0.6.5 (0.6.7 available)
+ jwt_decoder 2.0.1
+ loading_animations 2.2.0
+ location 4.4.1 from git https://git.agst.com.br:3000/AGST/FlutterLocation.git at 447450 in packages/location
+ location_platform_interface 2.3.0 (3.1.2 available)
+ location_web 3.1.1 (4.2.0 available)
+ logging 1.2.0
+ mailer 5.0.2 (6.0.1 available)
+ matcher 0.12.13 (0.12.16 available)
+ material_color_utilities 0.2.0 (0.8.0 available)
+ meta 1.8.0 (1.9.1 available)
+ mime 1.0.4
+ mqtt_client 9.6.2 from git https://github.com/wagner-rebello/mqtt_client.git at d5a779
+ nested 1.0.0
+ package_info 2.0.0 (discontinued)
+ path 1.8.2 (1.8.3 available)
+ path_drawing 0.5.1+1 (1.0.1 available)
+ path_parsing 0.2.1 (1.0.1 available)
+ path_provider 2.0.3 (2.1.1 available)
+ path_provider_linux 2.2.1
+ path_provider_macos 2.0.7
+ path_provider_platform_interface 2.1.1
+ path_provider_windows 2.0.7 (2.2.1 available)
+ pedantic 1.11.1
+ permission_handler 10.2.0 (10.4.3 available)
+ permission_handler_android 10.3.4
+ permission_handler_apple 9.1.4
+ permission_handler_platform_interface 3.11.3
+ permission_handler_windows 0.1.3
+ petitparser 5.1.0 (6.0.1 available)
+ platform 3.1.2
+ plugin_platform_interface 2.1.6
+ pointycastle 3.7.3
+ process 4.2.4 (5.0.0 available)
+ provider 6.0.0 (6.0.5 available)
+ pull_to_refresh 2.0.0 from git https://github.com/wagner-rebello/flutter_pulltorefresh.git at b5d2e2
+ share_plus 3.0.4 (7.1.0 available)
+ share_plus_linux 2.0.4 (3.0.1 available)
+ share_plus_macos 2.1.0 (3.0.1 available)
+ share_plus_platform_interface 2.1.0 (3.3.0 available)
+ share_plus_web 2.0.4 (3.1.0 available)
+ share_plus_windows 2.0.3 (4.0.0 available)
+ shared_preferences 2.2.1
+ shared_preferences_android 2.2.1
+ shared_preferences_foundation 2.3.4
+ shared_preferences_linux 2.3.1
+ shared_preferences_platform_interface 2.3.1
+ shared_preferences_web 2.2.1
+ shared_preferences_windows 2.3.1
+ simple_gesture_detector 0.1.6 (0.2.0 available)
+ sky_engine 0.0.99 from sdk flutter
+ source_span 1.9.1 (1.10.0 available)
+ sqflite 2.0.0+3 (2.3.0 available)
+ sqflite_common 2.4.5+1 (2.5.0 available)
+ stack_trace 1.11.0 (1.11.1 available)
+ step_progress_indicator 1.0.0 (1.0.2 available)
+ stream_channel 2.1.1 (2.1.2 available)
+ stream_transform 2.1.0
+ string_scanner 1.2.0
+ syncfusion_flutter_core 20.4.54 (22.2.11 available)
+ syncfusion_flutter_gauges 20.1.58 (22.2.11 available)
+ syncfusion_flutter_xlsio 20.1.58-beta (22.2.11 available)
+ syncfusion_officecore 20.4.54-beta (22.2.11 available)
+ synchronized 3.1.0
+ table_calendar 2.3.3 (3.0.9 available)
+ term_glyph 1.2.1
+ test_api 0.4.16 (0.6.1 available)
+ theme_provider 0.5.0 (0.6.0 available)
+ timezone 0.8.0 (0.9.2 available)
+ typed_data 1.3.2
+ uni_links 0.4.0 (0.5.1 available)
+ url_launcher 6.1.2 (6.1.14 available)
+ url_launcher_android 6.1.0
+ url_launcher_ios 6.1.5
+ url_launcher_linux 3.0.6
+ url_launcher_macos 3.0.7
+ url_launcher_platform_interface 2.1.5
+ url_launcher_web 2.0.19 (2.0.20 available)
+ url_launcher_windows 3.0.8
+ uuid 3.0.4 (4.0.0 available)
+ validate 1.7.0
+ vector_math 2.1.4
+ version 2.0.0 (3.0.2 available)
+ wakelock 0.6.1+2 (0.6.2 available)
+ wakelock_macos 0.4.0
+ wakelock_platform_interface 0.3.0
+ wakelock_web 0.4.0
+ wakelock_windows 0.2.0 (0.2.1 available)
+ wifi_iot 0.3.8 (0.3.18 available)
+ win32 2.6.1 (5.0.7 available)
+ xdg_directories 0.2.0+3 (1.0.3 available)
+ xml 5.4.1 (6.4.2 available)
+ yaml 3.1.2
Changed 135 dependencies!
Cannot open file, path = 'pubspec.lock' (OS Error: Permission denied, errno = 13)
pub get failed
command: "/home/mobiledevops/.flutter-sdk/bin/cache/dart-sdk/bin/dart __deprecated_pub --directory . get --example"
pub env: {
  "FLUTTER_ROOT": "/home/mobiledevops/.flutter-sdk",
  "PUB_ENVIRONMENT": "flutter_bot:flutter_cli:verify:apk",
  "PUB_CACHE": "/home/mobiledevops/.pub-cache",
}
exit code: 66
ZantsuRocks commented 12 months ago

Default directory when using DroneCI is "/src" this is causing the Permission error, copying the content to "/home/mobiledevops/app" throw error in ALL imports:

lib/main.dart:5:8: Error: Error when reading 'lib/models/AppInfo.dart': No such file or directory
import 'package:Brise/models/AppInfo.dart';
       ^

Commands are the following:

      - cp -R * /home/mobiledevops/app
      - cd /home/mobiledevops/app
      - flutter pub get
      - flutter clean
      - ls -l
      - flutter build apk
      - flutter build appbundle