Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change apk name error #54833

Closed
gwhcn opened this issue Apr 15, 2020 · 2 comments
Closed

Change apk name error #54833

gwhcn opened this issue Apr 15, 2020 · 2 comments
Labels
platform-android Android applications specifically t: gradle "flutter build" and "flutter run" on Android tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@gwhcn
Copy link

gwhcn commented Apr 15, 2020

run ' flutter build apk --flavor dev -t lib/main_dev.dart'

Gradle build failed to produce an .apk file. It's likely that this file was generated under /Users/xxx/FlutterProjects/xxxxx/xxxxx/build, but the tool couldn't find it.

[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.4 19E266,
    locale zh-Hans-CN)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.44.0)
[✓] Connected device (1 available)

android build.gradle

flavorDimensions "app"
productFlavors {
    //测试
    dev {//development
        dimension "app"
    }
    //生产环境
    production{
        dimension "app"
    }
}
productFlavors.all {
    flavor -> flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
}

//If you delete the following code, you will not get an error, but i want change apk name
android.applicationVariants.all { variant ->
    variant.outputs.all {
        println outputFileName
        if(outputFileName.contains('release')){
            outputFileName = "NianYu_${variant.flavorName}_${variant.versionName}_${defaultConfig.versionCode}.apk"
        }
    }
}

@VladyslavBondarenko VladyslavBondarenko added platform-android Android applications specifically t: gradle "flutter build" and "flutter run" on Android tool Affects the "flutter" command-line tool. See also t: labels. labels Apr 15, 2020
@jmagman jmagman added this to Awaiting triage in Tools - Gradle review via automation Apr 15, 2020
@jonahwilliams
Copy link
Member

Fixed by #54328

Tools - Gradle review automation moved this from Awaiting triage to Engineer reviewed Apr 17, 2020
@lock
Copy link

lock bot commented May 6, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@lock lock bot locked and limited conversation to collaborators May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform-android Android applications specifically t: gradle "flutter build" and "flutter run" on Android tool Affects the "flutter" command-line tool. See also t: labels.
Projects
Tools - Gradle review
  
Engineer reviewed
Development

No branches or pull requests

3 participants