将Expokit从28更新到32后,RN应用导致“本地模块不能为空”

时间:2019-03-05 01:54:40

标签: ios react-native expo react-native-firebase

我正在按照expokit 32 AppDelegate文档将v28博览会升级到v32及其独立分支。

我终于在RN应用程序的非独立分支上完成了所有工作。现在,我正在尝试升级独立分支,但以下错误使我震惊。

Erro Log from simulator

当前设置:  -“ react-native”:expo中的sdk-32.0.0.tar.gz  -“ expo”:“ ^ 32.0.0”,  -expo-cli-版本2.11.6  -xcode 10.1  -火力基地  -“ babel-preset-expo”:“ ^ 5.0.0”,  -“ react-native-firebase”:“ ^ 5.0.0”,  -“ aws-amplify”:“ ^ 1.1.19”,

问题是我什至不了解该错误,更不用说如何处理了(expo-cli控制台中没有其他打印内容)。它指出了expo npm模块内的一些文件,./node_modules/expo/tools/hashAssetFiles.js。这对我没有任何意义:((

我的AppDelegate.m可能有问题吗?

这是我的

// Copyright 2015-present 650 Industries. All rights reserved.

#import "AppDelegate.h"
#import "Firebase.h"
#import "RNFirebaseNotifications.h"
#import "RNFirebaseMessaging.h"

@implementation AppDelegate

static NSString *const CUSTOM_URL_SCHEME = @"higuApp";

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    [FIRApp configure];
    [RNFirebaseNotifications configure];

    [application registerForRemoteNotifications];
    application.applicationIconBadgeNumber = 0;
  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
  [super applicationWillEnterForeground:application];
}

#pragma mark - Background Fetch

- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
  [super application:application performFetchWithCompletionHandler:completionHandler];
}

#pragma mark - Handling URLs

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
  return [super application:app openURL:url options:options];
}

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
  return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
}

#pragma mark - Notifications

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)token
{
  [super application:application didRegisterForRemoteNotificationsWithDeviceToken:token];
}

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)err
{
  [super application:application didFailToRegisterForRemoteNotificationsWithError:err];
}

- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{   
    [[RNFirebaseMessaging instance] didRegisterUserNotificationSettings:notificationSettings];
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler
{
    [[RNFirebaseNotifications instance] didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
  [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}

@end

任何建议都值得欢迎。

  • 我试图注释掉App.js中的所有内容并仅返回null,但问题仍然存在。

  • Google导致我遇到了一些由push notification引起的类似情况,但这并不是我的问题。 我尝试注释掉AppDelegate.m中的代码,但无济于事。

0 个答案:

没有答案