Skip to content

Commit 263497b

Browse files
committed
update 3.32
1 parent 26640f4 commit 263497b

File tree

11 files changed

+165
-34
lines changed

11 files changed

+165
-34
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
java-version: 21
2626
- uses: subosito/flutter-action@v1
2727
with:
28-
flutter-version: '3.29.2'
28+
flutter-version: '3.32.0'
2929
- uses: finnp/create-file-action@master
3030
env:
3131
FILE_NAME: lib/common/config/ignoreConfig.dart
@@ -47,7 +47,7 @@ jobs:
4747
java-version: 21
4848
- uses: subosito/flutter-action@v1
4949
with:
50-
flutter-version: '3.29.2'
50+
flutter-version: '3.32.0'
5151
- uses: finnp/create-file-action@master
5252
env:
5353
FILE_NAME: lib/common/config/ignoreConfig.dart

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676

7777
## 编译运行流程
7878

79-
1、配置好Flutter开发环境(目前Flutter SDK 版本 **3.29**),可参阅 [【搭建环境】](https://flutterchina.club)
79+
1、配置好Flutter开发环境(目前Flutter SDK 版本 **3.32**),可参阅 [【搭建环境】](https://flutterchina.club)
8080

8181
2、clone代码,执行`Packages get`安装第三方包。(因为某些不可抗力原因,国内可能需要设置代理: [代理环境变量](https://flutterchina.club/setup-windows/))
8282

@@ -100,7 +100,7 @@
100100

101101
### 5、运行之前请注意下
102102

103-
>### 1、本地 Flutter SDK 版本 3.29 ; 2、是否执行过 `flutter pub get`;3、 网络等问题参考: [如果出现登陆失败或者请求失败 ](https://github.com/CarGuo/gsy_github_app_flutter/issues/643)
103+
>### 1、本地 Flutter SDK 版本 3.32 ; 2、是否执行过 `flutter pub get`;3、 网络等问题参考: [如果出现登陆失败或者请求失败 ](https://github.com/CarGuo/gsy_github_app_flutter/issues/643)
104104
105105

106106
### 下载
@@ -144,7 +144,7 @@
144144

145145
### 框架
146146

147-
>当前 Flutter SDK 版本 3.29
147+
>当前 Flutter SDK 版本 3.32
148148
149149
```
150150
用户交互 → UI层(Widget/Page) → 状态层(Redux/Provider/Riverpod) → 服务层(Repositories)

README_EN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
## Compilation and Running Process
7676

77-
1. Set up the Flutter development environment (current Flutter SDK version **3.29**), see [Setting up the environment](https://flutterchina.club).
77+
1. Set up the Flutter development environment (current Flutter SDK version **3.32**), see [Setting up the environment](https://flutterchina.club).
7878

7979
2. Clone the code, run `Packages get` to install third-party packages. (Due to certain reasons beyond control, you may need to set up a proxy in China: [Proxy environment variables](https://flutterchina.club/setup-windows/))
8080

@@ -98,7 +98,7 @@
9898

9999
### 5. Please note before running
100100

101-
>### 1. Local Flutter SDK version 3.29; 2. Have you executed `flutter pub get`; 3. For network and other issues, refer to: [If login fails or requests fail](https://github.com/CarGuo/gsy_github_app_flutter/issues/643)
101+
>### 1. Local Flutter SDK version 3.32; 2. Have you executed `flutter pub get`; 3. For network and other issues, refer to: [If login fails or requests fail](https://github.com/CarGuo/gsy_github_app_flutter/issues/643)
102102
103103

104104
### Download
@@ -142,7 +142,7 @@
142142

143143
### Framework
144144

145-
>Current Flutter SDK version 3.29
145+
>Current Flutter SDK version 3.32
146146
147147
```
148148
User Interaction → UI Layer(Widget/Page) → State Layer(Redux/Provider/Riverpod/Signals) → Service Layer(Repositories)

android/app/build.gradle

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,117 @@ flutter {
9898
}
9999

100100
dependencies {}
101+
102+
103+
// 在你的模块级别 build.gradle 文件中添加此任务
104+
// 例如: app/build.gradle
105+
106+
task findSoFileOrigins {
107+
description = "扫描项目依赖的 AAR 文件,找出 .so 文件的来源。"
108+
group = "reporting" // 将任务归类到 "reporting" 组下
109+
110+
doLast {
111+
// 用于存储 AAR 标识符及其包含的 .so 文件路径
112+
// 键 (Key): AAR 的字符串标识符 (例如:"project :gsyVideoPlayer", "com.example.library:core:1.0.0")
113+
// 值 (Value): 一个 Set 集合,包含该 AAR 内所有 .so 文件的路径 (字符串)
114+
def aarSoFilesMap = [:]
115+
116+
def variants = null
117+
if (project.plugins.hasPlugin('com.android.application')) {
118+
variants = project.android.applicationVariants
119+
} else if (project.plugins.hasPlugin('com.android.library')) {
120+
variants = project.android.libraryVariants
121+
} else {
122+
project.logger.warn("警告: findSoFileOrigins 任务需要 Android 应用插件 (com.android.application) 或库插件 (com.android.library)。")
123+
return
124+
}
125+
126+
if (variants == null || variants.isEmpty()) {
127+
project.logger.warn("警告: 未找到任何变体 (variants) 来处理。")
128+
return
129+
}
130+
131+
variants.all { variant ->
132+
project.logger.lifecycle("正在扫描变体 '${variant.name}' 中的 AAR 依赖以查找 .so 文件...")
133+
134+
// 获取该变体的运行时配置 (runtime configuration)
135+
def configuration = variant.getRuntimeConfiguration()
136+
137+
try {
138+
// 配置一个构件视图 (artifact view) 来精确请求 AAR 类型的构件
139+
def resolvedArtifactsView = configuration.incoming.artifactView { view ->
140+
view.attributes { attributes ->
141+
// 明确指定我们只对 artifactType 为 'aar' 的构件感兴趣
142+
// AGP 也常用 "android-aar",如果 "aar" 效果不佳,可以尝试替换
143+
attributes.attribute(Attribute.of("artifactType", String.class), "aar")
144+
}
145+
// lenient(false) 是默认行为。如果设为 true,它会尝试跳过无法解析的构件而不是让整个视图失败。
146+
// 但如果像之前那样,是组件级别的变体选择失败 (如 gsyVideoPlayer),lenient 可能也无法解决。
147+
// view.lenient(false)
148+
}.artifacts // 获取 ResolvedArtifactSet
149+
150+
project.logger.info("对于变体 '${variant.name}',从配置 '${configuration.name}' 解析到 ${resolvedArtifactsView.artifacts.size()} 个 AAR 类型的构件。")
151+
152+
resolvedArtifactsView.each { resolvedArtifactResult ->
153+
// resolvedArtifactResult 是 ResolvedArtifactResult 类型的对象
154+
File aarFile = resolvedArtifactResult.file
155+
// 获取组件的标识符,这能告诉我们依赖的来源
156+
// 例如:"project :gsyVideoPlayer" 或 "com.google.android.material:material:1.7.0"
157+
String aarIdentifier = resolvedArtifactResult.id.componentIdentifier.displayName
158+
159+
aarSoFilesMap.putIfAbsent(aarIdentifier, new HashSet<String>())
160+
161+
if (aarFile.exists() && aarFile.name.endsWith('.aar')) {
162+
// project.logger.info("正在检查 AAR: ${aarIdentifier} (文件: ${aarFile.name})")
163+
try {
164+
project.zipTree(aarFile).matching {
165+
include '**/*.so' // 匹配 AAR 中的所有 .so 文件
166+
}.each { File soFileInZip ->
167+
aarSoFilesMap[aarIdentifier].add(soFileInZip.path)
168+
}
169+
} catch (Exception e) {
170+
project.logger.error("错误: 无法检查 AAR 文件 '${aarIdentifier}' (路径: ${aarFile.absolutePath})。原因: ${e.message}")
171+
}
172+
} else {
173+
if (!aarFile.name.endsWith('.aar')) {
174+
project.logger.debug("跳过非 AAR 文件 '${aarFile.name}' (来自: ${aarIdentifier}),其构件类型被解析为 AAR。")
175+
} else {
176+
project.logger.warn("警告: 来自 '${aarIdentifier}' 的 AAR 文件不存在: ${aarFile.absolutePath}")
177+
}
178+
}
179+
}
180+
181+
} catch (Exception e) {
182+
// 这个 catch 块会捕获解析构件视图时发生的错误
183+
// 这可能仍然包括之前遇到的 "Could not resolve all artifacts for configuration" 错误,
184+
// 如果问题非常根本,即使是特定的构件视图也无法克服。
185+
project.logger.error("错误: 无法为配置 '${configuration.name}' 解析 AAR 类型的构件。" +
186+
"这通常表明您的项目设置中存在依赖变体匹配问题," +
187+
"特别是对于像 ':gsyVideoPlayer' 这样的项目依赖。 " +
188+
"详细信息: ${e.message}", e) // 打印异常堆栈以获取更多信息
189+
project.logger.error("建议: 请检查项目依赖(尤其是本地子项目如 ':gsyVideoPlayer')的构建配置," +
190+
"确保它们能正确地发布带有标准 Android 库属性(如组件类别、构建类型,以及适用的 Kotlin 平台类型等)的变体。")
191+
// 如果希望任务在此处停止而不是尝试其他变体,可以取消下一行的注释
192+
// throw e
193+
}
194+
}
195+
196+
// 打印结果
197+
if (aarSoFilesMap.isEmpty()) {
198+
project.logger.lifecycle("\n在所有已处理变体的可解析 AAR 依赖中均未找到 .so 文件,或者依赖解析失败。")
199+
} else {
200+
println "\n--- AAR 依赖中的 .so 文件来源 ---"
201+
// 按 AAR 标识符排序以获得一致的输出
202+
aarSoFilesMap.sort { it.key }.each { aarId, soFileList ->
203+
if (!soFileList.isEmpty()) {
204+
println "${aarId}:" // 例如:project :gsyVideoPlayer: 或 com.some.library:core:1.0:
205+
soFileList.sort().each { soPath -> // 对 .so 文件路径排序
206+
println " - ${soPath}" // 例如: - jni/armeabi-v7a/libexample.so
207+
}
208+
}
209+
}
210+
println "----------------------------------"
211+
}
212+
project.logger.lifecycle("任务执行完毕。要再次运行此任务,请执行: ./gradlew ${project.name}:${name}")
213+
}
214+
}

devtools_options.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
description: This file stores settings for Dart & Flutter DevTools.
2+
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
3+
extensions:

lib/common/localization/l10n/app_localizations.dart

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,17 @@ import 'app_localizations_zh.dart';
6464
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
6565
/// property.
6666
abstract class AppLocalizations {
67-
AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());
67+
AppLocalizations(String locale)
68+
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
6869

6970
final String localeName;
7071

7172
static AppLocalizations? of(BuildContext context) {
7273
return Localizations.of<AppLocalizations>(context, AppLocalizations);
7374
}
7475

75-
static const LocalizationsDelegate<AppLocalizations> delegate = _AppLocalizationsDelegate();
76+
static const LocalizationsDelegate<AppLocalizations> delegate =
77+
_AppLocalizationsDelegate();
7678

7779
/// A list of this localizations delegate along with the default localizations
7880
/// delegates.
@@ -84,7 +86,8 @@ abstract class AppLocalizations {
8486
/// Additional delegates can be added by appending to this list in
8587
/// MaterialApp. This list does not have to be used at all if a custom list
8688
/// of delegates is preferred or required.
87-
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates = <LocalizationsDelegate<dynamic>>[
89+
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
90+
<LocalizationsDelegate<dynamic>>[
8891
delegate,
8992
GlobalMaterialLocalizations.delegate,
9093
GlobalCupertinoLocalizations.delegate,
@@ -916,7 +919,8 @@ abstract class AppLocalizations {
916919
String get feed_back_tip;
917920
}
918921

919-
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
922+
class _AppLocalizationsDelegate
923+
extends LocalizationsDelegate<AppLocalizations> {
920924
const _AppLocalizationsDelegate();
921925

922926
@override
@@ -925,27 +929,29 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations>
925929
}
926930

927931
@override
928-
bool isSupported(Locale locale) => <String>['en', 'ja', 'ko', 'zh'].contains(locale.languageCode);
932+
bool isSupported(Locale locale) =>
933+
<String>['en', 'ja', 'ko', 'zh'].contains(locale.languageCode);
929934

930935
@override
931936
bool shouldReload(_AppLocalizationsDelegate old) => false;
932937
}
933938

934939
AppLocalizations lookupAppLocalizations(Locale locale) {
935-
936-
937940
// Lookup logic when only language code is specified.
938941
switch (locale.languageCode) {
939-
case 'en': return AppLocalizationsEn();
940-
case 'ja': return AppLocalizationsJa();
941-
case 'ko': return AppLocalizationsKo();
942-
case 'zh': return AppLocalizationsZh();
942+
case 'en':
943+
return AppLocalizationsEn();
944+
case 'ja':
945+
return AppLocalizationsJa();
946+
case 'ko':
947+
return AppLocalizationsKo();
948+
case 'zh':
949+
return AppLocalizationsZh();
943950
}
944951

945952
throw FlutterError(
946-
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
947-
'an issue with the localizations generation tool. Please file an issue '
948-
'on GitHub with a reproducible sample app and the gen-l10n configuration '
949-
'that was used.'
950-
);
953+
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
954+
'an issue with the localizations generation tool. Please file an issue '
955+
'on GitHub with a reproducible sample app and the gen-l10n configuration '
956+
'that was used.');
951957
}

lib/common/localization/l10n/app_localizations_en.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ class AppLocalizationsEn extends AppLocalizations {
7575
String get login_out => 'Logout';
7676

7777
@override
78-
String get login_deprecated => 'The API via password authentication will remove on November 13, 2020 by Github';
78+
String get login_deprecated =>
79+
'The API via password authentication will remove on November 13, 2020 by Github';
7980

8081
@override
8182
String get home_reply => 'Feedback';
@@ -159,7 +160,8 @@ class AppLocalizationsEn extends AppLocalizations {
159160
String get network_error_404 => 'Http 404';
160161

161162
@override
162-
String get network_error_422 => 'Request Body Error, Please check Github ClientId or Account/PW';
163+
String get network_error_422 =>
164+
'Request Body Error, Please check Github ClientId or Account/PW';
163165

164166
@override
165167
String get network_error_timeout => 'Http timeout';
@@ -171,7 +173,8 @@ class AppLocalizationsEn extends AppLocalizations {
171173
String get network_error => 'Network error';
172174

173175
@override
174-
String get github_refused => 'Github Api error[OS Error: Connection refused]. Please switch networks or try again later';
176+
String get github_refused =>
177+
'Github Api error[OS Error: Connection refused]. Please switch networks or try again later';
175178

176179
@override
177180
String get load_more_not => 'Nothing';
@@ -414,5 +417,6 @@ class AppLocalizationsEn extends AppLocalizations {
414417
String get search_language => 'Language';
415418

416419
@override
417-
String get feed_back_tip => 'Your feedback will be sent to Github as a public issue';
420+
String get feed_back_tip =>
421+
'Your feedback will be sent to Github as a public issue';
418422
}

lib/common/localization/l10n/app_localizations_ja.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ class AppLocalizationsJa extends AppLocalizations {
159159
String get network_error_404 => 'Http 404';
160160

161161
@override
162-
String get network_error_422 => 'リクエストボディエラー、Github ClientIdまたはアカウント/パスワードを確認してください';
162+
String get network_error_422 =>
163+
'リクエストボディエラー、Github ClientIdまたはアカウント/パスワードを確認してください';
163164

164165
@override
165166
String get network_error_timeout => 'Http タイムアウト';
@@ -171,7 +172,8 @@ class AppLocalizationsJa extends AppLocalizations {
171172
String get network_error => 'ネットワークエラー';
172173

173174
@override
174-
String get github_refused => 'Github APIエラー[OSエラー: 接続拒否]。ネットワークを切り替えるか、後でもう一度お試しください';
175+
String get github_refused =>
176+
'Github APIエラー[OSエラー: 接続拒否]。ネットワークを切り替えるか、後でもう一度お試しください';
175177

176178
@override
177179
String get load_more_not => 'これ以上ありません';

lib/common/localization/l10n/app_localizations_ko.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ class AppLocalizationsKo extends AppLocalizations {
171171
String get network_error => '네트워크 오류';
172172

173173
@override
174-
String get github_refused => 'Github API 오류[OS 오류: 연결 거부]. 네트워크를 전환하거나 나중에 다시 시도하세요';
174+
String get github_refused =>
175+
'Github API 오류[OS 오류: 연결 거부]. 네트워크를 전환하거나 나중에 다시 시도하세요';
175176

176177
@override
177178
String get load_more_not => '더 이상 없음';

lib/common/localization/l10n/app_localizations_zh.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ class AppLocalizationsZh extends AppLocalizations {
171171
String get network_error => '网络错误';
172172

173173
@override
174-
String get github_refused => 'Github Api 出现异常[Connection refused],建议换个网络环境或者稍后再试';
174+
String get github_refused =>
175+
'Github Api 出现异常[Connection refused],建议换个网络环境或者稍后再试';
175176

176177
@override
177178
String get load_more_not => '没有更多数据';

0 commit comments

Comments
 (0)