【发布时间】:2021-03-03 18:51:18
【问题描述】:
生日快乐!
我正在尝试使用 AWS 开发人员工具为 Flutter android 应用程序创建 CI/CD 管道。 但我无法使用 AWS Codebuild 编译 apk 包。你能帮帮我们吗?
设置非常简单。 enter image description here
为简单起见,我使用了 Flutter HelloWorld dart 代码
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
title: Text('Welcome to Flutter'),
),
body: Center(
child: Text('Hello World'),
),
),
);
}
}
buildspec.yml
version: 0.2
phases:
install:
runtime-versions:
android: 29
java: openjdk8
commands:
- pwd
pre_build:
commands:
- echo Pre Build started on `date`
- git clone https://github.com/flutter/flutter.git -b stable
- export PATH="$PATH:`pwd`/flutter/bin"
- flutter precache
- flutter doctor
build:
commands:
- echo Build started on `date`
- flutter build apk
- ls -al
post_build:
commands:
- echo Build completed on `date`
artifacts:
files:
- "**/*"
CodeBuild 过程成功,但每次运行后它都会创建新的随机名称输出工件,但不会创建 .apk 文件。
我尝试了几种组合,但最终都出现了错误。
artifacts:
files:
- "**/app-release.apk"
与
artifacts:
type: apk
files:
- "**/*"
【问题讨论】:
标签: android flutter aws-codebuild