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

Bug: rebuildChannel releaseOutputDir can't use exist folder #12

Closed
gengjiawen opened this issue May 10, 2017 · 1 comment
Closed

Bug: rebuildChannel releaseOutputDir can't use exist folder #12

gengjiawen opened this issue May 10, 2017 · 1 comment

Comments

@gengjiawen
Copy link

When releaseOutputDir is already exist in filesystem.
I get the following exception

* What went wrong:
Execution failed for task ':passenger:reBuildChannel'.
> java.lang.NullPointerException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

If releaseOutputDir doesn't exist, everything works fine.

@ltlovezh
Copy link
Collaborator

the code is:
public boolean isNeedRebuildReleaseApk() {
if (baseReleaseApk == null || !baseReleaseApk.exists() || !baseReleaseApk.isFile()) {
println("baseReleaseApk : ${baseReleaseApk} , it is not a valid file , so can not rebuild release channel apk");
return false
} else {
if (releaseOutputDir == null) {
throw new GradleException("baseReleaseApk : ${baseReleaseApk} is ok , so you should set a valid releaseOutputDir , or you can set baseReleaseApk = null")
}

        if (!releaseOutputDir.exists()) {
            releaseOutputDir.mkdirs()
        } else {
            // delete old apks
            releaseOutputDir.eachFile { file ->
                if (file.name.endsWith(".apk")) {
                    file.delete()
                }
            }
        }
        return true
    }
}

and I didn't encounter this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants