Open neerajapex opened 1 month ago
@neerajapex Thanks for bringing this to our attention. Looking into this.
@neerajapex So I wasn't able to reproduce the issue with just the version 3.24.0. Would it be possible for you to specify the gradle versions your project is using?
@vivekshindhe
gradle-wrapper.properties: distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
build.gradle:
ext.kotlin_version = '1.8.10'
dependencies { classpath 'com.android.tools.build:gradle:7.1.2' // START: FlutterFire Configuration classpath 'com.google.gms:google-services:4.3.10' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1' // END: FlutterFire Configuration classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" }
apply plugin: 'com.android.application'
// START: FlutterFire Configuration
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
// END: FlutterFire Configuration
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { compileSdkVersion 34
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.appname"
minSdkVersion 24
targetSdkVersion 34
multiDexEnabled true
versionCode 87
versionName '1.0.0'
}
signingConfigs {
if (System.getenv("ANDROID_KEYSTORE_PATH")) {
release {
storeFile file(System.getenv("ANDROID_KEYSTORE_PATH"))
keyAlias System.getenv("ANDROID_KEYSTORE_ALIAS")
keyPassword System.getenv("ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD")
storePassword System.getenv("ANDROID_KEYSTORE_PASSWORD")
}
} else {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
}
flavorDimensions "default"
productFlavors {
qa {
dimension "default"
applicationIdSuffix ".qa"
manifestPlaceholders = [appName: "App-QA"]
}
development {
dimension "default"
applicationIdSuffix ".dev"
manifestPlaceholders = [appName: "App-Dev"]
}
}
buildTypes {
release {
/* ndk {
abiFilters 'armeabi-v7a','arm64-v8a','x86_64'
} */
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
proguardFiles (
getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
)
}
}
packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86/libfbjni.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/x86_64/libfbjni.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libfbjni.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libfbjni.so'
}
}
flutter { source '../..' }
dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "androidx.browser:browser:1.3.0" coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' implementation 'androidx.window:window:1.0.0' implementation 'androidx.window:window-java:1.0.0' }
@neerajapex thank you. While I look into this, just as a check can you please use the older flutter version you were using and see if this issue is happening there as well?
@vivekshindhe Thanks for your reply. I have tried that also. But now the older version also throws the same build error. I tried rebuilding and deleting the cache also but no luck.
@vivekshindhe I am kind of stuck because of this error. Any direction to resolve this will be very helpful.
@neerajapex Hey, we are looking into this. I'm not able to reproduce the issue. Not sure what the difference is between your project and mine. Until we get to the bottom of this, can you try reinstalling the razorpay_flutter package in your project?
@vivekshindhe Thanks. I'll try.
@vivekshindhe I tried reinstalling the razorpay_flutter package, but I am still getting the same build error.
@neerajapex will be releasing an update today to resolve this.
@vivekshindhe Thanks. Waiting for the release. I'll let you know after testing the fix.
@neerajapex The fix is live. Can you please test it once? As a precaution, please ensure to run Sync project with Gradle Files
before testing.
@vivekshindhe Thanks. Finally, the build issue is gone. But to make this work I had to make some more changes. I am explaining those changes in case anyone faces the same issue.
1. gradle-wrapper.properties: Upgrade gradle version:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
upgraded to
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
Note: I can't use the 8.x version because I have Java 11 in my system and it needs Java 17.
2. build.gradle: Upgrade Kotlin version:
ext.kotlin_version = '1.8.10'
upgraded to
ext.kotlin_version = '1.9.0'
3. build.gradle: Upgrade gradle tool version
classpath 'com.android.tools.build:gradle:7.1.2'
upgraded to
classpath 'com.android.tools.build:gradle:7.2.2'
4. Run the following command from the terminal to sync and refresh your gradle dependencies If working in VS Code.
$ cd android
$ ./gradlew --refresh-dependencies
5. Run the Flutter project.
After day one of upgrading Flutter to Flutter version 3.24.0, I suddenly started getting build issues because of the conflict with the Razorpay package name 'com.razorpay'.
Description
Below is the error log:
Flutter Version :
Flutter 3.24.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision 80c2e84975 (9 days ago) • 2024-07-30 23:06:49 +0700 Engine • revision b8800d88be Tools • Dart 3.5.0 • DevTools 2.37.2
I tried the below approaches with no luck. The build is still failing.
Steps To Reproduce
Expected Results
Build should work without error.
Snack, code example, screenshot, or link to a repository:
pubspec.yaml