2

I tried initializing Parse Android SDK in my app but anytime I try to save an object parse throws a 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

I have used parse on several other projects and have never seen this exception thrown. This is how I'm initializing 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)

And this is how I'm saving the object:

val message = ParseMessage()
        message.content = "Blah blah"
        message.saveInBackground {
            if (it == null) {
                Log.e("APP", "Good")
            } else {
                Log.e("APP", it.message)
            }
        }

Dependencies:

parseVersion = "1.17.3"
androidBuildToolsVersion = "27.0.3"
androidMinSdkVersion = 21
androidTargetSdkVersion = 27
androidCompileSdkVersion = 27
Manuel
  • 14,274
  • 6
  • 57
  • 130
Mr Smith
  • 331
  • 1
  • 4
  • 14

1 Answers1

0

I had the same problem in JAVA (not Kotlin) and manage to solve it:

Change de dependencies to the last version of parse-community (I was using parse-android):

//    implementation 'com.parse:parse-android:1.16.3'
    implementation "com.github.parse-community.Parse-SDK-Android:parse:4.1.0"

It was related to this issue: https://github.com/parse-community/Parse-SDK-Android/issues/1012

Perhaps is related to what happens to you in kotlin.

Sorrentum
  • 122
  • 8