При обновлении проекта с 0.55.4 до 0.59.10 у меня возникают некоторые проблемы.Он может быть успешно построен, но после этого я показываю ошибку сервера узла.
Вот мой AppDelegate.m до обновления.Все в порядке.Приложение работает, как я и ожидал.
#import ...
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//some codes here...
NSURL *jsCodeLocation;
#ifdef DEBUG
NSString *url = @"http://localhost";
url = @"http://192.168.2.125";
NSString *urlBody = @":8081/index.bundle?platform=ios&dev=true";
NSString *urlFull = [NSString stringWithFormat:@"%@%@",url, urlBody];
jsCodeLocation = [NSURL URLWithString:urlFull];
#else
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#endif
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"Cloud9"
initialProperties:nil
launchOptions:launchOptions];
//some codes here...
}
//some codes here...
@end
А вот и AppDelegate.m после обновления до 0.59.10
#import ...
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//some codes here...
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"Cloud9"
initialProperties:nil
launchOptions:launchOptions];
//some codes here...
}
//some codes here...
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
NSString *url = @"http://localhost";
url = @"http://192.168.2.125";
NSString *urlBody = @":8081/index.bundle?platform=ios&dev=true";
NSString *urlFull = [NSString stringWithFormat:@"%@%@",url, urlBody];
return [NSURL URLWithString:urlFull];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
@end
Показывает эту ошибку
А это мой ip-адрес
Я что-то упустил?Кто-нибудь может мне помочь?Спасибо!