-
Notifications
You must be signed in to change notification settings - Fork 64
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
集成了Alipay支付 出现的问题汇总及解决办法 #113
Comments
多谢,我会更新到下一版。 |
@wonday 去掉了这个依赖,对于只用到推送功能的人,alicloud-android-utdid这个还是需要的,文档需要提及一下 |
RN 0.63.3 集成最新版本,因为IOS工程是自动Link了,所以集成了Alipay的情况下IOS出现了冲突。 解决办法: |
感谢 @Evan-Future ! 👍 点击展开
apply plugin: 'com.android.library'
description = 'react-native-aliyun-push'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'com.google.gms:google-services:3.0.0'
}
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
}
}
repositories {
flatDir {
dirs 'libs'
}
jcenter()
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.facebook.react:react-native:+'
api ('com.aliyun.ams:alicloud-android-push:3.1.6') {
exclude module:'alicloud-android-utdid'
}
api ('com.aliyun.ams:alicloud-android-utils:1.1.3') {
exclude module:'alicloud-android-utdid'
}
api ('com.aliyun.ams:alicloud-android-beacon:1.0.2') {
exclude module:'alicloud-android-utdid'
}
// api 'com.aliyun.ams:alicloud-android-utdid:1.1.5.3'
api ('com.aliyun.ams:alicloud-android-ut:5.4.0') {
exclude module:'alicloud-android-utdid'
}
api (name: 'alicloud-android-third-push-3.0.9', ext: 'aar') {
exclude module:'alicloud-android-utdid'
}
// huawei
api 'com.google.firebase:firebase-messaging:17.6.0'
api ('com.aliyun.ams:huawei-push:2.6.3.305') {
exclude module:'alicloud-android-utdid'
}
api ('com.aliyun.ams:huawei-push-base:2.6.3.305') {
exclude module:'alicloud-android-utdid'
}
// meizu
api ('com.aliyun.ams:meizu-push:3.8.3-fix') {
exclude module:'alicloud-android-utdid'
}
// shortcutBadger
api 'me.leolin:ShortcutBadger:1.1.22@aar'
}
|
测试过有效的,不错,只是组件应该更新一下了,现在是3.2.2版本了,组件还是3.1.6版本的. |
1、react-native-aliyun-push 的gradle 编译支持只到API 26,但是目前Android9 API28了,会出现找不到资源问题。
2、集成了Alipay支付的,我集成的是:@0x5e/react-native-alipay 这个库,造成了冲突;主要冲突是alicloud-android-utdid这个库的依赖问题。
特别是第2个问题困扰了我很久(3-4个小时)才解决,针对以上2个问题我做了build.gradle的配置调整,经过测试,打包成功,现分享给朋友们,希望可以帮助绕坑。
鉴于github无法上传文件,我把react-native-aliyun-push工程下的整个build.gradle 调整过的代码贴在下面。
apply plugin: 'com.android.library'
description = 'react-native-aliyun-push'
buildscript {
repositories {
jcenter()
}
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
}
repositories {
flatDir {
dirs 'libs'
}
jcenter()
}
dependencies {
}
The text was updated successfully, but these errors were encountered: