After I updated compileSdkVersion from 34 to 35, a lot of errors appeared, and I couldn’t build the project. I will attach the files, kindly suggest any solutions.
android/build.gradle
`
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 35
kotlin_version = '1.8.0'
clientId = ""
hyperSDKVersion = "2.1.15"
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = System.properties['os.arch'] == "aarch64" ? "24.0.8215888" : "21.4.7075529"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
classpath "com.facebook.react:react-native-gradle-plugin"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.4.1'
}
}
allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
maven {
url "https:// "
}
maven { url 'https://www.jitpack.io' }
// block:start:hyper-sdk-maven-url
// maven { url "https://maven.juspay.in/jp-build-packages/hyper-sdk/"}
// maven {
// url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"
// }
// block:end:hyper-sdk-maven-url
}
}
`
error
Task :app:processDebugResources FAILED
Task :payu-custom-browser-react:compileDebugKotlin
'compileDebugJavaWithJavac' task (current target is 11) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchainTask :payu-upi-react:compileDebugKotlin
'compileDebugJavaWithJavac' task (current target is 11) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchainTask :payu-custom-browser-react:compileDebugKotlin
w: file:///D:/24-mar8/xopay_news/newxopay/five/node_modules/payu-custom-browser-react/android/src/main/java/com/cbwrapper/CBWrapperModule.kt:23:13 Condition 'payuPaymentParams == null' is always 'false'
w: file:///D:/24-mar8/xopay_news/newxopay/five/node_modules/payu-custom-browser-react/android/src/main/java/com/cbwrapper/CBWrapperModule.kt:33:51 Unchecked cast: Any? to kotlin.collections.HashMap /* = java.util.HashMap */
406 actionable tasks: 13 executed, 393 up-to-date
info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor
FAILURE: Build failed with an exception.
-
What went wrong:
Execution failed for task ':app:processDebugResources'.A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
Android resource linking failed
aapt2.exe E 09-05 17:41:47 51300 51716 LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data.
aapt2.exe E 09-05 17:41:47 51300 51716 ApkAssets.cpp:149] Failed to load resources table in APK 'C:\Users\siva1\AppData\Local\Android\Sdk\platforms\android-35\android.jar'.
error: failed to load include path C:\Users\siva1\AppData\Local\Android\Sdk\platforms\android-35\android.jar. -
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. Get more help at https://help.gradle.org
BUILD FAILED in 34s
error Failed to install the app.
info Run CLI with --verbose flag for more details.
Top comments (0)