teprinciple / UpdateAppUtils

一行代码快速实现app版本更新
1.09k stars 223 forks source link

我的组件化项目,在非主app中调用 比如在我的模块调用,会发现 globalContext=null #84

Open GHHMBird opened 3 years ago

GHHMBird commented 3 years ago

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference at android.content.ComponentName.(ComponentName.java:130) at android.content.Intent.(Intent.java:6107) at ui.UpdateAppActivity$Companion.launch(UpdateAppActivity.kt:315) at update.UpdateAppUtils.update(UpdateAppUtils.kt:127) at hhm.android.my.AboutUsActivity$onCreate$2.onMultiClick(AboutUsActivity.kt:64) at hhm.android.library.utils.OnMultiClickListener.onClick(OnMultiClickListener.java:18) at android.view.View.performClick(View.java:6614) at android.view.View.performClickInternal(View.java:6587) at android.view.View.access$3100(View.java:787) at android.view.View$PerformClick.run(View.java:26122) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:201) at android.app.ActivityThread.main(ActivityThread.java:6820) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:922)