Start a new topic

Multidex issue and Null Pointer Exceptions during setting up Kinvey login/signup

I'm trying to set up Kinvey log in via username/password for my Android app. Largely based on the sample Kinvey Login app, I'm very close to being done. However I keep getting a NPE error when I try to open my app. The login activity is my launcher activity. Here's the error:

  • java.lang.RuntimeException: Unable to create application langsdroid.tcme.KinveyMobile.UserLogin: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.InputStream java.net.URL.openStream()' on a null object reference


the null object seems to be the following line in my UserLogin activity:

  • service = new Client.Builder(this).build();

Because I'm using a kinvey.properties file, the initialize() method in my UserLogin activity is:


private void initialize() {
// Enter your app credentials here
service = new Client.Builder(this.getApplicationContext()).build();
}


Thoughts on what's going wrong?

 


I believe that I've accurately followed all of the Android Getting Started steps. I'm trying to just set up the (explicit) login and sign up activities for my Android app. I've never actually tried to log into Kinvey or anything. Again, I'm working off of the code that was is in Kinvey's sample Login app.

 

Before the NPE error in my log console, there's also mention of multidex having problems:

  • 12-31 08:43:59.695 6992-6992/? I/MultiDex: VM has multidex support, MultiDex support library is disabled.


The UserLogin class in Kinvey's sample Login app extends the MultiDexApplication class, so I've done the same for my app's UserLogin class. I've followed all suggestions for enabling multidex found on Stack Overflow posts like this one. Despite implementing all of the suggestions, I still get the "MultiDex support library is disabled" error. 


Yes, my application has the correct name in the Manifest:

<application
android:name="package_name_of_my_app.KinveyMobile.UserLogin"

 




Hi Langston,


This should be solved with the latest release of Android SDK v2.10.11 available for download here: http://devcenter.kinvey.com/android/downloads



Regards,

Wani

Hi,


Do you have "Enforce email verification" enabled in Kinvey console?



Regards,

Wani

Yes, I do have it enabled

Hi Langston,


This is a known issue with the Android SDK.


Android SDK supports signup with username and password. When email verification is turned on, email is also required along with username and password. But, this cannot be passed in Android SDK signup function.


The existing workaround is to disable "Enforce email verification", complete signup with username/password, update email field in the next call and then trigger email verification after that.


Documentation for the required function calls as follows:


I hope this helps.


Regards,
Wani

Langston,


Can you tell me the version of the SDK that you are using? You can find the latest SDK on the following link:

http://devcenter.kinvey.com/android/downloads#


Thanks,

Pranav

Kinvey Support

Hi Pranav,


I'd been using the latest SDK (2.10.10)

When I try to register a new user, I get the following error in my log console:

image


I've had issue after issue in trying to get started with Kinvey. I've found that the Android Getting Started documentation doesn't really match with the sample login app that Kinvey provides nor other documentation on the Kinvey site. Can I hop on the phone with a Kinvey engineer or something? Share my screen so that he/she and I can walk through my Android Studio?


Login or Signup to post a comment