简体   繁体   中英

how to configure the dart sdk version in flutter in github actions

Now I am configure the flutter project like this in github actions:

jobs:
  build:
    runs-on: macos-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-java@v1
      with:
        java-version: '12.x'
    - uses: subosito/flutter-action@v1
      with:
        flutter-version: '1.22.5'
    - name: Select Xcode version
      run: sudo xcode-select -s '/Applications/Xcode_12.1.app/Contents/Developer'
    - name: Bundle install
      run: cd ./ios && bundle install && bundle update fastlane
    - name: Install tools
      run: |
       flutter pub get
       cd ./ios && pod install

but it shows like this:

ERR : The current Dart SDK version is 2.10.4.
    | 
    | Because Cruise depends on intl >=0.17.0-nullsafety which requires SDK version >=2.11.0-180.0.dev <3.0.0, version solving failed.
FINE: Exception type: SolveFailure
FINE: package:pub/src/solver/version_solver.dart 312:5   VersionSolver._resolveConflict
    | package:pub/src/solver/version_solver.dart 133:27  VersionSolver._propagate
    | package:pub/src/solver/version_solver.dart 97:11   VersionSolver.solve.<fn>

I know the dart version when compile in github actions is too low, what should I do to specify dart version? when i using the intl lower version of package:

  intl: 0.16.1

show error like this when compile project:

"zh_HK": 42 untranslated message(s).
"zh_TW": 42 untranslated message(s).
"zu": 42 untranslated message(s).
To see a detailed report, use the untranslated-messages-file 
option in the l10n.yaml file:
untranslated-messages-file: desiredFileName.txt
<other option>: <other selection> 


This will generate a JSON format file containing all messages that 
need to be translated.
Running "flutter pub get" in cruise-open...
Because Cruise depends on flutter_localizations any from sdk which depends on intl 0.17.0-nullsafety.2, intl 0.17.0-nullsafety.2 is required.
So, because Cruise depends on intl 0.16.1, version solving failed.
pub get failed (1; So, because Cruise depends on intl 0.16.1, version solving failed.)

what should I do to solve this conflict problem?

The problem is that, flutter 1.22.5 does come with dart 2.10.4. For example, I install this version on my own computer, and I do see the dart packaged with it is 2.10.4.

Therefore, you need to change your dependency on the Cruise , maybe to an older version.

Or, you may need to use the beta channel of Flutter:

      - uses: subosito/flutter-action@v1
        with:
          flutter-version: '1.20.5'
          channel: 'beta'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM