Anjayluh
Anjayluh

Reputation: 1786

react-native Cannot find cannot find symbol Freshchat after upgrading react-native-freshchat-sdk

I upgraded freshchat from "react-native-freshchat-sdk": "^2.6.4" to "react-native-freshchat-sdk": "^4.0.3" and tried running the android app but the build failed with error

Compatible side by side NDK version was not found for android.ndkVersion '22.1.7171670'

> Task :app:compileDebugJavaWithJavac

> Task :app:compileDebugJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
500 actionable tasks: 6 executed, 494 up-to-date
/Users/angellanaigaga/Desktop/numida/trackapp/frontend/trackapp-native/android/app/src/main/java/com/numidatech/numida/NumidaMessagingService.java:3: error: cannot find symbol
import com.freshchat.consumer.sdk.Freshchat;
                                 ^
  symbol:   class Freshchat
  location: package com.freshchat.consumer.sdk
/Users/angellanaigaga/Desktop/numida/trackapp/frontend/trackapp-native/android/app/src/main/java/com/numidatech/numida/NumidaMessagingService.java:11: error: cannot find symbol
    if (Freshchat.isFreshchatNotification(message)) {
        ^
  symbol:   variable Freshchat
  location: class NumidaMessagingService
/Users/angellanaigaga/Desktop/numida/trackapp/frontend/trackapp-native/android/app/src/main/java/com/numidatech/numida/NumidaMessagingService.java:12: error: cannot find symbol
      Freshchat.handleFcmMessage(this.getApplicationContext(), message);
      ^
  symbol:   variable Freshchat
  location: class NumidaMessagingService
Note: /Users/angellanaigaga/Desktop/numida/trackapp/frontend/trackapp-native/android/app/src/debug/java/com/numidatech/numida/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 30s

Upvotes: 1

Views: 671

Answers (2)

devmod
devmod

Reputation: 1

...
implementation (project(':react-native-freshchat-sdk')){
    exclude group: 'com.github.freshworks'
}
implementation 'com.github.freshdesk:freshchat-android:5.3.3'

Upvotes: 0

Anjayluh
Anjayluh

Reputation: 1786

After digging into the Freshworks and roid Github, I had to update my App Module gradle file (app/build.gradle) to include freshdesk:freshchat in dependencies like this

dependencies {
    implementation 'com.github.freshdesk:freshchat-android:{latestVersion}'
}

Upvotes: 0

Related Questions