tuya / tuya-home-android-sdk-sample-kotlin

This sample is designed to help developers learn more about how to use the features of Tuya Smart Life App SDK for Android.
https://developer.tuya.com/en/docs/app-development/android-app-sdk/featureoverview?id=Ka69nt97vtsfu
MIT License
32 stars 23 forks source link

java.lang.NullPointerException with firebase-performance #25

Closed Alex9992099300 closed 1 year ago

Alex9992099300 commented 1 year ago

Describe the bug EXCEPTION when add plugin id("com.google.firebase.firebase-perf")

   Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'com.thingclips.smart.p2p.toolkit.api.ILog com.thingclips.smart.p2p.toolkit.api.IBuilder.getILog()' on a null object reference
                    at com.thingclips.smart.p2p.load.ThingP2PLoadManager.invokeEvent(Unknown Source:2)
                    at com.thingclips.smart.framework.router.SchemeServiceImpl.sendEvent(SchemeServiceImpl.java:198)
                    at com.thingclips.smart.api.router.UrlRouter.sendEvent(UrlRouter.java:156)
                    at com.thingclips.smart.wrapper.api.ThingWrapper.onLogin(ThingWrapper.java:139)
                    at io.fasthome.sls.App.initReact(App.kt:184)
                    at io.fasthome.sls.App.onCreate(App.kt:128)
                    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1212)
                    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7106)
                    at android.app.ActivityThread.access$1600(ActivityThread.java:273) 
                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2127) 
                    at android.os.Handler.dispatchMessage(Handler.java:106) 
                    at android.os.Looper.loopOnce(Looper.java:210) 
                    at android.os.Looper.loop(Looper.java:299) 
                    at android.app.ActivityThread.main(ActivityThread.java:8337) 
                    at java.lang.reflect.Method.invoke(Native Method) 
                    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) 
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1037) 

To Reproduce Steps to reproduce the behavior: Happened during open Application

Smartphone (please complete the following information):

SDK: tuya = "5.1.0" bizbundle = "5.2.0-11"

taojingGino commented 1 year ago

ThingSmartSdk.init(this); Check if there is initialization before logging in This problem seems to be due to the plugin not being loaded into @Alex9992099300

Alex9992099300 commented 1 year ago

Yes, FirebaseApp.initializeApp(this) before initialization Tuya fixed it , Thanks

zlinoliver commented 1 year ago

@Alex9992099300 thanks for the feedback! As this issue is resolved, will close it now.