Error Android Device Setup

Hi,

I have the following error when I start the setup without being logged. This error was found using two different devices (galaxy tab api 17, samsung young api 16).
I’m using:

compile 'com.android.support:appcompat-v7:23.1.1’
compile 'com.android.support:design:23.1.1’
compile 'io.particle:cloudsdk:0.3.1’
compile ‘io.particle:devicesetup:0.3.3’

and the error:

FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.hakken.hakken/io.particle.android.sdk.accountsetup.LoginActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2114)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2139)
at android.app.ActivityThread.access$700(ActivityThread.java:143)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1241)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4963)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at io.particle.android.sdk.utils.ui.ParticleUi.enableBrandLogoInverseVisibilityAgainstSoftKeyboard(ParticleUi.java:23)
at io.particle.android.sdk.accountsetup.LoginActivity.onCreate(LoginActivity.java:56)
at android.app.Activity.performCreate(Activity.java:5184)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2078)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2139)
at android.app.ActivityThread.access$700(ActivityThread.java:143)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1241)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4963)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)

Apparently the error is in:
ParticleUi.enableBrandLogoInverseVisibilityAgainstSoftKeyboard(this);

Note: I am using OAuth credentials

I really appreciate any help you can provide.

Wow, that’s a strange one. Given what it’s doing and where, this may be a Samsung-specific bug. Do you have any non-Samsung devices to try to see if you can repro this on other devices?

Thanks for your answer.
After a day reviewing this error I found the cause. I have a login activity (LoginServerActivity) that uses the resource activity_login.xml in my Android application. Inspecting Device Setup Java SDK “LoginActivity.java” I found that uses the same name for the layout resource “activity_login”. After rename my layout resource to “activity_server_login” the error was solved.

What do you think about it, I should be careful with the names of the layout resources?

Cheers

Nice catch! This is something I’ve been meaning to fix on my end actually, to make the resource files that are supposed to be internal to the SDK actually private using the new private resource features in the new Android Gradle plugin. I’ll see if I can do this for the next release.