我尝试在我的应用中初始化Parse Android SDK,但是每当我尝试保存对象解析时,都会抛出NullPointerException
06-27 15:22:54.643 25869-25869/glassstones.net.creche E/APP: java.lang.NullPointerException: value for name X-Parse-App-Display-Version == null
我在其他几个项目上使用过parse,但从未见过抛出此异常。这就是我初始化Parse的方式:
ParseObject.registerSubclass(ParseMessage::class.java)
val config = Parse.Configuration.Builder(context)
.clientKey("")
.applicationId(appId)
.server(baseUrl)
.build()
Parse.setLogLevel(Parse.LOG_LEVEL_DEBUG)
Parse.initialize(config)
这就是我保存对象的方式:
val message = ParseMessage()
message.content = "Blah blah"
message.saveInBackground {
if (it == null) {
Log.e("APP", "Good")
} else {
Log.e("APP", it.message)
}
}
依赖项:
parseVersion = "1.17.3"
androidBuildToolsVersion = "27.0.3"
androidMinSdkVersion = 21
androidTargetSdkVersion = 27
androidCompileSdkVersion = 27