DroidsOnRoids / bitrise-step-flutter

Bitrise step for Flutter
MIT License
18 stars 6 forks source link

Flutter packages ge failing on build but working on laptop on clean directory #6

Closed AlexandreRoba closed 6 years ago

AlexandreRoba commented 6 years ago

Hi,

this use to work properly untill I have replaced in the pubspec a specfic version of a package. This is the dependencies section of my pubspec:

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  fluro: ^1.3.1
  flutter_map: ^0.0.6
  latlong: ^0.4.5
  rxdart: ^0.18.1
  date_format: ^1.0.4
  firebase_core: ^0.2.4
    #firebase_auth: ^0.5.12
  firebase_auth:
    git:
      url: git@github.com:flutter/plugins.git
      path: packages/firebase_auth
      ref: 075897e
  location: ^1.3.3

I can flutter packages get on my laptop but on the build server I'm getting the following error:

Running "flutter packages get" in mobilet_app...
Could not find a file named "packages/firebase_auth/pubspec.yaml" in git@github.com:flutter/plugins.git 075897eaec21dffd238ddfaa544ae7b773fc3b29.

I have the same version of flutter installed on both the laptop and the server:

this is what I have on the server:

Config:
- Version: 0.5.6-dev
- WorkingDir: /Users/vagrant/git/sweetnest_app
- Commands: [build ios -t lib/main_impl.dart]
ANDROID_HOME environment variable not defined, skipping Android SDK setup.
Extracting Flutter SDK to /Users/vagrant/Library/flutter
Executing Flutter command: build ios -t lib/main_impl.dart
  ╔════════════════════════════════════════════════════════════════════════════╗
  ║                 Welcome to Flutter! - https://flutter.io                   ║
  ║                                                                            ║
  ║ The Flutter tool anonymously reports feature usage statistics and crash    ║
  ║ reports to Google in order to help Google contribute improvements to       ║
  ║ Flutter over time.                                                         ║
  ║                                                                            ║
  ║ Read about data we send with crash reports:                                ║
  ║ https://github.com/flutter/flutter/wiki/Flutter-CLI-crash-reporting        ║
  ║                                                                            ║
  ║ See Google's privacy policy:                                               ║
  ║ https://www.google.com/intl/en/policies/privacy/                           ║
  ║                                                                            ║
  ║ Use "flutter config --no-analytics" to disable analytics and crash         ║
  ║ reporting.                                                                 ║
  ╚════════════════════════════════════════════════════════════════════════════╝

Running "flutter packages get" in sweetnest_app...
Could not find a file named "packages/firebase_auth/pubspec.yaml" in git@github.com:flutter/plugins.git 075897eaec21dffd238ddfaa544ae7b773fc3b29.
---- Log transcript ----
FINE: Pub 2.0.0-dev.63.0.flutter-4c9689c1d2
MSG : Resolving dependencies...
SLVR: fact: sweetnest_app is 0.0.0
SLVR: derived: sweetnest_app
SLVR: fact: sweetnest_app depends on date_format ^1.0.4
SLVR: fact: sweetnest_app depends on fluro ^1.3.1
SLVR: fact: sweetnest_app depends on location ^1.3.3
SLVR: fact: sweetnest_app depends on flutter_localizations any from sdk
SLVR: fact: sweetnest_app depends on flutter any from sdk
SLVR: fact: sweetnest_app depends on firebase_core ^0.2.4
SLVR: fact: sweetnest_app depends on firebase_auth from git
SLVR: fact: sweetnest_app depends on cupertino_icons ^0.1.2
SLVR: fact: sweetnest_app depends on rxdart ^0.18.1
SLVR: fact: sweetnest_app depends on latlong ^0.4.5
SLVR: fact: sweetnest_app depends on flutter_map ^0.0.6
SLVR: fact: sweetnest_app depends on flutter_test any from sdk
SLVR: fact: sweetnest_app depends on flutter_launcher_icons ^0.3.2

And on my laptop:

➜ sweetnest/sweetnest_app ➤ ba5edf5|develop ✓
± flutter doctor                                                                                                                                           [8h]
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v0.5.7-pre.122, on Mac OS X 10.13.5 17F77, locale en-BE)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
[✓] Android Studio (version 3.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.6)
[✓] VS Code (version 1.25.0)
[✓] Connected devices (1 available)

• No issues found!
➜ sweetnest/sweetnest_app ➤ ba5edf5|develop ✓
± flutter packages get                                                                                                                                   ⏎ [9h]
Running "flutter packages get" in sweetnest_app...           0.9s
➜ sweetnest/sweetnest_app ➤ ba5edf5|develop ✓

Any help appreciated :)

koral-- commented 6 years ago

At the time of writing that commit is unavailable. I'm getting the following error:

Running "flutter packages get" in flutter_app...                 
Git error. Command: git rev-list --max-count=1 075897e
fatal: ambiguous argument '075897e': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
pub get failed (69) -- attempting retry 1 in 1 second...

It seems that commit 075897eaec21dffd238ddfaa544ae7b773fc3b29 has been squashed.

According to this comment: https://github.com/flutter/flutter/issues/10404#issuecomment-402201946 and PR linked there, that change has been merged. So you can use version 0.5.13 or newer.

Regarding difference between local and bitrise builds it seems that you had that file in cache while on bitrise environment was clean. Cache paths are listed in .flutter-plugins file which is gitignored. By default cache is located in $FLUTTER_ROOT/.pub-cache. If there was no cache directory results would be probably the same locally.

Anyway it does not look like an issue with step so I'm closing this ticket.