Flutter phonepe sdk is not compile properlygradle error

I followed all the step to add phonepe-intentsdk-android to my project. And when I run the app for IOS it works fine but when I try to build for android in a real device I get below error
Build file '/Users/ani/StudioProjects/flutter_firestore/android/build.gradle.kts' line: 6
* What went wrong:
Script compilation error:
Line 6: url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"
^ Unexpected tokens (use ';' to separate expressions on the same line)
I tried to add ; and then it gives more error.
Below are the steps I followed.
maven {
url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"
}
-------------------
// pubspec.yaml:
phonepe_payment_sdk: ^3.0.0
any idea
Answer
Finally I resolve it. The issue was my gradle build file name is build.gradle.kts
not build.gradle
. The way we need to add repository url in build.gradle.kts
is different. Look your file name properly
The config for the build.gradle.kts
should be like below
allprojects {
repositories {
google()
mavenCentral()
maven {
url = uri("https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android")
}
}
}
Enjoyed this article?
Check out more content on our blog or follow us on social media.
Browse more articles