Android versionCode 를 날짜+순번으로 (다음 날 판이 "더 낮은 버전" 으로 설치 거부되던 문제)
- build.gradle.kts: 2026.10.2+1 → versionCode 261002001 (순번이 날마다 1 로 돌아가도 늘 커짐) - formatVersion: 빌드 번호의 끝 세 자리를 순번으로 (Android 제목이 v2026.10.02_261002001 로 보이던 것) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>main v2026.10.02_001
parent
467c0ea8b5
commit
04cd32e0eb
|
|
@ -28,7 +28,11 @@ android {
|
|||
// ffmpeg-kit 은 Android 7.0 (API 24) 이상
|
||||
minSdk = maxOf(24, flutter.minSdkVersion)
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
// 버전 "년.월.일+순번" 의 순번은 날마다 1 부터 다시 시작하므로 그대로 쓰면 다음 날 판이 "더 낮은 버전" 으로
|
||||
// 설치가 거부된다. 날짜를 앞에 붙여 늘 커지게 한다: 2026.10.2+1 → 261002001
|
||||
versionCode = flutter.versionName.split(".").let { (y, m, d) ->
|
||||
(y.toInt() % 100) * 10_000_000 + m.toInt() * 100_000 + d.toInt() * 1_000 + flutter.versionCode
|
||||
}
|
||||
versionName = flutter.versionName
|
||||
// 요즘 휴대폰 · 태블릿 (64비트 ARM) 만. 플러그인이 다른 CPU 용 라이브러리를 넣어도 앱 본체가 없으면 실행되지 않으므로 뺀다
|
||||
ndk {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ String formatVersion(String v) {
|
|||
final n = parseVersion(v);
|
||||
if (n.length < 3 || n[0] < 2000) return n.join('.');
|
||||
String two(int x) => x.toString().padLeft(2, '0');
|
||||
final seq = n.length > 3 ? n[3] : 1;
|
||||
// Android 는 빌드 번호 자리에 날짜를 붙인 versionCode (261002001) 가 온다 → 끝 세 자리가 순번
|
||||
final seq = n.length > 3 ? n[3] % 1000 : 1;
|
||||
return '${n[0]}.${two(n[1])}.${two(n[2])}_${seq.toString().padLeft(3, '0')}';
|
||||
}
|
||||
|
||||
|
|
|
|||
BIN
packages/flutter_inappwebview_android/android/.gradle/9.2.0/checksums/checksums.lock
vendored
Normal file
BIN
packages/flutter_inappwebview_android/android/.gradle/9.2.0/checksums/checksums.lock
vendored
Normal file
Binary file not shown.
BIN
packages/flutter_inappwebview_android/android/.gradle/9.2.0/checksums/md5-checksums.bin
vendored
Normal file
BIN
packages/flutter_inappwebview_android/android/.gradle/9.2.0/checksums/md5-checksums.bin
vendored
Normal file
Binary file not shown.
BIN
packages/flutter_inappwebview_android/android/.gradle/9.2.0/checksums/sha1-checksums.bin
vendored
Normal file
BIN
packages/flutter_inappwebview_android/android/.gradle/9.2.0/checksums/sha1-checksums.bin
vendored
Normal file
Binary file not shown.
BIN
packages/flutter_inappwebview_android/android/.gradle/9.2.0/fileChanges/last-build.bin
vendored
Normal file
BIN
packages/flutter_inappwebview_android/android/.gradle/9.2.0/fileChanges/last-build.bin
vendored
Normal file
Binary file not shown.
BIN
packages/flutter_inappwebview_android/android/.gradle/9.2.0/fileHashes/fileHashes.bin
vendored
Normal file
BIN
packages/flutter_inappwebview_android/android/.gradle/9.2.0/fileHashes/fileHashes.bin
vendored
Normal file
Binary file not shown.
BIN
packages/flutter_inappwebview_android/android/.gradle/9.2.0/fileHashes/fileHashes.lock
vendored
Normal file
BIN
packages/flutter_inappwebview_android/android/.gradle/9.2.0/fileHashes/fileHashes.lock
vendored
Normal file
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,2 @@
|
|||
#Fri Oct 02 20:32:59 KST 2026
|
||||
gradle.version=9.2.0
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,2 @@
|
|||
#Fri Oct 02 20:24:51 KST 2026
|
||||
gradle.version=8.10.1
|
||||
|
|
@ -39,6 +39,7 @@ void main() {
|
|||
expect(formatVersion('2026.9.30+1'), '2026.09.30_001'); // pubspec 의 표기 → 보이는 글
|
||||
expect(formatVersion('v2026.09.30_012'), '2026.09.30_012');
|
||||
expect(formatVersion('2026.10.1+3'), '2026.10.01_003');
|
||||
expect(formatVersion('2026.10.2+261002001'), '2026.10.02_001'); // Android versionCode
|
||||
expect(formatVersion('v1.2.3'), '1.2.3'); // 예전 방식은 그대로
|
||||
// 같은 날: 순번이 크면 최신. 날이 바뀌면 001 이어도 최신.
|
||||
expect(compareVersions('2026.09.30_002', '2026.9.30+1'), greaterThan(0));
|
||||
|
|
|
|||
Loading…
Reference in New Issue