Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
meiqi1992 opened this issue Jun 23, 2021 · 5 comments
Open

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

meiqi1992 opened this issue Jun 23, 2021 · 5 comments

Comments

@meiqi1992
Copy link

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
Copy link

firehand33 commented Jul 6, 2021

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

@wuxiangqi
Copy link

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
Copy link

@wuxiangqi 这个对我有用

@walkerzhy
Copy link

//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
Copy link

这个问题修复了吗

jaywcjlove pushed a commit that referenced this issue Jul 6, 2022
Co-authored-by: seven <seven@beansmile.com>
jaywcjlove added a commit that referenced this issue Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants