简体   繁体   English

Fastlane Android Build in flutter 问题

[英]Fastlane Android Build in flutter issue

When I take to build for the flutter app using Fastlane, the APK is being generated in a build folder outside the android folder.当我使用 Fastlane 为 Flutter 应用程序构建时,APK 是在 android 文件夹外的构建文件夹中生成的。

The message after the successful build of android is android构建成功后的消息是

Couldn't find any new signed apk files...找不到任何新签名的 apk 文件...

The generated paths are all empty.生成的路径都是空的。

生成的路径

But I found a generated APK outside the android folder in the path但是我在路径中的android文件夹之外发现了一个生成的APK

build/app/outputs/apk/release/app-release.apk build/app/outputs/apk/release/app-release.apk

Will be the generated APK path be constant or will change with the future releases of flutter?生成的 APK 路径会保持不变还是会随着 Flutter 的未来版本而改变? How to solve this issue?如何解决这个问题?

Also, the GitHub issue for the same has been closed due to lack of inactivity.此外,由于缺乏活动,GitHub 问题也已关闭。 ref: github参考: github

I have also faced the same issue, I resolved by changing the configuration like below:我也遇到了同样的问题,我通过更改如下配置解决了:

platform :android do
    desc ""
    lane :distribute do
    gradle(
        task: 'assemble',
        build_type: 'Release'
    )
        firebase_app_distribution(
            app: "<Enter your appId>",
            firebase_cli_token: "<Enter your token>",
            testers: "",
            release_notes: "",
            firebase_cli_path: "/usr/local/bin/firebase",
            apk_path: "../build/app/outputs/apk/release/app-release.apk"
        )
    end
end

Run below fastlane commands:运行以下 fastlane 命令:

fastlane add_plugin firebase_app_distribution
fastlane run firebase_app_distribution_login

The above command will provide you firebase_cli_token add the same to above configuration.上面的命令将为您提供 firebase_cli_token 将相同的内容添加到上面的配置中。

fastlane distribute

Note: Make sure you login to your Firebase account and click on get started for App Distribution.注意:确保您登录到您的 Firebase 帐户并单击“开始应用分发”。

Update your fastfile with the below code, So it will take the latest release aab file from the given path and it will upload the same on the internal app sharing.使用以下代码更新您的fastfile ,因此它将从给定路径中获取最新版本的 aab 文件,并将其上传到内部应用程序共享中。

default_platform(:android)

platform :android do
 desc 'Build a signed release APK & deploy to Internal App Sharing'
 lane :sign_apk_build do
   gradle(
     task: 'bundle',
     build_type: 'Release',
     print_command: false,
     properties: {
       'android.injected.signing.store.file' => ENV['storeFile'],
       'android.injected.signing.store.password' => ENV['storePassword'],
       'android.injected.signing.key.alias' => ENV['keyAlias'],
       'android.injected.signing.key.password' => ENV['keyPassword']
     }
   )
   upload_to_play_store_internal_app_sharing(
     aab: '/Users/dhavalkansara/Flutter Development/OfficeProjects/my-doses/build/app/outputs/bundle/release/app-release.aab' 
   )
 end
end

Note: You guys can update the aab path as per your project folder structure.注意:你们可以根据你的项目文件夹结构更新 aab 路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM