HMS-Core / hms-react-native-plugin

This repo contains all of React-Native HMS plugins.
https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1
Apache License 2.0
245 stars 68 forks source link

[react-native-hms-push] app crashed with java.lang.NoClassDefFoundError: Failed resolution of: Lcom/huawei/hms/hatool/r; #161

Closed Strate closed 2 years ago

Strate commented 2 years ago

Description Calling HmsPushInstanceId.getToken("") causes app to crash. Tested on real Huawei mobile phone without Google Play Services installed

Expected behavior App dont crash

Current behavior App crashed with:

E/AndroidRuntime: FATAL EXCEPTION: pool-35-thread-1
    Process: com.chatium.app, PID: 20847
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/huawei/hms/hatool/r;
        at com.huawei.hms.hatool.v.a(Unknown Source:35)
        at com.huawei.hms.hatool.b1.a(Unknown Source:7)
        at com.huawei.hms.hatool.u.d(Unknown Source:10)
        at com.huawei.hms.hatool.u.a(Unknown Source:55)
        at com.huawei.hms.hatool.t.a(Unknown Source:114)
        at com.huawei.hms.hatool.t.a(Unknown Source:126)
        at com.huawei.hms.hatool.k0.a(Unknown Source:19)
        at com.huawei.hms.hatool.k0.run(Unknown Source:144)
        at com.huawei.hms.hatool.n0$a.run(Unknown Source:4)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:929)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.huawei.hms.hatool.r" on path: DexPathList[[zip file "/data/app/com.chatium.app-RxZETNbaPdotevSHc_-PYw==/base.apk"],nativeLibraryDirectories=[/data/app/com.chatium.app-RxZETNbaPdotevSHc_-PYw==/lib/arm64, /data/app/com.chatium.app-RxZETNbaPdotevSHc_-PYw==/base.apk!/lib/arm64-v8a, /system/lib64, /hw_product/lib64, /system/product/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:209)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at com.huawei.hms.hatool.v.a(Unknown Source:35) 
        at com.huawei.hms.hatool.b1.a(Unknown Source:7) 
        at com.huawei.hms.hatool.u.d(Unknown Source:10) 
        at com.huawei.hms.hatool.u.a(Unknown Source:55) 
        at com.huawei.hms.hatool.t.a(Unknown Source:114) 
        at com.huawei.hms.hatool.t.a(Unknown Source:126) 
        at com.huawei.hms.hatool.k0.a(Unknown Source:19) 
        at com.huawei.hms.hatool.k0.run(Unknown Source:144) 
        at com.huawei.hms.hatool.n0$a.run(Unknown Source:4) 

Environment

peltax commented 2 years ago

Did you add proguard rules (if any) and followed installation steps in documentation? I'll be trying this library in near future, will post results.

Strate commented 2 years ago

@peltax i dont use Proguard at all

ozcanozgur commented 2 years ago

Hi @All,

Latest version of React Native Push Kit has been released. We could not reproduce this error with our demo project.

Please test it again with the latest version, if the issue persist, contact us here. The other packages can cause this error. You can share with us a demo project or more information to help reproduce the error.

Thank you for your interest.