From 886e52dcff1e156f28ae1a462059758e51ef8fb0 Mon Sep 17 00:00:00 2001 From: agnostic-apollo Date: Thu, 1 Jul 2021 08:34:00 +0500 Subject: [PATCH] Export JITPACK_NDK_VERSION for jitpack Jitpack build is failing with the following error ``` > Configure project : Gradle version Gradle 7.1 FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > com.android.builder.errors.EvalIssueException: NDK from ndk.dir at /opt/android-sdk-linux/ndk-bundle had version [21.1.6352462] which disagrees with android.ndkVersion [22.1.7171670] ``` So attempting to manually export an env variable for jitpack which uses ndk 21.1.6352462 instead of the termux default 22.1.7171670 and which is also used by F-Droid https://jitpack.io/com/github/termux/termux-app/0.115/build.log https://github.com/jitpack/jitpack.io/blob/master/BUILDING.md#custom-commands https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/com.termux.yml#L726 --- app/build.gradle | 2 +- jitpack.yml | 2 ++ terminal-emulator/build.gradle | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 jitpack.yml diff --git a/app/build.gradle b/app/build.gradle index 9cc6ba14..3ec30d10 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,7 +4,7 @@ plugins { android { compileSdkVersion project.properties.compileSdkVersion.toInteger() - ndkVersion project.properties.ndkVersion + ndkVersion = System.getenv("JITPACK_NDK_VERSION") ?: project.properties.ndkVersion dependencies { implementation "androidx.annotation:annotation:1.2.0" diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 00000000..6a9b67d8 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +env: + JITPACK_NDK_VERSION: "21.1.6352462" diff --git a/terminal-emulator/build.gradle b/terminal-emulator/build.gradle index c60d4ad0..e03403f9 100644 --- a/terminal-emulator/build.gradle +++ b/terminal-emulator/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'maven-publish' android { compileSdkVersion project.properties.compileSdkVersion.toInteger() - ndkVersion project.properties.ndkVersion + ndkVersion = System.getenv("JITPACK_NDK_VERSION") ?: project.properties.ndkVersion defaultConfig { minSdkVersion project.properties.minSdkVersion.toInteger()