react-native-alipay icon indicating copy to clipboard operation
react-native-alipay copied to clipboard

android 打包失败 升级了gradlew 4.0.1

Open meiqi1992 opened this issue 3 years ago • 5 comments

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

meiqi1992 avatar Jun 23 '21 10:06 meiqi1992

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

firehand33 avatar Jul 06 '21 07:07 firehand33

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 avatar Aug 09 '21 04:08 wuxiangqi

@wuxiangqi 这个对我有用

HaddyYang avatar Aug 15 '21 06:08 HaddyYang

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

真的有用

walkerzhy avatar Sep 06 '21 08:09 walkerzhy

这个问题修复了吗

baiachen avatar Jan 17 '22 01:01 baiachen