Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
508 views
in Technique[技术] by (71.8m points)

installation - Flutter Install Gradle Issues

I'm trying to get a basic hello world project running using flutter. These are the steps that I have taken to install Flutter on a windows machine, running Window 10 Pro.

  1. Downloaded flutter_windows_v0.9.4-beta.zip and extracted to c:src

  2. Add location to environment settings ... C:srcflutter

  3. Downloaded and installed Android Studio and Setup an emulator using ADV Manager.

  4. Downloaded and installed Visual Studio Code

  5. Added Dart 2.19.0 Extension

  6. Added Flutter 2.19.0 Extension

  7. Run Flutter doctor

    [flutter] flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel beta, v0.9.4, on Microsoft Windows [Version 10.0.15063], locale en-GB)
    [√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    [√] Android Studio (version 3.2)
        X Flutter plugin not installed; this adds Flutter specific functionality.
        X Dart plugin not installed; this adds Dart specific functionality.
    [√] VS Code (version 1.28.2)
    [√] Connected devices (1 available)
  1. Create a new flutter project

  2. Deleted code under Test folder

  3. Replaced code in main.dart with ...

    import 'package:flutter/material.dart';
    
    void main() {
      runApp(Center(
        child: Text(
          "this is a test",
          textDirection: TextDirection.ltr,
        ),
      ));
    }
  1. Ran project and get the following error ...
    Launching libmain.dart on Android SDK built for x86 in debug mode...
    * Error running Gradle:
    Exit code 1 from: C:Userso0589Desktopflutter projectsasadandroidgradlew.bat app:properties:
    Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
    
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file 'C:Userso0589Desktopflutter projectsasadandroidappuild.gradle' line: 25
    
    * What went wrong:
    A problem occurred evaluating project ':app'.
    > Could not resolve all files for configuration 'classpath'.
       > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
         Searched in the following locations:
             https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar
    
    * 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 1s
    Please review your Gradle project setup in the android/ folder.
    Exited (sigterm)

Can anyone tell me where I went wrong please Any assistance greatly appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

That's not a problem in your install. This is a problem that many people are facing with current flutter version.

It's already fixed. However, it's not yet released to the most stable version.

If you change the flutter channel to master, you'll see that it will run normally.

You can use the master channel for now and then switch it back to dev.

flutter channel master
flutter upgrade

# to see all the channels, run
flutter channel

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...