当前位置: 首页 > 知识库问答 >
问题:

颤振构建返回“未能找到构建工具修订版28.0.3”[重复]

奚卓
2023-03-14

我是一名新手,我正在使用Android Studio创建应用程序,因此我创建了一个BMI计算器用于训练,当我尝试构建apk时,它向我展示了以下内容:

C:\Users\welcome\AndroidStudioProjects\bmicalculator>flutter build apk
Running "flutter pub get" in bmicalculator...                       1.6s
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileReleaseKotlin'.
> Failed to find Build Tools revision 28.0.3

* 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

我的主菜。省道锉

import 'package:flutter/material.dart';

void main() => runApp(
    MaterialApp(
      theme: ThemeData(
          primaryColor: Color(0xFF4d88ff)
      ),
      home: MyApp(),
      debugShowCheckedModeBanner: false,
    )
);

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  double _height=170.0;
  double _weight=300;
  int _bmi=0;
  String _condition= 'Select Data';
  @override
  Widget build(BuildContext context) {
    Size size=MediaQuery.of(context).size;
    return Scaffold(
      body: SingleChildScrollView(
        child: Column(
          children: <Widget>[
            Container(height: size.height*0.40,
              width: double.infinity,
              decoration: new BoxDecoration(color: Color(0xFF4d88ff)),
              padding: EdgeInsets.symmetric(vertical: 30.0,horizontal: 10.0),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: <Widget>[
                  Text("BMI",style: TextStyle(color: Colors.pinkAccent,fontWeight: FontWeight.bold,fontSize: 60.0),),
                  Text("Calculator(BETA)",style: TextStyle(color: Colors.pink,fontSize: 40.0),),
                  SizedBox(
                    width: double.infinity,
                    child: Container(
                      child:Text("$_bmi",
                        style:TextStyle(
                            color: Colors.red,
                            fontWeight: FontWeight.bold,
                            fontSize: 45.0
                        ),textAlign: TextAlign.right,),
                    ),
                  ),
                  RichText(
                    text: TextSpan(
                        text: "Condition:",
                        style: TextStyle(
                            color: Colors.pink,
                            fontSize: 25.0
                        ),
                        children: <TextSpan>[
                          TextSpan(
                            text: "$_condition",
                            style: TextStyle(
                              color: Colors.pink,
                              fontSize: 25.0,
                              fontWeight: FontWeight.bold,
                            ),)
                        ]
                    ),

                  )
                ],
              ),
            ),
            Container(
              padding: EdgeInsets.symmetric(horizontal: 10.0,vertical: 10.0),
              width: double.infinity,
              child: Column(
                children: <Widget>[
                  SizedBox(height: size.height*0.03,),
                  Text("Enter Data",style: TextStyle(color: Colors.pink, fontSize: 30.0, fontWeight: FontWeight.bold,),),
                  SizedBox(height: size.height*0.03,),
                  RichText(
                    text: TextSpan(
                        text: "Height :",
                        style: TextStyle(
                            color: Color(0xFF403f3d),
                            fontSize: 25.0
                        ),
                        children: <TextSpan>[
                          TextSpan(
                            text: "$_height cm",
                            style: TextStyle(
                              color: Color(0xFF403f3d),
                              fontSize: 25.0,
                              fontWeight: FontWeight.bold,
                            ),)
                        ]
                    ),
                  ),
                  SizedBox(height: size.height*0.03,),
                  Slider(
                    value:  _height,
                    min: 0,
                    max: 250,
                    onChanged: (height){
                      setState(() {
                        _height=height;
                      });
                    },
                    divisions: 250,
                    label: "$_height",
                    activeColor: Colors.pink,
                    inactiveColor: Colors.grey,
                  ),
                  SizedBox(height: size.height*0.03,),
                  RichText(
                    text: TextSpan(
                        text: "Weight :",
                        style: TextStyle(
                            color: Color(0xFF403f3d),
                            fontSize: 25.0
                        ),
                        children: <TextSpan>[
                          TextSpan(
                            text: "$_weight kg",
                            style: TextStyle(
                              color: Color(0xFF403f3d),
                              fontSize: 25.0,
                              fontWeight: FontWeight.bold,
                            ),)
                        ]
                    ),
                  ),
                  SizedBox(height: size.height*0.03,),
                  Slider(
                    value:  _weight,
                    min: 0,
                    max: 300,
                    onChanged: (_weight){
                      setState(() {
                        _weight=_weight;
                      });
                    },
                    divisions: 300,
                    label: "$_weight",
                    activeColor: Colors.pink,
                    inactiveColor: Colors.grey,
                  ),
                  SizedBox(height: size.height*0.03,),
                  Container(
                    width: size.width*0.8,
                    child: ClipRRect(
                      borderRadius: BorderRadius.circular(30.0),
                      child: FlatButton(
                        onPressed: (){
                          setState(() {
                            _bmi=(_weight/((-_height/100)*(_height/100))).round().toInt();
                            if(_bmi>=18.5 && _bmi<=25) {_condition=" Normal";}
                            else if(_bmi>25 && _bmi<=30) {_condition=" Overweight";}
                            else if(_bmi>30) {_condition=" Obesity";}
                            else   {_condition=" Underweight";}
                          });
                        },
                        child: Text("Calculate",style: TextStyle(color: Colors.white,fontSize: 20.0),),
                        color:Colors.pink,
                        padding: EdgeInsets.symmetric(vertical: 15,horizontal: 40),
                      ),
                    ),
                  )
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}

共有1个答案

岳浩穰
2023-03-14

这是因为网络阻止了不安全的HTTP下载请求。我改变了我的网络,Gradle的构建也完成了。

 类似资料:
  • 出于某种原因,我不得不重新安装Android Studio。安装后,我无法生成我的项目,出现此错误 未能找到构建工具版本31.0.0 在构建中没有显示警告或错误。格雷德尔锉刀 我尝试将compiledSdkVersion、buildToolsVersion和targetSdkVersion更改为30 如你所见,如果我把版本改为30,那就是说我要更新到31。 这是我的项目结构。 我也尝试过将项目与g

  • 现在在主频道上,我切换到beta频道,然后我运行flutter升级,发现我不能使用Linux作为设备,所以我切换回主分支,我运行flutter升级。然后我开始得到这些错误: 我假设问题是Dart SDK升级了,如果我可以回滚到与依赖项兼容的版本,它应该工作,或者依赖项应该被审查。

  • 我自定义谷歌地图位置选择器并从我的github存储库中加载它,现在当我尝试构建文件时,它会在下面显示错误。 失败:生成失败,出现异常。 问题:配置根项目“google_map_location_picker”时出现问题 未找到SDK位置。使用ANDROID_SDK_ROOT环境变量或通过设置SDK来定义位置。项目本地属性文件中的dir路径,位于“/Users/johnsmith/Developer

  • 注意:使用-Xlint重新编译:详细信息请参阅弃用。D8:程序类型已存在:android。支持v4.os。ResultReceiver$MyResultReceiver 失败:构建失败,但有例外。 > 错误:任务执行失败:应用程序:transformDexArchiveWithExternalLibsDexMergerForDebug”。 通用域名格式。Android建设者德兴。DexArchiv

  • 我最近问了一个关于弗利特的问题。目前,答案给出了一个不同的错误,正如答案所说,我可能想看看这段代码。所以,我决定放弃回购协议,开始调查。我现在只想打印出这一部分中的几个值,以了解发生了什么。看看程序认为我有什么,它认为我没有什么。我添加了几个语句,现在我想重建这个项目。 我去了发现: flutter工具本身是在您第一次运行以及每次运行时构建的。如果您想更改和重新测试工具本身的行为,请在git中本地

  • 我在Cordova的构建时间内堆叠了一个错误。我已经安装了android构建工具,但ionic通过错误“找不到已安装的构建工具。安装Android构建工具版本30.0.3或更高版本”。我不明白为什么会显示此错误。下面提到的错误,请检查并帮助我。 ANDROID\u HOME=C:\Users\prade\AppData\Local\ANDROID\Sdk(已弃用)使用ANDROID Sdk:C:\