expo: expo-modules-core can't run Gradle task downloadBoost

Summary

When building a project with the latest version of expo (that uses expo-modules-core), the task :expo-modules-core:downloadBoost fails with:

Execution failed for task ':expo-modules-core:downloadBoost'.
> A failure occurred while executing de.undercouch.gradle.tasks.download.internal.DefaultWorkerExecutorHelper$DefaultWorkAction
   > javax.net.ssl.SSLPeerUnverifiedException: Certificate for <jfrog-prod-usw2-shared-oregon-main.s3.amazonaws.com> doesn't match any of the subject alternative names: [*.s3.amazonaws.com, s3.amazonaws.com]

What platform(s) does this occur on?

Android

Environment

expo-env-info 1.0.5 environment info:
    System:
      OS: Windows 10 10.0.22621
    Binaries:
      Node: 16.18.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
      npm: 7.11.2 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      expo: ^47.0.13 => 47.0.13
      react: 18.2.0 => 18.2.0
      react-native: 0.70.6 => 0.70.6
    Expo Workflow: bare

Minimal reproducible example

A project being upgraded from RN 0.69.3 (using an old version of expo without expo-modules-core) to RN 0.70.6 with the latest expo version.

EDIT: Now we’ve learned the problem is actually adding the kotlin-gradle-plugin with a version higher than 1.6.x (e.g. 1.7.x or 1.8.x) to the project android/build.gradle (for example, when following guides for react-native-navigation or Detox)

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 3
  • Comments: 37 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@Kudo Unfortunately I have the same issue and this solution doesn’t work for me, I already have 4.1.2 version in expo-modules core. Didn’t change anything in project last one week but have this errors now. Screenshot 2023-01-18 at 10 08 18

got the exact same error too, 3 days ago i was able to build my app, today the error appear when i try to rebuild

Hi, do we have any news on that fix? We need to use kotlin 1.9.0 for a library so I can’t downgrade it. Tried to change the de.undercouch:gradle-download-task version but nothing works

I solved the problem with kotlin_version=1.7.0

android/build.gradle:

buildscript{
    ext {
        buildToolsVersion = "33.0.1"
        minSdkVersion = 21
        compileSdkVersion = 33
        targetSdkVersion = 33
        kotlin_version = "1.7.0"

        if (System.properties['os.arch'] == "aarch64") {
            ndkVersion = "24.0.8215888"
        } else {
            ndkVersion = "21.4.7075529"
        }
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:7.2.1")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("de.undercouch:gradle-download-task:5.0.1")
    }
}

@thanksyouall you are right for the official docs. i should investigate more for the root cause.

the download-plugin will be removed in expo-modules-core in the future. in the meantime as a workaround, you can downgrade the download-plugin.

diff --git a/node_modules/expo-modules-core/android/build.gradle b/node_modules/expo-modules-core/android/build.gradle
index e0dfb67..27dfe59 100644
--- a/node_modules/expo-modules-core/android/build.gradle
+++ b/node_modules/expo-modules-core/android/build.gradle
@@ -35,7 +35,7 @@ buildscript {
 
   dependencies {
     classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
-    classpath("de.undercouch:gradle-download-task:5.3.0")
+    classpath("de.undercouch:gradle-download-task:4.1.2")
   }
 }
 

@thanksyouall If you need to at least build the app, you can:

  • Go to node_modules/expo-modules-core/android/build.gradle and change the downloadBoost task to begin with enabled = false (maybe even create a patch for it with patch-package), like:
def downloadBoost = tasks.create('downloadBoost', Download) {
  enabled = false                                  //  --------> Add this line
  dependsOn(createNativeDepsDirectories)
  def srcUrl = REACT_NATIVE_TARGET_VERSION >= 69
    ? "https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION.replace("_", ".")}/source/boost_${BOOST_VERSION}.tar.gz"
    : "https://github.com/react-native-community/boost-for-react-native/releases/download/v${BOOST_VERSION.replace("_", ".")}-0/boost_${BOOST_VERSION}.tar.gz"
  src(srcUrl)
  onlyIfNewer(true)
  overwrite(false)
  dest(new File(downloadsDir, "boost_${BOOST_VERSION}.tar.gz"))
}
  • Then manually download boost from https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz and place it under node_modules/expo-modules-core/android/build/downloads (create the directories if they don’t exist).

great work @thanksyouall! i can repro the problem. though is pretty strange to me where adding the kotlin-gradle-plugin to cause the problem. will investigate more. thanks!

I have the same error for the last two days.