Skip to content

Error building app when build variants are added - Android Studio #1508

Closed Answered by rh101
murasu asked this question in Q&A
Discussion options

You must be logged in to vote

At the end of the app/build.gradle file, look for this section:

project.afterEvaluate {
    if (tasks.findByName("externalNativeBuildDebug")) {
        copyDebugAxslcToAssets.dependsOn externalNativeBuildDebug
        compileDebugJavaWithJavac.dependsOn copyDebugAxslcToAssets
    }
    if (tasks.findByName("externalNativeBuildRelease")) {
        copyReleaseAxslcToAssets.dependsOn externalNativeBuildRelease
        compileReleaseJavaWithJavac.dependsOn copyReleaseAxslcToAssets
    }
}

You may need to update that section with your required variants. For example, if your variant is named "custom":

project.afterEvaluate {
    if (tasks.findByName("externalNativeBuildDebug")) {
        copyD…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@murasu
Comment options

@rh101
Comment options

rh101 Dec 12, 2023
Collaborator

@murasu
Comment options

@rh101
Comment options

rh101 Dec 12, 2023
Collaborator

Answer selected by murasu
@murasu
Comment options

@rh101
Comment options

rh101 Dec 12, 2023
Collaborator

@murasu
Comment options

@halx99
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants