Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infobip react native sdk update Issue #33

Closed
Rohit-Surawat opened this issue Dec 30, 2021 · 22 comments
Closed

Infobip react native sdk update Issue #33

Rohit-Surawat opened this issue Dec 30, 2021 · 22 comments

Comments

@Rohit-Surawat
Copy link

Rohit-Surawat commented Dec 30, 2021

Hi All,

We are facing issue related to infobip sdk update, because of that we are facing multiple issue,

Existing Version: 2.2.0
Target Version :4.1.4

Current Implementation:

We have both android sdk and react native plugin in place for info bip notification handling.

  1. Infobip there is a module created in android which handles the saving user data, login, logout and handle push notifications.
  2. React native side it takes care of deep linking and routing in our application based on the notification type.

Now problem is when i upgrade there is conflict between 5.3.6 android sdk runtime which installed along with react native plugin and android sdk for infobip 4.0.2

tried upgrading the native sdk to 5.3.6 didn't help throws unable to resolve module.

Any help or guidance will be a great help
For more info please feel free to comment
Thanks & Regards
Rohit

@kostap13
Copy link

Hi @Rohit-Surawat
Could you please provide more details about yours environment?

RN version, node version etc.

@kostap13
Copy link

And also one other question

We have both android sdk and react native plugin in place for info bip notification handling.:
Why do need such solution?

Maybe RN plugin 4.1.4 will cover all yours requirements?

@riskpp
Copy link
Contributor

riskpp commented Jan 11, 2022

Hello @Rohit-Surawat,
Could be that Mobile Messaging react-native plugin can cover all your requirements

  • Saving user data, personalize, depersonalize - Personalization
  • Handling push notifications - "messageReceived", "notificationTapped" events - Library Events

Usage of the native SDK together with react-native plugin it's rarely seen use case, but we will try to reproduce the issue, could you please provide your versions (react-native version, node version), it'll help us to return with solution faster.

@Rohit-Surawat
Copy link
Author

Hi @riskpp @kostap13 Sorry for delay in response ,
Let me provide you detail explanation,

We have native implementation in place for Android OS in our react native application.

Current Build Gradle Of Android :
org.infobip.mobile.messaging.api:infobip-mobile-messaging-android-sdk:4.0.2@aar

React Native Plugin Version :
"infobip-mobile-messaging-react-native-plugin": "2.2.0",

Now when i update to latest version
android:
com.infobip:infobip-mobile-messaging-android-sdk:5.3.6@aar

react native version
"infobip-mobile-messaging-react-native-plugin": "4.1.6',

Application is. not starting at all getting following stack trace:
java.lang.RuntimeException: Unable to create application
java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5743)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created
at com.facebook.react.devsupport.b.a(SourceFile:90)
at com.facebook.s0.p.(SourceFile:245)
at com.facebook.s0.q.b(SourceFile:287)
at com.facebook.s0.s.a(SourceFile:89)
at com.facebook.s0.s.i(SourceFile:39)
at MainApplication.onCreate(SourceFile:74)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5740)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.ClassNotFoundException: com.facebook.react.devsupport.DevSupportManagerImpl
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at com.facebook.react.devsupport.b.a(SourceFile:68)
at com.facebook.s0.p.(SourceFile:245)
at com.facebook.s0.q.b(SourceFile:287)
at com.facebook.s0.s.a(SourceFile:89)
at com.facebook.s0.s.i(SourceFile:39)
at MainApplication.onCreate(SourceFile:74)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5740)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.react.devsupport.DevSupportManagerImpl" on path: DexPathList[[zip file "/data/a
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

Already have multidex enabled true for the application also okhttp client is excluded from flipper for api level 21

@riskpp
Copy link
Contributor

riskpp commented Jan 21, 2022

Hi @Rohit-Surawat,
Could you please check that you can't use just react-native plugin, without native sdk? As I mentioned above plugin has all features, which exist in native sdk.

Which react-native version is used in your project? could you please try to upgrade to latest supported by our plugin - 0.66.3

BR, Olga

@Rohit-Surawat
Copy link
Author

Rohit-Surawat commented Jan 21, 2022

Hi @riskpp ,
Thank you for swift response and paying attention to this issue.

Current React Native Version in our application : 0.65.1
Now after updating the Infobip version to 4.1.6 and adding few changes in proguard rules ,
Above crash (error) is gone but getting new error :
Invariant Violation: “appName” has not been registered

But the app name returned by android native code and the name during app registry is same

@agupta-avenir
Copy link

@riskpp Any update on this issue. We are struggling to update the infobip version in our App from 2.2.0 -> 4.1.6
This is some more details of the error:
ERROR Invariant Violation: "appName" has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and AppRegistry.registerComponent wasn't called.

@agupta-avenir
Copy link

@riskpp Just an update we were successfully able to update to 4.0.0 but facing issue with v4.1.6 update

@agupta-avenir
Copy link

@kas-kad If you can throw some light on this issue as well will be great.

@riskpp
Copy link
Contributor

riskpp commented Feb 3, 2022

Hi @agupta-avenir, sorry for delay in the answer
Could you please send your proguard rules file, could be somehow related with the issue..
I've check for the following environment:

  • mobile-messaging plugin version 4.1.6
  • react-native: 0.65.1
  • node: 17.0.1
  • Android Studio Arctic Fox | 2020.3.1 Patch 2
    that simple application created by command react-native init TestRN65_1 --version 0.65.1 is working fine on Android.

@agupta-avenir
Copy link

agupta-avenir commented Feb 3, 2022

Here it is:
proguard-rules.txt

@riskpp
Copy link
Contributor

riskpp commented Feb 3, 2022

With provided proguard rules I also got error from this comment, but managed to solve it using this solution. Looks not related to mobile-messaging plugin.

For mobile-messaging plugin in pro-guard only this is needed:

# Application classes that will be serialized/deserialized over Gson
-keep class org.infobip.reactlibrary.mobilemessaging.Configuration* { *; }
-keep class org.infobip.reactlibrary.mobilemessaging.CacheManager* { *; }

@agupta-avenir
Copy link

I tried these steps but still the same. Issue is after upgrading to version 4.1.6 or 4.1.3 the react-native-config library is not loading up and thus App is not able to launch. Not sure what is causing this but only after updating infobip version we are getting this. We have updated till 4.0.0.

D/ReactNative: ReactConfig: Could not find BuildConfig class

@riskpp
Copy link
Contributor

riskpp commented Feb 3, 2022

@agupta-avenir I see in provided proguard rules:

-keep class com.mypackage.BuildConfig { *; }

Do you have package named "com.mypackage"? It should be changed to your package name. "ReactConfig: Could not find BuildConfig class" issue could be related to this.

@agupta-avenir
Copy link

@riskpp Not sure if this is impacting but til version 4.0.0 its working with the same code base.

@riskpp
Copy link
Contributor

riskpp commented Feb 7, 2022

Hi @agupta-avenir, could you please try to change in your proguard rules package name to real one?
Would be great to have minimal example with which we can reproduce the issue, note that we already tried minimal react-native application with your environment and unfortunately can't reproduce the issue.

BR, Olga

@agupta-avenir
Copy link

@riskpp Finally able to fix the issue. Yes it was due to proguard config. Thanks a lot for help and support.
We just got into another issue after updating the sdk where on iOS debugging has stopped working. Any help on that would be great.

@riskpp
Copy link
Contributor

riskpp commented Feb 14, 2022

Hi @agupta-avenir , great that you managed to solve the initial problem!
Could you please clarify, which debugging doesn't work on iOS? Do you mean flipper or debugging through xCode?

@imkrishh
Copy link

@riskpp with infobip 4.1.6 version the Initialize method (mobileMessaging.init) in iOS is crashing in chrome debug mode.

React Native Version 0.65.1
MobileMessaging Version 9.2.11 (was 9.1.10)
infobip-mobile-messaging-react-native-plugin 4.1.6 (was 4.0.0)

Simulator Screen Shot infobip init crash

@riskpp
Copy link
Contributor

riskpp commented Feb 17, 2022

Hi @imkrishh, we started working on it, will inform you about fix

@riskpp
Copy link
Contributor

riskpp commented Feb 17, 2022

Should be fixed with new version - 5.0.1

@riskpp
Copy link
Contributor

riskpp commented Mar 21, 2022

Was fixes in latest version

@riskpp riskpp closed this as completed Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants