little-snow-fox / react-native-wechat-lib

🚀 WeChat login, share, favorite and payment for React-Native on iOS and Android
MIT License
653 stars 127 forks source link

How to config ios/android in v3.0.0 #217

Open surethink opened 1 year ago

surethink commented 1 year ago

你好, 我看了下 ios的WechatLibExample/AppDelegate.mm里面,并没有md里提到的要增加的配置?是不需要配置了?还是其它原因 直接复制进去,build 报错 麻烦更新下md,拜托拜托

ps,rn0.71版本已经出了,不知道是否需要特别适配呢?

多谢大佬的库,解民倒悬:)

ruijia168 commented 1 year ago

也想问android配置

little-snow-fox commented 1 year ago

我会尽快更新一个版本,并修改文档

little-snow-fox commented 1 year ago

关于安卓的文档已经更新,并发布 3.0.1 版本 麻烦你贴出一下 IOS 的报错信息,添加哪行配置导致的?

surethink commented 1 year ago

关于安卓的文档已经更新,并发布 3.0.1 版本 麻烦你贴出一下 IOS 的报错信息,添加哪行配置导致的? 我按照ios的要求都添加以后,重新pod install,干掉deriveddata再build,报错如下: The following build commands failed: CompileC /Users/user/Library/Developer/Xcode/DerivedData/app-euhunlbhmsglbggqqaaiaqdsetcf/Build/Intermediates.noindex/app.build/Debug-iphonesimulator/app.build/Objects-normal/x86_64/AppDelegate.o /Users/user/Dev/work/frontend/app_rn/ios/app/AppDelegate.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'app' from project 'app')

补充下我是0.71.1,不知道跟这个有没关系

ruijia168 commented 1 year ago

大佬 我安卓在配置登录和分享回调板块中出现报错 我的版本("react-native": "0.70.6","react-native-wechat-lib": "^3.0.0") error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 E:\android-studio\AndroidProject\test\android\app\src\main\java\com\test\wxapi\WXEntryActivity.java:11: ����: �޷�����IWXAPIEventHandler WeChatLibModule.handleIntent(getIntent()); ^ �Ҳ���com.tencent.mm.opensdk.openapi.IWXAPIEventHandler�����ļ� 1 ������

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

little-snow-fox commented 1 year ago

大佬 我安卓在配置登录和分享回调板块中出现报错 我的版本("react-native": "0.70.6","react-native-wechat-lib": "^3.0.0") error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 E:\android-studio\AndroidProject\test\android\app\src\main\java\com\test\wxapi\WXEntryActivity.java:11: ����: �޷�����IWXAPIEventHandler WeChatLibModule.handleIntent(getIntent()); ^ �Ҳ���com.tencent.mm.opensdk.openapi.IWXAPIEventHandler�����ļ� 1 ������

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

这个问题在 3.0.1 版本中已经修复,请更新下

little-snow-fox commented 1 year ago

关于安卓的文档已经更新,并发布 3.0.1 版本 麻烦你贴出一下 IOS 的报错信息,添加哪行配置导致的? 我按照ios的要求都添加以后,重新pod install,干掉deriveddata再build,报错如下: The following build commands failed: CompileC /Users/user/Library/Developer/Xcode/DerivedData/app-euhunlbhmsglbggqqaaiaqdsetcf/Build/Intermediates.noindex/app.build/Debug-iphonesimulator/app.build/Objects-normal/x86_64/AppDelegate.o /Users/user/Dev/work/frontend/app_rn/ios/app/AppDelegate.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'app' from project 'app')

补充下我是0.71.1,不知道跟这个有没关系

我需要点时间排查下

surethink commented 1 year ago

0.71开始,appdelegate.h中 增加#import

@interface AppDelegate : UIResponder < WXApiDelegate > 改成了 @interface AppDelegate : RCTAppDelegate

不知道是否与此有关

ruijia168 commented 1 year ago

大佬 我安卓在支付回调模块中出现报错 我的版本("react-native": "0.70.6","react-native-wechat-lib": "^3.0.1") Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 E:\android-studio\AndroidProject\test\android\app\src\main\java\com\test\wxapi\WXPayEntryActivity.java:5: ����: �����com.theweflex.react������ import com.theweflex.react.WeChatModule; ^ E:\android-studio\AndroidProject\test\android\app\src\main\java\com\test\wxapi\WXPayEntryActivity.java:11: ����: �Ҳ������� WeChatModule.handleIntent(getIntent()); ^ ����: ���� WeChatModule λ��: �� WXPayEntryActivity 2 ������

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

little-snow-fox commented 1 year ago

你好, 我看了下 ios的WechatLibExample/AppDelegate.mm里面,并没有md里提到的要增加的配置?是不需要配置了?还是其它原因 直接复制进去,build 报错 麻烦更新下md,拜托拜托

ps,rn0.71版本已经出了,不知道是否需要特别适配呢?

多谢大佬的库,解民倒悬:)

麻烦你更新到 3.0.2 版本试下?该版本修复了很多跟 IOS 相关的问题

surethink commented 1 year ago

辛苦了。刚看另一个issue,已经装了3.0.3 问题一(ios): 0.71 AppDelegate.h现在是这样子的

import

import <UIKit/UIKit.h>

@interface AppDelegate : RCTAppDelegate

@end

md里的示例是这样的

import <React/RCTBridgeDelegate.h>

import <UIKit/UIKit.h>

import "WXApi.h"

@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, WXApiDelegate>

@property (nonatomic, strong) UIWindow *window;

@end

该怎么合起来呢?

问题二(android): build时报错:错误: 程序包com.theweflex.react不存在 错误的地方是WXPayEntryActivity里的 import com.theweflex.react.WeChatModule;

该怎么解决?

先谢为敬

little-snow-fox commented 1 year ago

辛苦了。刚看另一个issue,已经装了3.0.3 问题一(ios): 0.71 AppDelegate.h现在是这样子的 #import #import <UIKit/UIKit.h> @interface AppDelegate : RCTAppDelegate

@EnD

md里的示例是这样的

import <React/RCTBridgeDelegate.h> #import <UIKit/UIKit.h> #import "WXApi.h"

@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, WXApiDelegate>

@Property (nonatomic, strong) UIWindow *window;

@EnD

该怎么合起来呢?

问题二(android): build时报错:错误: 程序包com.theweflex.react不存在 错误的地方是WXPayEntryActivity里的 import com.theweflex.react.WeChatModule;

该怎么解决?

先谢为敬

这个问题我会在周末修复好

surethink commented 1 year ago

有进展不,大佬

little-snow-fox commented 1 year ago

有进展不,大佬

已发布 3.0.4 版本,目前安卓问题已修复,IOS 问题也进行了大规模修复,但 IOS 只完成实机运行和主动拉起微信的功能测试,其它测试我会继续进行,发现问题会尽快修复,会尽快推出正式版

surethink commented 1 year ago

多谢 装了3.0.4,android打包成功,但是模拟器运行报以下错误: E/MicroMsg.SDK.WXApiImplV10: register app failed for wechat app signature check failed

E/ReactNativeJS: Invariant Violation: "xxxx" has not been registered.

开始以为是因为模拟器上没微信,打release包装到真机上,打开就crash

检查了几遍,貌似都按要求搞的。麻烦给点提示,我是否还错过了什么

little-snow-fox commented 1 year ago

辛苦了! 装完新版android打包ok了,模拟器上跑时候报错register app failed for wechat app signature check failed。 导致错误 E/ReactNativeJS: Invariant Violation: "xxx" has not been registered. This can happen if: Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project. A module failed to load due to an error and AppRegistry.registerComponent wasn't called.

真机上打开app就crash

微信 SDK 无法在模拟器上跑,因为 CPU 架构不一样

little-snow-fox commented 1 year ago

多谢 装了3.0.4,android打包成功,但是模拟器运行报以下错误: E/MicroMsg.SDK.WXApiImplV10: register app failed for wechat app signature check failed

E/ReactNativeJS: Invariant Violation: "xxxx" has not been registered.

开始以为是因为模拟器上没微信,打release包装到真机上,打开就crash

检查了几遍,貌似都按要求搞的。麻烦给点提示,我是否还错过了什么

你可以下载样本工程编译出来试下,Dugkey 包括测试用的 appid 我也提交到 github 了

surethink commented 1 year ago

抱歉,是我的问题。我翻了一个非常愚蠢的错误