
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
expo-gradle-ext-vars
Advanced tools
Expo plugin to append custom vars to the root android/build.gradle
By Transistor Software, creators of React Native Background Geolocation
A simple Expo Config Plugin for appending Android ext
vars to the android/build.gradle
. ext
vars are a common Android method for configuring project-wide, global configuration properties which can be shared by other plugins in order to avoid dependency conflicts.
A common usage of ext
vars is to align Google / AndroidX dependency version across different plugins using the same dependencies. For example:
dependencies {
implementation "androidx.appcompat:appcompat:${rootProject.ext.appCompatVersion}"
implementation "com.google.android.gms:play-services-location:${rootProject.ext.playServicesLocationVersion}"
}
android/build.gradle
import org.apache.tools.ant.taskdefs.condition.Os
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
+ // @generated begin expo-gradle-ext-vars - expo prebuild (DO NOT MODIFY) sync-8c85b9ad3863726565f7eff0645ac3f5c56ce733
+ googlePlayServicesLocationVersion = "20.0.0"
+ appCompatVersion = "1.4.2"
+ // @generated end expo-gradle-ext-vars
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21')
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '31')
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '31')
if (findProperty('android.kotlinVersion')) {
kotlinVersion = findProperty('android.kotlinVersion')
}
frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'
if (System.properties['os.arch'] == 'aarch64') {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = '24.0.8215888'
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = '21.4.7075529'
}
}
}
npx expo install expo-gradle-ext-vars
Add the following block to your Expo app's app.json
.
:warning: The variables below are only an example. You should only provide variables as prescribed by some other plugin you're installing.
{
"expo": {
"plugins": [
[
"expo-gradle-ext-vars", {
"googlePlayServicesLocationVersion": "20.0.0",
"appCompatVersion": "1.4.2"
}
]
]
}
After adding the plugin, run:
npx expo prebuild
FAQs
Expo plugin to append custom vars to the root android/build.gradle
The npm package expo-gradle-ext-vars receives a total of 8,196 weekly downloads. As such, expo-gradle-ext-vars popularity was classified as popular.
We found that expo-gradle-ext-vars demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.