Android 颤振构建返回”;未能找到版本28.0.3“的生成工具;
我是一名新手,我正在使用Android Studio创建应用程序,因此我创建了一个BMI计算器用于训练,当我尝试构建apk时,它向我展示了以下内容:Android 颤振构建返回”;未能找到版本28.0.3“的生成工具;,android,flutter,gradle,Android,Flutter,Gradle,我是一名新手,我正在使用Android Studio创建应用程序,因此我创建了一个BMI计算器用于训练,当我尝试构建apk时,它向我展示了以下内容: C:\Users\welcome\AndroidStudioProjects\bmicalculator>flutter build apk Running "flutter pub get" in bmicalculator... 1.6s You are building a
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
我的主.dart文件
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),
),
),
)
],
),
)
],
),
),
);
}
}
导入“包装:颤振/材料.省道”;
void main()=>runApp(
材料聚丙烯(
主题:主题数据(
primaryColor:Color(0xFF4d88ff)
),
主页:MyApp(),
debugShowCheckedModeBanner:false,
)
);
类MyApp扩展了StatefulWidget{
@凌驾
_MyAppState createState()=>\u MyAppState();
}
类MyAppState扩展了状态{
双倍高度=170.0;
双倍重量=300;
int _bmi=0;
字符串_条件='选择数据';
@凌驾
小部件构建(构建上下文){
Size Size=MediaQuery.of(context).Size;
返回脚手架(
正文:SingleChildScrollView(
子:列(
儿童:[
容器(高度:尺寸。高度*0.40,
宽度:double.infinity,
装饰:新盒子装饰(颜色:颜色(0xFF4d88ff)),
填充:边缘组。对称(垂直:30.0,水平:10.0),
子:列(
crossAxisAlignment:crossAxisAlignment.start,
儿童:[
文本(“BMI”,样式:TextStyle(颜色:Colors.pinkAccent,fontwweight:fontwweight.bold,fontSize:60.0),
文本(“计算器(测试版)”,样式:TextStyle(颜色:Colors.pink,fontSize:40.0),
大小盒子(
宽度:double.infinity,
子:容器(
子项:文本(“$\u bmi”,
样式:TextStyle(
颜色:颜色,红色,
fontWeight:fontWeight.bold,
字体大小:45.0
),textAlign:textAlign.right,),
),
),
RichText(
text:TextSpan(
正文:“条件:”,
样式:TextStyle(
颜色:颜色。粉红色,
字体大小:25.0
),
儿童:[
TextSpan(
正文:“$\u条件”,
样式:TextStyle(
颜色:颜色。粉红色,
字体大小:25.0,
fontWeight:fontWeight.bold,
),)
]
),
)
],
),
),
容器(
填充:边缘组。对称(水平:10.0,垂直:10.0),
宽度:double.infinity,
子:列(
儿童:[
大小框(高度:大小。高度*0.03,),
文本(“输入数据”,样式:TextStyle(颜色:Colors.pink,fontSize:30.0,fontWeight:fontWeight.bold,),),
大小框(高度:大小。高度*0.03,),
RichText(
text:TextSpan(
正文:“高度:”,
样式:TextStyle(
颜色:颜色(0xFF403f3d),
字体大小:25.0
),
儿童:[
TextSpan(
文字:“$\u高度cm”,
样式:TextStyle(
颜色:颜色(0xFF403f3d),
字体大小:25.0,
fontWeight:fontWeight.bold,
),)
]
),
),
大小框(高度:大小。高度*0.03,),
滑块(
值:_高度,
分:0,,
最高:250,
一旦更改:(高度){
设置状态(){
_高度=高度;
});
},
分区:250,
标签:“$\u高度”,
activeColor:Colors.pink,
不活动颜色:颜色。灰色,
),
大小框(高度:大小。高度*0.03,),
RichText(
text:TextSpan(
正文:“重量:”,
样式:TextStyle(
颜色:颜色(0xFF403f3d),
字体大小:25.0
),
儿童:[
TextSpan(
正文:“$\单位重量千克”,
样式:TextStyle(
颜色:颜色(0xFF403f3d),
字体大小:25.0,
fontWeight:fontWeight.bold,
),)
]
),
),
大小框(高度:大小。高度*0.03,),
滑块(
值:_重量,
分:0,,
最高:300,
一旦改变:(_重量){
设置状态(){
_重量=_重量;
});
},
分区:300,
标签:“$\u重量”,
activeColor:Colors.pink,
不活动颜色:颜色。灰色,
),
大小框(高度:大小。高度*0.03,),
容器(
宽度:尺寸。宽度*0.8,
孩子:ClipRRect(
边界半径:边界半径。圆形(30.0),
孩子:扁平按钮(
已按下:(){
设置状态(){