android 构建 gradle :
// Top-level build file where you can add configuration options common to all sub- projects/modules.
buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
}
repositories {
google()
mavenCentral()
// phonepe step 1
maven {
url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"
}
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath ("com.google.gms:google-services:4.4.0")
}
}
app gradle :
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply plugin: 'com.google.gms.google-services'
dependencies {
// phonepe step 3
implementation("phonepe.intentsdk.android.release:IntentSDK:2.4.1")
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
// react native camera
// implementation 'com.google.mlkit:barcode-scanning:17.2.0'
implementation platform('com.google.firebase:firebase-bom:32.3.1')
implementation("com.google.firebase:firebase-analytics")
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}
我正在尝试使用官方文档集成手机pe支付网关sdkhttps://developer.phonepe.com/v1/docs/android-pg-sdk-integration但我的项目构建失败
无法解析配置“:app:debugCompileClasspath”的所有任务依赖项。 找不到phonepe.intentsdk.android.release:IntentSDK:2.4.1。 要求者: 项目:应用程序
需要在“buildscript”块之外添加以下代码:
allprojects {
repositories {
maven {
url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"
}
}
}
所以,你的 Android 构建 gradle 看起来像这样:
// Top-level build file where you can add configuration options common to all sub- projects/modules.
buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath ("com.google.gms:google-services:4.4.0")
}
}
allprojects {
repositories {
maven {
url "https://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"
}
}
}
请参阅此链接,了解 PhonePe SDK 集成期间的正确放置位置。”