amzn / fire-app-builder

Fire App Builder is a framework for building java media apps for Fire TV, allowing you to add your feed of media content to a configuration file and build an app to browse and play it quickly.
Other
181 stars 258 forks source link

Fire App Builder will not Finish Install #59

Open StevenEsqTwo opened 4 years ago

StevenEsqTwo commented 4 years ago

I have followed all the the directions at https://developer.amazon.com/docs/fire-app-builder/download-and-build.html and run all of the updates when prompted. I have "cleaned" and "rebuilt" the project numerous times but still no dice. Any feedback is appreciated.

Here's the error:

Caused by: groovy.lang.GroovyRuntimeException: Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apkData=Main{type=MAIN, fullName=debug, filters=[], versionCode=10, versionName=1.0.7}} of type com.android.build.gradle.internal.api.ApkVariantOutputImpl.

More Details:

FAILURE: Build failed with an exception.

levonlevonian commented 4 years ago

Hi StevenEsqTwo,

If you have an absolute path specified in your Gradle script for the output file, then please note that absolute paths are not supported when setting an output file name. Also, instead of output.outputFile, you'll need to use output.outputFileName. Please check those 2 things in your Gradle script, and hopefully it builds fine. Thanks!

applicationVariants.all { variant ->
    variant.outputs.all {
        outputFileName = "${variant.name}-${variant.versionName}.apk"
    }
}
StevenEsqTwo commented 4 years ago

Hi levonlevonian:

Thank you very much for your very helpful feedback. I am getting one last error which I hope you have seen before! Any clues? Thank you so much for looking.

A problem occurred evaluating script.

Could not get unknown property 'applicationVariants' for project ':app' of type org.gradle.api.Project.

Here is my existing script with your recommendations:

def all = applicationVariants.all { variant -> ; def appName // Use applicationName if available, else use parent name if (project.hasProperty("applicationName")) { appName = applicationName } else { appName = parent.name }

variant.outputs.all { 

    def newApkName
    if (output.zipAlign) {
        newApkName = "${appName}-${output.baseName}-${variant.versionName}.apk"
    } else {
        newApkName = "${appName}-${output.baseName}-${variant.versionName}-unaligned.apk"
    }
    output.outputFileName = "${variant.name}-${variant.versionName}.apk"
}

}

levonlevonian commented 4 years ago

Hi StevenEsqTwo,

To be able to use applicationVariants.all you need to ensure you have apply plugin: 'com.android.application' and not apply plugin: 'com.android.library'. Also, feel free to search for a solution to any build errors on StackOverflow, since those are generic Android build errors, rather than Fire App Builder specific. Thanks!