Javascript React Native 31,New Appdelegate.m无要更改的本地主机:网络请求失败

Javascript React Native 31,New Appdelegate.m无要更改的本地主机:网络请求失败,javascript,ios,reactjs,react-native,Javascript,Ios,Reactjs,React Native,我刚刚升级到react-native的最新版本(31),我的应用程序一直在工作,现在已经不工作了。每次我从获取中获取网络请求失败错误 AppDelegate.m已更改,并且没有要更改的localhost或127.0.0.1 它放在别的地方了吗 AppDelegate.m: #导入“AppDelegate.h” #导入“RCTBundleURLProvider.h” #导入“rctroutview.h” @实现AppDelegate -(BOOL)应用程序:(UIApplication*)应用程序

我刚刚升级到react-native的最新版本(31),我的应用程序一直在工作,现在已经不工作了。每次我从获取中获取网络请求失败错误

AppDelegate.m已更改,并且没有要更改的localhost或127.0.0.1

它放在别的地方了吗

AppDelegate.m:
#导入“AppDelegate.h”
#导入“RCTBundleURLProvider.h”
#导入“rctroutview.h”
@实现AppDelegate
-(BOOL)应用程序:(UIApplication*)应用程序使用选项完成启动:(NSDictionary*)启动选项
{
NSURL*jsCodeLocation;
jsCodeLocation=[[RCTBundleURLProvider sharedSettings]jsBundleURLForBundleRoot:@“index.ios”fallbackResource:nil];
RCTRootView*rootView=[[RCTRootView alloc]initWithBundleURL:jsCodeLocation
模块名称:@“开放校园”
initialProperties:无
启动选项:启动选项];
rootView.backgroundColor=[[UIColor alloc]initWithRed:1.0f绿色:1.0f蓝色:1.0f alpha:1];
self.window=[[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
UIViewController*rootViewController=[UIViewController新建];
rootViewController.view=rootView;
self.window.rootViewController=rootViewController;
[self.window makeKeyAndVisible];
返回YES;
}
@结束
我找到了解决方案。“允许任意加载”已从info.plist中删除。它应该被添加到info.plist,值应该是“是”,否则应用程序无法访问互联网

更多信息: