HMS-Core / hms-mapkit-demo

HMS Map Kit demo provides an example of intergrating HMS Map Android SDK. Personalizing how your map displays and interacts with your users tailors their experience to them
https://developer.huawei.com/consumer/en/hms/huawei-MapKit?ha_source=hms1
Apache License 2.0
115 stars 43 forks source link

java.lang.NullPointerException #19

Open GulmirzaNorboyev opened 1 year ago

GulmirzaNorboyev commented 1 year ago
java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File android.content.Context.getFilesDir()' on a null object reference

at com.huawei.hms.maps.provider.util.mai.a(Unknown Source:14)
at com.huawei.hms.maps.provider.huawei.SupportMapFragmentImpl.a(Unknown Source:16)
at com.huawei.hms.maps.provider.huawei.SupportMapFragmentImpl.<init>(Unknown Source:5)
at com.huawei.hms.maps.provider.huawei.SupportMapFragmentImpl.<init>(Unknown Source:1)
at com.huawei.hms.maps.CreatorImpl.newMapFragmentDelegate(Unknown Source:11)
at com.huawei.hms.maps.internal.mac$maa.onTransact(Unknown Source:422)
at android.os.Binder.transact(Binder.java:921)
at com.huawei.hms.maps.mae.a(Unknown Source:28)
at com.huawei.hms.maps.internal.mad$maa$maa.a(Unknown Source:13)
at com.huawei.hms.maps.SupportMapFragment$maa.a(Unknown Source:17)
at com.huawei.hms.maps.SupportMapFragment$maa.a(Unknown Source:53)
at com.huawei.hms.maps.maa$maa.a(Unknown Source:25)
at com.huawei.hms.maps.maa$maa.accept(Unknown Source:2)
at ij.c.e(LambdaObserver.java:9)
at mj.d.c(HalfSerializer.java:15)
at jj.g$a.e(ObservableRetryWhen.java:5)
at jj.f$a.i(ObservableObserveOn.java:48)
at jj.f$a.run(ObservableObserveOn.java:9)
at aj.d$b.run(HandlerScheduler.java:3)
at android.os.Handler.handleCallback(Handler.java:900)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:219)
at android.app.ActivityThread.main(ActivityThread.java:8668)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)

Hello Huawei team! I'm getting this error, I don't know how to solve it, I can't find these classes in dependencies, please help me!

xuxiapu commented 1 year ago

@GulmirzaNorboyev Dear developer,

Please confirm the following questions:

  1. For unknown source problems, please check whether confusion is enabled. If confusion is enabled, please add a confusion rule script; image

  2. For the error of null pointer, please check whether there is any key information in these two lines of code. image

GulmirzaNorboyev commented 1 year ago

@GulmirzaNorboyev Dear developer,

Please confirm the following questions:

  1. For unknown source problems, please check whether confusion is enabled. If confusion is enabled, please add a confusion rule script; image
  2. For the error of null pointer, please check whether there is any key information in these two lines of code. image
  1. I can't find the classes in the com.huawei.hms.maps.provider.* package, the solution I did now was to add this line to the proguard file: -keep class com.huawei.hms.maps.**{*;}
  2. I couldn't find these classes either. ☹️
xuxiapu commented 1 year ago

@GulmirzaNorboyev Dear developer, Can you solve the problem of Unknown Source after adding the "- keep class com. huawei. hms. maps. {*;}" confusion script? In addition, "ij.c.e mj.d.c jjj.g $a.e" and other items are not the package names of HMS Core, which may need you to look again.