vovs03 / pocket_coach

It's a code base for mobile App "Pocket Coach"
https://pocket.tw1.ru/
0 stars 0 forks source link

Android |> build `apk` #39

Open vovs03 opened 1 month ago

vovs03 commented 1 month ago

Android |> build apk

2024-04-01 16:01

> **RED_ALERT** You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply
>
>Checking the license for package Android SDK Platform 34 in /usr/local/share/android-sdk/licenses
License for package Android SDK Platform 34 accepted.
Preparing "Install Android SDK Platform 34 (revision: 3)".
"Install Android SDK Platform 34 (revision: 3)" ready.
Installing Android SDK Platform 34 in /usr/local/share/android-sdk/platforms/android-34
"Install Android SDK Platform 34 (revision: 3)" complete.
"Install Android SDK Platform 34 (revision: 3)" finished.
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 1844 bytes (99.9% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
>
> **FAILURE:** Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processReleaseMainManifest'.
> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @6aaddca7

* 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

> BUILD FAILED in 5m 38s
> Running Gradle task 'assembleRelease'...                          338,9s
> Gradle task assembleRelease failed with exit code 1

😸 Kotlin


VSCode plugin | Gradle for Java


Gradle settings

https://docs.gradle.org/current/userguide/userguide.html

Gradle, Inc. предоставляет бесплатную услугу под названием Build Scan® это дает обширную информацию и идеи о ваших сборках. Вы можете просматривать сканы для выявления проблем или делиться ими для отладки помощи.

android/build.gradle

Удалить все buildscript блок от <app-src/android/build.gradle:

Удалил с 1й строки

buildscript {
    ext.kotlin_version = '1.9.22'
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:8.7.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
vovs03 commented 1 month ago

После 2х часов попыток сбилдить

https://docs.flutter.dev/deployment/android#android-release-faq

vovs03 commented 1 month ago

Android | Sign App

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format 
using "keytool -importkeystore -srckeystore /Users/vovs03/upload-keystore.jks -destkeystore /Users/vovs03/upload-keystore.jks -deststoretype pkcs12".
vovs03 commented 1 month ago

Article - flutter build android apk

2024-04-02 14:53