Start a new topic
Answered

Java Error

There is some error when I try to link my app to Kinvey. It keeps saying 'unhandled exception: java.io.IOException'. Anyone know anything about this?


UserStore.login(email, password, getClient(), new KinveyClientCallback<User>() {
@Override
public void onSuccess(User user) {
Intent intent = new Intent(LoginActivity.this,HomeActivity.class);
startActivity(intent);
Toast.makeText(LoginActivity.this, "Hooray! Welcome!", Toast.LENGTH_SHORT).show();
finish();
}
@Override
public void onFailure(Throwable throwable) {
// Place your error handler here
}
});
jpg

Best Answer

Pivovex,


In Java, you have 2 types of Exceptions:

  1. Exception: they are checked
  2. Runtime exceptions: not checked


When a method can trigger a "checked" exception, you have to handle it - try catch block. In your case, IOException is a "checked" exception.


I am still working on it and get back to you once I have more information.


Thanks,

Pranav

Kinvey



Hello Pixovex,


I have approved your two posts and someone will engage with you as soon as possible to help you work through this issue.


Regards,


Billy Gee

Thank You

Answer

Pivovex,


In Java, you have 2 types of Exceptions:

  1. Exception: they are checked
  2. Runtime exceptions: not checked


When a method can trigger a "checked" exception, you have to handle it - try catch block. In your case, IOException is a "checked" exception.


I am still working on it and get back to you once I have more information.


Thanks,

Pranav

Kinvey



1 person likes this

Thanks for your help, also i am thinking something is wrong with this code that causes that error. I thought this might help you figure out the issue, thanks

package com.pixovex.carpoolapp;

import android.app.Application;

import com.kinvey.android.Client;

public class MainApplication extends Application{

private Client myKinveyClient;

@Override
public void onCreate() {
super.onCreate();
myKinveyClient = new Client.Builder("Key","Secret"
, this.getApplicationContext()).build();
}
public Client getKinveyClient(){
return myKinveyClient;
}

}

Find anything yet?

Pivovex,


A new version of the Android SDK v3.0.3 is available for download. You can find it at the following URL:


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


Please upgrade to the latest SDK and let me know if it solves the issue.

Thanks,
Pranav
Kinvey

Thank you, your first response worked fine

Login or Signup to post a comment