Skip to content

Commit 0249f91

Browse files
madeyeclaude
andcommitted
Revert toolchain bump; target 35 on top of AGP 8.1.2
The compileSdk 35 path forced AGP 8.5.0, which in turn broke mergeJniLibFolders against rust-android-gradle 0.9.6 with "Duplicate resources" for every ABI's libproxydroid_tun2socks.so. Neither packagingOptions.jniLibs.pickFirsts (wrong phase) nor srcDirs dedupe (duplicates come from AGP's auto-registration of cargoBuild task outputs, not from srcDirs) resolves it, and no released rust-android-gradle plugin is compatible with AGP 8.5+. Sidestep the whole upgrade: AGP only requires compileSdk to be high enough to reference APIs the code actually uses; targetSdk is a manifest declaration Play reads, and targetSdk > compileSdk is allowed. Set targetSdk to 35 (Play's current floor) on top of the existing toolchain: - AGP stays 8.1.2 - Gradle stays 8.4 - Kotlin stays 1.9.10 - Compose Compiler ext stays 1.5.3 - compileSdk stays 34 - minSdk 21 -> 24 - targetSdk 33 -> 35 Mirror changes (dl.google.cn, Aliyun, Tencent Cloud) are kept. Drop the AGP-8.5-specific JNI dedupe workaround. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8875c74 commit 0249f91

3 files changed

Lines changed: 5 additions & 16 deletions

File tree

app/build.gradle

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if (localPropsFile.exists()) {
1212

1313
android {
1414
namespace 'org.proxydroid'
15-
compileSdk 35
15+
compileSdk 34
1616
ndkVersion "25.1.8937393"
1717

1818
signingConfigs {
@@ -76,7 +76,7 @@ android {
7676
}
7777

7878
composeOptions {
79-
kotlinCompilerExtensionVersion '1.5.15'
79+
kotlinCompilerExtensionVersion '1.5.3'
8080
}
8181

8282
packagingOptions {
@@ -86,17 +86,6 @@ android {
8686
}
8787
}
8888

89-
// rust-android-gradle 0.9.6 ends up registering its build/rustJniLibs/<abi>
90-
// directory in jniLibs.srcDirs twice under AGP 8.5+, causing
91-
// mergeJniLibFolders to fail with "Duplicate resources" on every ABI's .so.
92-
// Deduplicate srcDirs at configure time. MergeSourceSetFolders is not a
93-
// Copy task, so duplicatesStrategy doesn't help here.
94-
afterEvaluate {
95-
android.sourceSets.configureEach { sourceSet ->
96-
sourceSet.jniLibs.srcDirs = sourceSet.jniLibs.srcDirs.toSet().toList()
97-
}
98-
}
99-
10089
cargo {
10190
module = "src/main/rust/proxydroid-tun2socks"
10291
libname = "proxydroid_tun2socks"

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.9.25'
4+
ext.kotlin_version = '1.9.10'
55
repositories {
66
// Use Google's China mirror so the build works from networks where
77
// dl.google.com is unreachable. The mirror serves the same artifacts.
@@ -13,7 +13,7 @@ buildscript {
1313
gradlePluginPortal()
1414
}
1515
dependencies {
16-
classpath 'com.android.tools.build:gradle:8.5.0'
16+
classpath 'com.android.tools.build:gradle:8.1.2'
1717
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1818
classpath 'org.mozilla.rust-android-gradle:plugin:0.9.6'
1919

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.7-bin.zip
3+
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.4-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)