我是靠谱客的博主 长情酸奶,最近开发中收集的这篇文章主要介绍no number java_No signature of method: java.lang.String.div() is applicable for argument types: (jav...,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

问题

I am trying to create version numbers based git commits, but I keep getting the following error when I run gradle (this is in the build.gradle file)

ext {

// Get version number and build number

def gitNum = "git rev-list --count master".execute().text.trim()

def version = (gitNum / 10)

def build = (gitNum.toInterger % 10)

}

Error:

No signature of method: java.lang.String.div() is applicable for argument types:

(java.lang.Integer) values: [10] Possible solutions:

is(java.lang.Object), drop(int), wait(), trim(), dump(), any()

回答1:

I think this is what you want.

def gitNum = "git rev-list --count master".execute().text.trim().toInteger()

来源:https://stackoverflow.com/questions/49711193/no-signature-of-method-java-lang-string-div-is-applicable-for-argument-types

最后

以上就是长情酸奶为你收集整理的no number java_No signature of method: java.lang.String.div() is applicable for argument types: (jav...的全部内容,希望文章能够帮你解决no number java_No signature of method: java.lang.String.div() is applicable for argument types: (jav...所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(44)

评论列表共有 0 条评论

立即
投稿
返回
顶部