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

Cannot invoke method minus() on null object #270

Open
DarkHorsePXF opened this issue Aug 27, 2015 · 5 comments
Open

Cannot invoke method minus() on null object #270

DarkHorsePXF opened this issue Aug 27, 2015 · 5 comments

Comments

@DarkHorsePXF
Copy link

按照StackOverflow http://stackoverflow.com/questions/19487576/gradle-build-null-console-object上的某个答案:
For some reason, running gradle in daemon mode causes a null console object. If you specify the appropriate command line flag,

./gradlew assembleRelease --no-daemon

it'll work.

但是还是build failed。

错误是
Error:(36, 0) Cannot invoke method minus() on null object

代码行数是:
35 targetSdkVersion 21
36 versionCode -1
37 versionName null

@jeffreyji666
Copy link

我也有这个问题,折腾很久,还是编译不通过,移掉versionCode或versionName均无效。

@ipcjs
Copy link

ipcjs commented Sep 3, 2015

库上的版本配置错了,点我的资料,我fork了一份可以编译过的代码

@jeffreyji666
Copy link

哪里错了?

@edidada
Copy link

edidada commented Oct 7, 2015

我去掉了“-”改成“versionCode 1”,成功编译

@DarkHorsePXF
Copy link
Author

问题解决!解决方案如下:
1.将gradle.build文件中的 versionCode -1 改成 versionCode 1
2.将gradle.build文件中的runProguard改成minifyEnabled
然后就可以编译了

DarkHorsePXF added a commit to DarkHorsePXF/weiciyuan that referenced this issue Oct 8, 2015
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

4 participants