react-native-alipay
react-native-alipay copied to clipboard
android 打包失败 升级了gradlew 4.0.1
Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :uiw_react-native-alipay project caused this error: /Users/meiqi/Desktop/TOP_B2/tuopuwang/node_modules/@uiw/react-native-alipay/android/libs/alipaysdk-15.8.03.210428205839.aar
i encountered the same issue too after upgrading my react native version to 0.64 and gradle to 4.1.0
First, replace the two lines of code in node_modules/@uiw/react-native-alipay/android/build.gradle
dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules // 支付宝 SDK AAR 包所需的配置 // implementation (name: 'alipaySdk-15.7.7-20200702160044', ext: 'aar') implementation fileTree(dir: "libs", include: ["*.aar"]) }
after replacement:
dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules // 支付宝 SDK AAR 包所需的配置 implementation (name: 'alipaysdk-15.8.03.210428205839', ext: 'aar') // implementation fileTree(dir: "libs", include: ["*.aar"]) }
Then, add in the android/build.gradle:
allprojects { repositories { ... flatDir { dirs "$rootDir/../node_modules/@uiw/react-native-alipay/android/libs" } ... } }
@wuxiangqi 这个对我有用
//noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules
// 支付宝 SDK AAR 包所需的配置
implementation (name: 'alipaysdk-15.8.03.210428205839', ext: 'aar')
// implementation fileTree(dir: "libs", include: ["*.aar"])
flatDir { dirs "$rootDir/../node_modules/@uiw/react-native-alipay/android/libs" }
真的有用
这个问题修复了吗