Cronet on Android
June 6, 2026 · View on GitHub
Android uses Google's embedded Cronet through the Java CronetEngine API, called from Kotlin. There is no custom C/JNI Cronet wrapper — the library talks to Cronet via org.chromium.net.*.
Dependency
org.chromium.net:cronet-embedded is declared in packages/react-native-nitro-fetch/android/build.gradle:
api "org.chromium.net:cronet-embedded:${cronetVersion}"
cronetVersion defaults to 141.7340.3 and can be overridden with a NitroFetch_cronetVersion gradle property. The embedded variant bundles the native Chromium net stack, so no Play Services dependency is required.
Engine
A single CronetEngine is created lazily and shared for the process lifetime (NitroFetch.kt, getEngine()):
- Logs every available
CronetProviderand prefers the one whose name contains"Native"(avoids Play-Services DNS quirks); falls back to the default provider. - Built with
enableHttp2(true),enableQuic(true)(HTTP/3), andenableBrotli(true). - Disk cache:
HTTP_CACHE_DISK, 50 MB, at<cacheDir>/nitrofetch_cronet_cache. - User-Agent:
NitroFetch/1.0. - Callbacks run on a fixed-size
NitroCronet-iothread pool.
NitroFetch.shutdown() tears the engine down (best-effort).
Request paths
- Buffered (
NitroFetchClient.kt):request()(asyncPromise) andrequestSync()(used by worklets) build aUrlRequest, accumulate the body, and resolve aNitroResponse. Cancellation is wired throughcancelRequest(requestId). - Streaming (
NitroCronet.kt):newUrlRequestBuilder(url)exposes aUrlRequestBuilderwhoseonResponseStarted/onReadCompletedcallbacks drive aReadableStream(used byfetch(url, { stream: true })). - Prefetch / auto-prefetch (
AutoPrefetcher.kt,NitroFetchClient.kt): results are kept inFetchCacheand served with anitroPrefetched: trueheader.