【问题标题】:react-native Cannot find cannot find symbol Freshchat after upgrading react-native-freshchat-sdkreact-native Cannot find 升级react-native-freshchat-sdk后找不到符号Freshchat
【发布时间】:2023-01-05 23:37:25
【问题描述】:

我将 freshchat 从 "react-native-freshchat-sdk": "^2.6.4" 升级到 "react-native-freshchat-sdk": "^4.0.3" 并尝试运行 android 应用程序但构建失败并出现错误

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

【问题讨论】:

    标签: react-native freshdesk


    【解决方案1】:

    在深入了解 Freshworks and roid Github 之后,我不得不更新我的 App Module gradle 文件 (app/build.gradle) 以将 freshdesk:freshchat 包含在这样的依赖项中

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

    【讨论】:

    • 我面临同样的问题,但单独添加这一行似乎并不能为我解决问题。你用的是什么版本的gradle?
    【解决方案2】:
    ...
    implementation (project(':react-native-freshchat-sdk')){
        exclude group: 'com.github.freshworks'
    }
    implementation 'com.github.freshdesk:freshchat-android:5.3.3'
    

    【讨论】:

      猜你喜欢
      • 2019-11-18
      • 2018-09-07
      • 1970-01-01
      • 2020-05-21
      • 2022-08-02
      • 1970-01-01
      • 2019-11-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多