question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[RN0.66][Android] expo-dev-launcher build fails: Using 'of(Map<String, String>): Headers' is an error. function moved to extension

See original GitHub issue

Summary

According to the blog post about expo-dev-client 0.8, React Native 0.66 is supported in bare workflow. However, my android build fails with the following error:

> Task :expo-dev-launcher:compileDebugKotlin FAILED
e: /Users/yonom/Documents/GitHub/test/yonom/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/manifest/DevLauncherManifestParser.kt: (46, 20): Using 'of(Map<String, String>): Headers' is an error. function moved to extension

FAILURE: Build failed with an exception.

Managed or bare workflow? If you have made manual changes inside of the ios/ or android/ directories in your project, the answer is bare!

bare

What platform(s) does this occur on?

Android

Package versions

"expo": "44.0.5",
"expo-dev-client": "0.8.2",
"react-native": "0.66.4",

Environment

  Expo CLI 5.0.3 environment info:
    System:
      OS: macOS 12.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 16.13.2 - /opt/homebrew/opt/node@16/bin/node
      Yarn: 1.22.17 - /opt/homebrew/bin/yarn
      npm: 8.1.2 - /opt/homebrew/opt/node@16/bin/npm
      Watchman: 2022.01.03.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.11.2 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
      Android SDK:
        API Levels: 29, 30, 31
        Build Tools: 29.0.2, 30.0.2, 31.0.0, 32.0.0, 32.0.0
        System Images: android-29 | Google Play ARM 64 v8a
        Android NDK: 22.1.7171670
    IDEs:
      Android Studio: 2020.3 AI-203.7717.56.2031.7935034
      Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~44.0.0 => 44.0.5 
      react: 17.0.1 => 17.0.1 
      react-dom: 17.0.1 => 17.0.1 
      react-native: 0.66.4 => 0.66.4 
      react-native-web: 0.17.1 => 0.17.1 
    npmGlobalPackages:
      eas-cli: 0.45.1
      expo-cli: 5.0.3
    Expo Workflow: bare

Reproducible demo

Run the following commands inside a test directory:

  • expo init yonom --yes
  • cd yonom
  • expo install expo-dev-client
  • expo prebuild
  • yarn install react-native@0.66.4
  • expo run:ios

Result: ❌ Build fails

Stacktrace (if a crash is involved)

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Yonomcommented, Jan 22, 2022

I was able to patch-package this issue:

expo-dev-launcher+0.10.2.patch

diff --git a/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/manifest/DevLauncherManifestParser.kt b/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/manifest/DevLauncherManifestParser.kt
index f34533a..66259e1 100644
--- a/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/manifest/DevLauncherManifestParser.kt
+++ b/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/manifest/DevLauncherManifestParser.kt
@@ -5,6 +5,7 @@ import expo.modules.devlauncher.helpers.await
 import expo.modules.devlauncher.helpers.fetch
 import expo.modules.manifests.core.Manifest
 import okhttp3.Headers
+import okhttp3.Headers.Companion.toHeaders
 import okhttp3.OkHttpClient
 import org.json.JSONObject
 import java.io.Reader
@@ -43,6 +44,6 @@ class DevLauncherManifestParser(
     if (installationID != null) {
       headersMap["expo-dev-client-id"] = installationID
     }
-    return Headers.of(headersMap)
+    return headersMap.toHeaders()
   }
 }
1reaction
lukmccallcommented, Jan 28, 2022

This issue should be fixed by https://github.com/expo/expo/pull/15915. We’ll try to publish that as soon as possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kotlin OkHttp3 Using 'of(Map<String, String>): Headers' is an ...
function moved to extension. val mapH = mapOf (Pair("Content-Disposition", "file; filename=\"$encodedFileName ...
Read more >
The problem with extension functions | by Marcin Moskala
We could make table , div , tr and td member functions, but it is just a different way of specifying the receiver....
Read more >
Kotlin MediaType.parse("something") is an error. moved to ...
Why Kotlin is Propting to create an extension function when set Glide error drawable from resource? Kotlin OkHttp3 Using 'of(Map<String, String>): Headers' is ......
Read more >
Gitiles - GerritHub.io
Record and share your dance moves with motion capture in WebVR. ... core functions on Android, iPhone and Blackberry using ...
Read more >
HTTP errors with Kotlin RX and Retrofit | by Tomasz Janczarski
In his article I will describe several cases of handling HTTP errors that might be encountered in any project and ways of handling...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found