react-native-alipay
react-native-alipay copied to clipboard
Direct local .aar file dependencies are not supported when building an AAR.
When I build the apk , there is error . 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: C:\Users\username\AwesomeProject\node_modules@uiw\react-native-alipay\android\libs\alipaySdk-15.7.9-20200727142846.aar
same issue
I'm also the one who reported the mistake
Modify Android/ build.gradle 'dependencies classpath classpath 'com.android.tools.build:gradle:4.1.0' Change to com.android.tools.build:gradle:3.x.x
我也碰到了,但是gradle 又只能4.0.1 用了react-native-crop-image 这咋办? @wulaizi
我也碰到了,但是gradle 又只能4.0.1 用了react-native-crop-image 这咋办? @wulaizi
参考这个:https://stackoverflow.com/a/63665094/6880617
这是我改的
更新: 改了之后打包好像没问题,但是点击支付的时候闪退了
Modify Android/ build.gradle 'dependencies classpath classpath 'com.android.tools.build:gradle:4.1.0' Change to com.android.tools.build:gradle:3.x.x
@jaywcjlove 小弟调调™ 我看仓库里的 example 并没有修改 com.android.tools.build:gradle
的版本,请问是怎么避免这个问题的?
@GreatAuk 是我测试用例,在我们 项目 中使用没有问题的样子
@jaywcjlove 我下载了 example , android 打包./gradlew assembleRelease
发现有一样的问题,开发调试没问题
你们自己的项目的
com.android.tools.build:gradle
版本是大于 4 的吗
我自己项目每次都升级到 react 初始化工程的默认版本
当前工程是边开发边测试,所以示例里面使用 link:../
使用 yarn 安装,会把上一级目录中的包进行 软连接
"@uiw/react-native-alipay": "link:../",
@chenshaxuanjing
@jaywcjlove 目前找到了这个方案 https://stackoverflow.com/a/60888941/6880617,或许可以参考下。不会 android 原生,所以搜索到的方案一直感觉不得要领
RN 安装 react-native-camera
升级 classpath 'com.android.tools.build:gradle:4.0.1'
应该是大多数应用都有用到的...。所以感觉这样问题应该挺普遍的,希望能跟进下
我也碰到了,但是gradle 又只能4.0.1 用了react-native-crop-image 这咋办? @wulaizi
@meiqi1992 问下这个问题有解决吗
@GreatAuk 我把 SDK 也升级了, Upgrade + @uiw/[email protected]
@haydenconquerstars @chenshaxuanjing @wulaizi 还没有测试,可以测试一下有什么问题。
https://github.com/uiwjs/react-native-alipay/blob/a9073920baefcd198806acd884e1402d1ddb5f27/android/build.gradle#L36
@jaywcjlove
@jaywcjlove 确认还是报一样的错
@GreatAuk 示例必须降到 3.5.3 才能兼容所有?
@GreatAuk 示例必须降到 3.5.3 才能兼容所有?
对的,你自己也可以打包试下,就仓库里面的 example 项目(我只是把 package.json 里面的 react-native-alipay
源改成了在线的)。你们不会从来没用这个 example 打包过吧...
@GreatAuk 前面几版本都是有测试,我们的产品上线之后,改动不大的,我都只测试了iOS
@GreatAuk 这个问题你解决了吗,我还没解决 升级到4.0.0-beta.1 还是一样的问题
@meiqi1992 Modify Android/ build.gradle 'dependencies classpath classpath 'com.android.tools.build:gradle:4.1.0' Change to com.android.tools.build:gradle:3.x.x 直接改成 3.x.x 了,react-native-camera 也能用...,试试吧,也没什么成本
https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-native-alipay/file/package.json
使用的时候 @uiw/react-native-alipay 组件安装不会有 example
示例目录,应该不会错误。
example
目录示例只需要保证测试 @uiw/react-native-alipay 组件有没有问题就可以了吧。
https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-native-alipay/file/package.json
使用的时候 @uiw/react-native-alipay 组件安装不会有
example
示例目录,应该不会错误。
example
目录示例只需要保证测试 @uiw/react-native-alipay 组件有没有问题就可以了吧。
@justjavac 还是改成implementation (name: 'alipaysdk-15.8.03.210428205839', ext: 'aar')吧,真有问题
https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/[email protected]/file/android/build.gradle
// 支付宝 SDK AAR 包所需的配置
// implementation (name: 'alipaysdk-15.8.03.210428205839', ext: 'aar')
implementation fileTree(dir: "libs", include: ["*.aar"])
https://github.com/uiwjs/react-native-alipay/blob/a9073920baefcd198806acd884e1402d1ddb5f27/android/build.gradle#L77-L79
@lxp-git 这两种方式有什么区别?
https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/[email protected]/file/android/build.gradle
// 支付宝 SDK AAR 包所需的配置 // implementation (name: 'alipaysdk-15.8.03.210428205839', ext: 'aar') implementation fileTree(dir: "libs", include: ["*.aar"])
https://github.com/uiwjs/react-native-alipay/blob/a9073920baefcd198806acd884e1402d1ddb5f27/android/build.gradle#L77-L79
@lxp-git 这两种方式有什么区别?
@jaywcjlove 现在gradle4发不了release
gradle4 只支持implementation (name: 'alipaySdk-15.7.7-20200702160044', ext: 'aar')
这种方式?
gradle4 只支持
implementation (name: 'alipaySdk-15.7.7-20200702160044', ext: 'aar')
这种方式?
@jaywcjlove 不是只支持啊,看报错提示的意思好像是模块不能直接依赖arr,会导致resource资源出问题?
具体不知道你可以试试,我这边改了然后编译过了😂能用就行
@lxp-git 欢迎提交 PR
@lxp-git 欢迎提交 PR
@jaywcjlove 光是改插件还不行,要把依赖包加载app模块里面,或者在project的allprojects里面写上flatDir { dirs "$rootDir/../node_modules/@uiw/react-native-alipay/android/libs" },这两个方案吧。🤣白嫖了帮助下后面白嫖的吧