java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
when I add this party to my oncreate()
Context context = getApplicationContext();
I am getting a null pointer exception on this line
Configuration.Builder builder = new Configuration.Builder(context);
What is the stack trace?
how do i get that?
What is the error message you're getting?
E/AndroidRuntime: FATAL EXCEPTION: main
Process: reboot.grouper, PID: 8958
java.lang.RuntimeException: Unable to start activity ComponentInfo{reboot.grouper/reboot.grouper.UI.Lists}: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
at co.chatsdk.core.session.Configuration$Builder.firebase(Configuration.java:158)
at co.chatsdk.core.session.Configuration$Builder.configureFromManifest(Configuration.java:371)
at co.chatsdk.core.session.Configuration$Builder.<init>(Configuration.java:116)
at reboot.grouper.UI.Lists.onCreate(Lists.java:101)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I am trying to create a single chat instance using this
NM.publicThread().createPublicThreadWithName(threadName)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BiConsumer<Thread, Throwable>() {
@Override
public void accept(Thread thread, Throwable throwable) throws Exception {
if(throwable == null) {
InterfaceManager.shared().a.startChatActivityForID(getContext(), thread.getEntityID());
}
else {
// Handle error
}
});
so do still have to initialize the sdk in oncreate() to do this
I think you need to add this to your App manifest:
<meta-data android:name="firebase_root_path" android:value="@string/firebase_root_path" />
To your strings file:
<string name="firebase_root_path"></string>
This is a bug which will be fixed in tomorrows release.
You always have to initialize the Chat SDK and authenticate the user before you use any other Chat SDK functions. Important functions are performed during setup so it can't be skipped.
still getting the same error on
Configuration.Builder builder = new Configuration.Builder(context);
Can you try this again with the latest version - 4.0.6?
Closing due to inactivity.