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

Execution failed for task ':app:minifyDevReleaseWithR8' #147650

Closed
tristanjclarke opened this issue May 1, 2024 · 4 comments
Closed

Execution failed for task ':app:minifyDevReleaseWithR8' #147650

tristanjclarke opened this issue May 1, 2024 · 4 comments
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@tristanjclarke
Copy link

tristanjclarke commented May 1, 2024

Steps to reproduce

I'm building an Android APK in CodeMagic and receiving this error.

The CodeMagic machine is running on "macOS M1 VM" and is using Flutter version 3.19.5.

Expected results

Flutter builds an APK.

Actual results

Flutter throws an error as seen in Logs.

Logs

Logs
ERROR:/Users/builder/.gradle/caches/transforms-3/e4ba4457cc797ccfe2ba62cbd1e17388/transformed/jetified-tracking-3.10.0-runtime.jar: R8: com.android.tools.r8.internal.Jc: Sealed classes are not supported as program classes

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:minifyDevReleaseWithR8'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
   > Compilation failed to complete, origin: /Users/builder/.gradle/caches/transforms-3/e4ba4457cc797ccfe2ba62cbd1e17388/transformed/jetified-tracking-3.10.0-runtime.jar:io/customer/sdk/data/model/Region.class

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.19.5, on macOS 14.4.1 23E224 darwin-arm64, locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.2)
[✓] IntelliJ IDEA Community Edition (version 2024.1)
[✓] VS Code (version 1.88.1)
[✓] Connected device (4 available)
[✓] Network resources

! Doctor found issues in 1 category.
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label May 2, 2024
@danagbemava-nc
Copy link
Member

Hi @tristanjclarke, this is likely due to the gradle version you're using. Can you try the comments in https://stackoverflow.com/questions/73453524/what-is-causing-this-error-com-android-tools-r8-internal-nc-sealed-classes-are to see if it helps?

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 2, 2024
@tristanjclarke
Copy link
Author

Hi @danagbemava-nc I tried this without any luck. Please see my files below:

build.gradle:

buildscript {
    ext.kotlin_version = '1.9.20'
    repositories {
        google()
        mavenCentral()
        maven {
            url 'https://plugins.gradle.org/m2/'
        }
        maven {
            url 'http://developer.huawei.com/repo/'
            allowInsecureProtocol = true
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.3.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.14'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.0'
    }
}

def noUnity = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase().contains("nounity")

allprojects {
    repositories {
        if (!noUnity) {
            flatDir {
                dirs "${project(':unityLibrary').projectDir}/libs"
            }
        }
        google()
        mavenCentral()
        maven {
            url 'http://developer.huawei.com/repo/'
            allowInsecureProtocol = true
        }
    }
}

rootProject.buildDir = '../build'

subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}

subprojects {
    project.evaluationDependsOn(':app')
}

tasks.register('clean', Delete) {
    delete rootProject.buildDir
}

setting.gradle:

def noUnity = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase().contains("nounity")

if (noUnity) {
    include ':app'
} else {
    include ':app', ':unity-classes'
}

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
    pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}

plugins.each { name, path ->
    def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
    include ":$name"
    project(":$name").projectDir = pluginDirectory
}

if (!noUnity) {
    include ":unityLibrary"
    project(":unityLibrary").projectDir = file("./unityLibrary")
}

gradle.beforeProject({ project->
    if (project.hasProperty("target-platform") && !project.getProperty("target-platform").split(",").contains("android-arm")) {
        project.setProperty("target-platform", "android-arm,android-arm64")
    }
})

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 2, 2024
@danagbemava-nc
Copy link
Member

Hi @tristanjclarke, can you try https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply to see if that helps?

Also, are you only facing this issue on CI?

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 3, 2024
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

2 participants