Repository: datadog/dd-sdk-reactnative
Issue: Cannot access 'request': it is package-private in 'Response'

Thanks for taking the time for reporting an issue!

**Describe what happened**
Include any error message or stack trace if available.

> Task :datadog_mobile-react-native:compileDebugKotlin FAILED
e: [REDACTED]/node_modules/@datadog/mobile-react-native/android/src/main/kotlin/com/datadog/reactnative/ProxyAuthenticator.kt: (21, 43): Cannot access 'code': it is package-private in 'Response'
e: [REDACTED]/node_modules/@datadog/mobile-react-native/android/src/main/kotlin/com/datadog/reactnative/ProxyAuthenticator.kt: (26, 54): Cannot access 'code': it is package-private in 'Response'
e:[REDACTED]/node_modules/@datadog/mobile-react-native/android/src/main/kotlin/com/datadog/reactnative/ProxyAuthenticator.kt: (34, 36): Cannot access 'scheme': it is private in 'Challenge'
e: [REDACTED]/node_modules/@datadog/mobile-react-native/android/src/main/kotlin/com/datadog/reactnative/ProxyAuthenticator.kt: (41, 31): Function invocation 'charset()' expected
e:[REDACTED]/node_modules/@datadog/mobile-react-native/android/src/main/kotlin/com/datadog/reactnative/ProxyAuthenticator.kt: (43, 33): Cannot access 'request': it is package-private in 'Response'


**Steps to reproduce the issue:**
Trying to upgrade from 1.0.0-rc5 to 1.1.1 
**Describe what you expected:**
to upgrade

**Additional context**
    - Version of the SDK
    - A copy of your `package.json` file
{
  "name": "terminal",
  "version": "1.0.0",
  "main": "index.js",
  "private": true,
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "test": "jest --detectOpenHandles --forceExit",
    "test:dev": "jest --watch",
    "test:debug": "node --inspect node_modules/.bin/jest --runInBand",
    "test:types": "tsc --project . --noEmit",
    "get-en-locale": "node ./scripts/get-en-locale.js",
    "expo-publish": "node ./scripts/publish-app.js",
    "postinstall": "node ./scripts/postinstall.js",
    "ios": "expo run:ios"
  },
  "workspaces": {
    "packages": [
      "apps/*",
      "packages/*"
    ]
  },
  "dependencies": {
    "@datadog/mobile-react-native": "1.1.1",
    "@datadog/mobile-react-navigation": "1.1.1",
    "@formatjs/intl-datetimeformat": "^5.0.0",
    "@formatjs/intl-getcanonicallocales": "^1.9.0",
    "@formatjs/intl-locale": "^2.4.45",
    "@formatjs/intl-numberformat": "^7.4.2",
    "@formatjs/intl-pluralrules": "^4.3.2",
    "@react-native-async-storage/async-storage": "~1.15.0",
    "@react-native-community/datetimepicker": "4.0.0",
    "@react-native-community/netinfo": "6.0.0",
    "@react-native-community/slider": "4.1.12",
    "@react-native-picker/picker": "2.2.1",
    "@react-navigation/drawer": "6.4.1",
    "@react-navigation/native": "6.0.10",
    "@react-navigation/native-stack": "6.6.2",
    "axios": "0.26.0",
    "expo": "44.0.6",
    "expo-application": "4.0.2",
    "expo-av": "~10.2.0",
    "expo-constants": "~13.0.1",
    "expo-device": "~4.1.0",
    "expo-file-system": "14.1.0",
    "expo-splash-screen": "~0.14.1",
    "expo-status-bar": "~1.2.0",
    "expo-updates": "~0.11.7",
    "immer": "^9.0.12",
    "moment": "^2.24.0",
    "moment-timezone": "^0.5.27",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-native": "0.64.3",
    "react-native-android-open-settings": "^1.3.0",
    "react-native-device-info": "~8.5.0",
    "react-native-dotenv": "^3.3.1",
    "react-native-elements": "3.4.2",
    "react-native-gesture-handler": "~2.1.0",
    "react-native-launch-arguments": "^2.0.1",
    "react-native-modal": "13.0.1",
    "react-native-notification-sounds": "0.5.4",
    "react-native-reanimated": "~2.3.1",
    "react-native-safe-area-context": "3.3.2",
    "react-native-screens": "~3.10.1",
    "react-native-signalr": "^1.0.6",
    "react-native-web": "0.17.1",
    "react-redux": "8.0.1",
    "redux": "4.2.0",
    "redux-act": "1.8.0",
    "redux-saga": "1.1.3",
    "redux-thunk": "2.4.1",
    "reselect": "4.1.5",
    "rn-escpos": "*",
    "rn-sunmi": "*",
    "string-width": "^4.2.0"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@testing-library/react-native": "^10.1.1",
    "@types/expo": "33.0.1",
    "@types/jest": "27.5.1",
    "@types/lodash": "4.14.182",
    "@types/react": "17.0.21",
    "@types/react-dom": "17.0.2",
    "@types/react-native": "0.67.7",
    "@types/react-redux": "7.1.24",
    "@types/react-test-renderer": "18.0.0",
    "@types/signalr": "2.2.37",
    "babel-plugin-transform-remove-console": "6.9.4",
    "jest": "^28.1.2",
    "jest-expo": "^44.0.0",
    "prettier": "2.5.1",
    "react-native-flipper": "^0.137.0",
    "react-test-renderer": "17.0.2",
    "redux-devtools-extension": "^2.13.8",
    "redux-flipper": "^2.0.1",
    "redux-saga-test-plan": "4.0.5",
    "typescript": "4.6.4"
  },
  "resolutions": {
    "react": "17.0.2",
    "typescript": "4.6.4"
  }
}



Changed files:
packages/core/android/src/main/kotlin/com/datadog/reactnative/ProxyAuthenticator.kt

diff --git a/packages/core/android/src/main/kotlin/com/datadog/reactnative/ProxyAuthenticator.kt b/packages/core/android/src/main/kotlin/com/datadog/reactnative/ProxyAuthenticator.kt
index c0f803b..99476ad 100644
--- a/packages/core/android/src/main/kotlin/com/datadog/reactnative/ProxyAuthenticator.kt
+++ b/packages/core/android/src/main/kotlin/com/datadog/reactnative/ProxyAuthenticator.kt
@@ -18,12 +18,12 @@ internal class ProxyAuthenticator(
     internal val password: String
 ) : Authenticator {
     override fun authenticate(route: Route?, response: Response): Request? {
-        val proxyAuthorization = response.code == PROXY_AUTHORIZATION_REQUIRED_STATUS_CODE
+        val proxyAuthorization = response.code() == PROXY_AUTHORIZATION_REQUIRED_STATUS_CODE
 
         if (!proxyAuthorization) {
             Log.w(
                 ProxyAuthenticator::class.java.canonicalName,
-                "Unexpected response code=${response.code}" +
+                "Unexpected response code=${response.code()}" +
                     " received during proxy authentication request."
             )
             return null
@@ -31,16 +31,16 @@ internal class ProxyAuthenticator(
 
         val challenges = response.challenges()
         for (challenge in challenges) {
-            val scheme = challenge.scheme
+            val scheme = challenge.scheme()
             if ("Basic".equals(scheme, ignoreCase = true) ||
                 "OkHttp-Preemptive".equals(scheme, ignoreCase = true)
             ) {
                 val credential = Credentials.basic(
                     username,
                     password,
-                    challenge.charset
+                    challenge.charset()
                 )
-                return response.request.newBuilder()
+                return response.request().newBuilder()
                     .header("Proxy-Authorization", credential)
                     .build()
             }