首页 > 解决方案 > React Native - RnDiffApp

问题描述

有谁知道它来自哪里以及它存储的目的是什么?我在文件中看到它在 Android 端android/app/BUCK

android_build_config(
    name = "build_config",
    package = "com.rndiffapp",
)

android_resource(
    name = "res",
    package = "com.rndiffapp",
    res = "src/main/res",
)

...在 IOS 方面,我到处都能看到它(及其引起的问题)...包括\myAppName\ios\myAppName\AppDelegate.m

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"RnDiffApp"
                                            initialProperties:nil];

我听说它react-native upgradern-diff-purge引擎盖下使用,我想知道我是否尝试react-native upgrade导致所有这些混乱。我想知道是否有办法撤消此操作,因为我在 Xcode 中构建时遇到了麻烦。请参见下文

No such file or directory: /xxx/myAppName/ios/RnDiffApp/main.m
No such file or directory: /xxx/myAppName/ios/RnDiffApp/AppDelegate.m

标签: react-nativereact-native-ios

解决方案


我最近在升级失败后发生了这种情况。查看您的 ios/Podfile 并将 RnDiffApp 的引用更改为 YourAppName。您还可以全局搜索可能受到影响的其他文件。就我而言,它只是 Podfile。

更新 Podfile 后,我发现需要以下命令:

cd ios
rm Podfile.lock
pod install
cd ..

推荐阅读