Skip to content Skip to sidebar Skip to footer

Verbose Build Logs From Android Studio

How do I get a verbose log (including the command-line arguments to compiler and linker) when building with Android Studio? I have just transitioned from Ant / Android.mk builds to

Solution 1:

It turns out you can make the build verbose by changing the build.gradle file as follows:

    externalNativeBuild {
        cmake {
            arguments"-DCMAKE_VERBOSE_MAKEFILE=1"       
        }
    }

When using ndk-build instead of cmake, use this instead:

    externalNativeBuild {
        ndkBuild {
            arguments"V=1"
        }
    }

Solution 2:

Regarding to https://developer.android.com/reference/tools/gradle-api/4.1/com/android/build/api/dsl/NdkBuild there is no possibility to pass arguments. But you can pass an the folder for outputs, which generates .json files

    externalNativeBuild {
        ndkBuild {
            // Tells Gradle to put outputs from external native// builds in the path specified below.
            buildStagingDirectory "./outputs/ndk-build"
            path 'Android.mk'
        }
    }

So in my case in outputs/ndk-build/debug/json_generation_record.json the last "message" told me the error:

JSON generation completed with problem. Exception:Buildcommandfailed.Errorwhileexecutingprocess....ndk-build.cmd.......Android.mk:myLib-prebuilt:LOCAL_SRC_FILESpointstoamissingfileAndroid NDK:Checkthat...existsorthatitspathiscorrect...prebuilt-library.mk:45:***Android NDK:Aborting.Stop.\n"

Post a Comment for "Verbose Build Logs From Android Studio"