uiwjs / react-native-alipay

基于 React Native 的宝支付包,已更新到最新的支付宝 SDK 版本,支持Android/iOS。
https://uiwjs.github.io/react-native-alipay/
MIT License
208 stars 49 forks source link

android 打包失败 升级了gradlew 4.0.1 #38

Open meiqi1992 opened 3 years ago

meiqi1992 commented 3 years ago

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

firehand33 commented 3 years ago

i encountered the same issue too after upgrading my react native version to 0.64 and gradle to 4.1.0

wuxiangqi commented 3 years ago

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" } ... } }

HaddyYang commented 3 years ago

@wuxiangqi 这个对我有用

walkerzhy commented 3 years ago

//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" }

真的有用

baiachen commented 2 years ago

这个问题修复了吗