expo: Expokit upgrade issue (sdk 32.0.0 to sdk 33.0.0) Error: Could not find org.webkit:android-jsc:r224109.

I had some issue in my app of release apk (scrolling on some screens are not smooth and images not showing) in every Android 9 (Pie) devices. And i tried many related solution but did not work.

So i am trying to upgrade expokit (from 32 to 33 expo sdk).

i follow this expokit document and rebuild project and i am getting this error

Could not find org.webkit:android-jsc:r224109.
Required by:
    project :app > host.exp.exponent:expoview:33.0.0
Search in build.gradle files

When i change 'org.webkit:android-jsc:r224109' to 'org.webkit:android-jsc:r241213'

configurations.all {
  resolutionStrategy {
   // force 'org.webkit:android-jsc:r224109'
    force 'org.webkit:android-jsc:r241213'  //<------change
  }
}

and i am getting this error

ERROR: Manifest merger failed : Attribute data@scheme at manifestMerger5081911350553640004.xml requires a placeholder substitution but no value for <appAuthRedirectScheme> is provided.

This is my package.json file

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject",
    "test": "node ./node_modules/jest/bin/jest.js --watchAll"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/samples": "2.1.1",
    "axios": "^0.18.0",
    "expo": "^33.0.0",
    "expokit": "33.0.2",
    "react": "16.8.3",
    "react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
    "react-native-animatable": "^1.3.1",
    "react-native-carousel": "^0.11.0",
    "react-native-collapsible": "^1.4.0",
    "react-native-expandable-section-flatlist": "^1.1.8",
    "react-native-firebase": "^5.3.1",
    "react-native-image-slider": "^2.0.3",
    "react-native-image-slider-show": "^1.0.3",
    "react-native-loading-spinner-overlay": "^1.0.1",
    "react-native-modal": "^9.0.0",
    "react-native-paper": "^2.12.0",
    "react-native-popup-dialog": "^0.17.0",
    "react-native-razorpay": "^2.1.23",
    "react-native-reanimated": "^1.0.1",
    "react-native-search-filter": "^0.1.4",
    "react-native-sectioned-multi-select": "^0.6.5",
    "react-native-share": "^1.1.3",
    "react-native-simple-stepper": "^2.1.3",
    "react-native-snap-carousel": "^3.7.5",
    "react-native-star-rating": "^1.1.0",
    "react-native-svg": "^9.2.4",
    "react-native-tab-view": "^2.0.3",
    "react-navigation": "^3.0.9",
    "react-redux": "^6.0.1",
    "redux": "^4.0.1",
    "redux-thunk": "^2.3.0",
    "switch-button-react-native": "^1.0.3",
    "tcomb-form-native": "^0.6.20"
  },
  "devDependencies": {
    "babel-preset-expo": "^5.0.0",
    "jest-expo": "^33.0.0",
    "react-native-unimodules": "^0.4.0"
  },
  "private": true
}

This is app.json file

{
  "expo": {
    "name": "Project Name",
    "slug": "projectname",
    "privacy": "public",
    "sdkVersion": "33.0.0",
    "platforms": [
      "ios",
      "android"
    ],
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true
    },
    "description": "",
    "isDetached": true,
    "detach": {
      "androidExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/android-v2.10.8-sdk32.0.0-bca0f957-de78-44c8-91ed-f3151372d79d.tar.gz"
    },
    "scheme": "expc9345a0ccdad4b7aabc0fde8f11abf9e",
    "android": {
      "package": "com.projectapp",
      "publishBundlePath": "android/app/src/main/assets/shell-app.bundle",
      "publishManifestPath": "android/app/src/main/assets/shell-app-manifest.json"
    }
  }
}

This is my app build.gradle file

buildscript {
  repositories {
    google()
    maven { url 'https://maven.fabric.io/public' }
  }

  dependencies {
    classpath 'io.fabric.tools:gradle:1.26.1'
    
  }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'devicefarm'

repositories {
  maven { url 'https://maven.fabric.io/public' }
}

android {
  compileSdkVersion 28

  defaultConfig {
    applicationId 'com.projectapp'
    minSdkVersion 21
    targetSdkVersion 28
    versionCode 3
    versionName '1.0.1'
    ndk {
      abiFilters 'armeabi-v7a', 'x86'
    }
    multiDexEnabled true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    // Deprecated. Used by net.openid:appauth
    manifestPlaceholders = [
        'appAuthRedirectScheme': 'host.exp.exponent'
    ]
  }
  dexOptions {
    javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g"
  }
/*
  flavorDimensions 'remoteKernel'
  productFlavors {
    devKernel {
      dimension 'remoteKernel'
    }
    prodKernel {
      dimension 'remoteKernel'
    }
  }*/
  signingConfigs {
    debug {
      storeFile file('../debug.keystore')
    }
    release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
  }
  buildTypes {
    debug {
      debuggable true
      ext.enableCrashlytics = false
    }
    release {
      minifyEnabled true
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      signingConfig signingConfigs.release
    }
  }
  lintOptions {
    abortOnError false
  }
  packagingOptions {
    pickFirst "**"
  }
  configurations.all {
    resolutionStrategy.force 'com.android.support:design:27.1.0'
  }
  compileOptions {
  sourceCompatibility 1.8
  targetCompatibility 1.8
}

}

devicefarm {
  projectName System.getenv("DEVICEFARM_PROJECT_NAME")
  devicePool System.getenv("DEVICEFARM_DEVICE_POOL")
  executionTimeoutMinutes 40
  authentication {
    accessKey System.getenv("AWS_ACCESS_KEY_ID")
    secretKey System.getenv("AWS_SECRET_ACCESS_KEY")
  }
}

configurations.all {
  resolutionStrategy {
   // force 'org.webkit:android-jsc:r224109'
    force 'org.webkit:android-jsc:r241213'
  }
}

// WHEN_PREPARING_SHELL_REMOVE_FROM_HERE

apply from: 'expo.gradle'

// WHEN_PREPARING_SHELL_REMOVE_TO_HERE
apply from: "../../node_modules/react-native-unimodules/gradle.groovy"
dependencies {
 // implementation project(':react-native-razorpay-expokit')
  implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation project(':react-native-razorpay')

  implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.16'

 // implementation 'com.android.support:multidex:1.0.1'
 // implementation 'com.google.firebase:firebase-core:16.0.8'
    // Cloud Messaging / FCM
    implementation "com.google.firebase:firebase-messaging:17.6.0"
  implementation project(':react-native-firebase')
  implementation project(':react-native-share')
  // Our dependencies
  implementation 'com.android.support:appcompat-v7:28.0.0'

  // Our dependencies from ExpoView
  // DON'T ADD ANYTHING HERE THAT ISN'T IN EXPOVIEW. ONLY COPY THINGS FROM EXPOVIEW TO HERE.
 // implementation 'com.android.support:appcompat-v7:27.1.1'
  implementation 'com.facebook.android:facebook-android-sdk:4.37.0'

  //implementation 'com.facebook.android:facebook-android-sdk:5.6.0'
  //implementation 'com.facebook.android:audience-network-sdk:5.+'
  implementation('com.facebook.android:audience-network-sdk:4.99.0') {
    exclude module: 'play-services-ads'
  }
  compileOnly 'org.glassfish:javax.annotation:3.1.1'
  implementation 'com.jakewharton:butterknife:8.4.0'
  implementation 'de.greenrobot:eventbus:2.4.0'

  // Be careful when upgrading! Upgrading might break experience scoping. Check with Jesse. See Analytics.resetAmplitudeDatabaseHelper
  implementation 'com.amplitude:android-sdk:2.9.2'

  implementation 'com.squareup.picasso:picasso:2.5.2'
 // implementation 'com.google.android.gms:play-services-gcm:15.0.1'
  implementation 'com.google.android.gms:play-services-analytics:16.0.1'
  implementation 'com.google.android.gms:play-services-maps:15.0.1'
  implementation 'com.google.android.gms:play-services-auth:15.0.1'
  implementation 'com.google.android.gms:play-services-location:15.0.1'
  implementation 'com.google.android.gms:play-services-ads:15.0.1'
  annotationProcessor 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
  implementation "com.raizlabs.android:DBFlow-Core:2.2.1"
  implementation "com.raizlabs.android:DBFlow:2.2.1"
  implementation "com.madgag.spongycastle:core:1.53.0.0"
  implementation "com.madgag.spongycastle:prov:1.53.0.0"
  debugImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
  // debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
  releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
  implementation 'com.facebook.device.yearclass:yearclass:2.1.0'
  implementation 'commons-io:commons-io:1.4'
  implementation 'me.leolin:ShortcutBadger:1.1.4@aar'
  implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
  implementation 'com.yqritc:android-scalablevideoview:1.0.1'
  implementation 'commons-codec:commons-codec:1.10'
  implementation 'com.segment.analytics.android:analytics:4.3.0'
  implementation 'com.google.zxing:core:3.3.3'
  implementation 'net.openid:appauth:0.4.1'
  implementation('com.airbnb.android:lottie:2.5.5') {
    exclude group: 'com.android.support', module: 'appcompat-v7'
  }
  implementation('io.nlopez.smartlocation:library:3.2.11') {
    transitive = false
  }
  implementation 'com.android.support:exifinterface:28.0.0'
  implementation 'com.squareup.okio:okio:1.9.0'
  implementation 'com.facebook.soloader:soloader:0.5.1'

  implementation 'com.google.android.exoplayer:exoplayer:2.6.1'
  //implementation 'expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1@aar'
  implementation 'com.google.android.exoplayer:extension-okhttp:2.6.1'
  // expo-file-system
  implementation 'com.squareup.okhttp3:okhttp:3.10.0'
  implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'

  // Testing
  androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
  // We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
  androidTestImplementation 'com.android.support.test:runner:1.0.1'
  androidTestImplementation 'com.android.support:support-annotations:28.0.0'
  androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.0'
  androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
  androidTestImplementation 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'

  testImplementation 'junit:junit:4.12'
  testImplementation 'org.mockito:mockito-core:1.10.19'
  testImplementation 'org.robolectric:robolectric:3.8'
  testImplementation 'com.android.support.test:runner:1.0.2-alpha1'
  testImplementation 'com.android.support.test:rules:1.0.2-alpha1'

  
  implementation('host.exp.exponent:expoview:33.0.0@aar') {
    transitive = true
    exclude group: 'com.squareup.okhttp3', module: 'okhttp'
    exclude group: 'com.squareup.okhttp3', module: 'okhttp-urlconnection'
  }

  addUnimodulesDependencies([
  modulesPaths : [
    '../../node_modules'
  ],
  configuration: 'api',
  target       : 'react-native',
  exclude      : [
    // You can exclude unneeded modules here, e.g.,
    // 'unimodules-face-detector-interface',
    // 'expo-face-detector'

    // Adding a name here will also remove the package
    // from auto-generated BasePackageList.java
   
  ]
])
  


  
  api 'com.facebook.react:react-native:33.0.0'
  

  
}

// This has to be down here for some reason
apply plugin: 'com.google.gms.google-services'

When run react-native run-android get this error

> Task :app:preDebugBuild FAILED

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':expo-av: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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'.
   > Could not find org.webkit:android-jsc:r224109.
     Required by:
         project :app > host.exp.exponent:expoview:33.0.0

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 21 (2 by maintainers)

Most upvoted comments

Same issue after update from 32 to 33

Hey all, let me try to help you problem by problem:

Could not find org.webkit:android-jsc:r224109

TLDR: Change r224109 to r245459 in android/app/build.gradle.

Context: Android projects often manage dependencies using a tool called Maven. It allows people to place prebuilt dependencies in a local directory and be able to reference them in our project (this way one doesn’t need to download them from Maven servers). A list of local directories where Maven should look for those dependencies is configurable. We (and others) use this method to distribute some of the native dependencies which would take a while to build on your machine (React Native, ExpoKit, the JSC). ExpoKit-ejected Android projects are configured so that they look for native dependencies in a local directory: ../node_modules/expokit/maven ➡️ in expokit package! In this package, which we publish from expokit-npm-package, there are prebuilt: react-native, expoview (ExpoKit core), android-jsc and all the unimodules (which aren’t used as prebuilt packages in ejected scenario so you can debug and edit their native code, they are used in Turtle builders, where we actually profit from the fact that they are prebuilt — builds run faster!)

Problem: It looks like android-jsc bundled in expokit isn’t the one that your project depends on, so technically GRADLE_VERSION and EXPOKIT_VERSION aren’t the same:

// android/app/build.gradle

// ...
  resolutionStrategy {
    force 'org.webkit:android-jsc:<GRADLE_VERSION>'
  }
// ...
$ tree node_modules/expokit/maven/org/webkit

node_modules/expokit/maven/org/webkit
├── android-jsc
│   ├── maven-metadata.xml
│   ├── maven-metadata.xml.md5
│   ├── maven-metadata.xml.sha1
│   └── EXPOKIT_VERSION
│       ├── android-jsc-EXPOKIT_VERSION.aar
│       ├── android-jsc-EXPOKIT_VERSION.aar.md5
│       ├── android-jsc-EXPOKIT_VERSION.aar.sha1
│       ├── android-jsc-EXPOKIT_VERSION.pom
│       ├── android-jsc-EXPOKIT_VERSION.pom.md5
│       └── android-jsc-EXPOKIT_VERSION.pom.sha1

Solution: Since there are two variables in this case we can change two values: either version used in Gradle or the one we have inside expokit.

  • changing version inside expokit — (do not attempt this at home!) — editing node_modules isn’t always the best idea, the change being ephemeral (yes, there are great tools like patch-package, but still). It could also happen that the JSC you would put there somehow wouldn’t be compatible with the whole project and your app could crash unexpectedly.
  • changing version inside build.gradle — if life gives you lemons, make a lemonade! If we can’t depend on what we don’t have, let’s depend on what we do have! Check what version of android-jsc is bundled inside expokit (ls node_modules/expokit/maven/org/webkit/android-jsc)—most probably it will be r245459. Go through all build.gradle files in your project (probably only android/app/build.gradle) and change all occurrences of r224109 to the proper version (r245459). This should fix this issue.

…no value for <appAuthRedirectScheme> is provided

TLDR: Downgrade to Android Studio 3.3 or, as a temporary workaround, add the following property to android/app/build.gradle:

android {
  defaultConfig {
    manifestPlaceholders = [
      appAuthRedirectScheme: 'your.app.scheme'
    ]
  }
}

Context: Just like Expo applications have app.json, a package of information on the application, JS packages have package.json, a package of information on the library, Android apps (and libraries too) have AndroidManifest.xmls. Such manifests can contain placeholders for values defined by consuming applications. Concrete values for these placeholders are defined in build.gradles using manifestPlaceholders property.

More information on this topic can be found in Inject build variables into the manifest article on developer.android.com.

Problem: Since placeholders require a value, if we don’t provide a value, the build will fail.

Solution: The basic solution would be to provide a value for this placeholder. Add the following property to android/app/build.gradle:

android {
  defaultConfig {
    manifestPlaceholders = [
      appAuthRedirectScheme: 'your.app.scheme'
    ]
  }
}

If you’re on Android Studio <= 3.3, this should do the work. However, it looks like Android Studio 3.4 doesn’t provide values defined in application’s build.gradle to manifests of libraries. In this case either downgrade to Android Studio 3.3 (https://github.com/expo/expo/issues/4518#issuecomment-502758955) or, before we implement, a better solution edit node_modules/expo-app-auth/android/build.gradle and add the same snippet there (https://github.com/expo/expo/issues/4518#issue-454089102).

If you’re not using expo-app-auth you can also just remove it from your project! To do this:

  • in android/app/build.gradle around addUnimodulesDependencies function call, add expo-app-auth to the exclude list, so it looks like:
      addUnimodulesDependencies([
          // ... other configuration
          exclude      : [
            'expo-app-auth',
            // ... other excluded modules
          ]
      ])
    
  • in android/settings.gradle around includeUnimodulesProjects add to exclude list, so the result looks like:
    includeUnimodulesProjects([
      // ... other configuration
      exclude: [
        'expo-app-auth',
        // ... other excluded modules
      ]
    ])
    

(cc @ozanhonamlioglu — this ⬆️ is a better way to exclude unimodules from the project — if you edit node_modules next time you reinstall your dependencies the change will be lost!)

package android.support.annotation does not exist

Disclaimer: I’m not 100% sure all the information below is 100% correct, but it sounds logical to me.

Context: Recently Google announced an open-source project supreme to Android Support Libraries—AndroidX. Citing project’s description:

AndroidX is a major improvement to the original Android Support Library. Like the Support Library, AndroidX ships separately from the Android OS and provides backwards-compatibility across Android releases. AndroidX fully replaces the Support Library by providing feature parity and new libraries. (source)

Notice that the package that doesn’t exist is android.support.annotation, which is a part of Android Support Libraries.

Problem: The only problem with AndroidX migration is that you’re either all-in or all-out. If you include as little as one AndroidX-dependent dependency in your project, all the dependencies must be migrated to use AndroidX too. Fortunately, Google also provides a tool that automatically migrates dependencies to androidx.—Jetifier. Enable it according to the official documentation.

In Expo, we haven’t done the migration yet. Upcoming SDK34 will use RN 0.59 and regular Android Support Libraries. We plan to migrate our codebase to AndroidX for SDK35 or SDK36. Until then it may be difficult to mix AndroidX-migrated projects with ExpoKit projects.

Solution: There are two ways that could help mitigate this issue:


Let me know if these instructions have helped you resolve your issues! 🙂

Since I didn’t need av, I used @ozanhonamlioglu solution. I can now finish the build.

It still feels like something that needs to be addressed.

I have found a solution to this error: expo-av:compileDebugJavaWithJavac I completely removed expo-av because I don’t need any video player stuff.

Goto node_modules/expo-av/unimodule.json and remove ‘android’ from array. then build android project in androd-studio.

That is worked for me

For anyone getting the error above – it was because I mixed androidx with regular android packages.

For my package specifically it was react-native-fast-image. I was using version 7.0.2, but needed to downgrade to 6.1.1

Unfortunately I do need expo-av so solution above did not work for me. Still looking for a fix. Will update if will find some.

Hi guys I had the same issue. What helped me is updating android-jsc package to 224109 version. yarn add jsc-android@224109