无法加载exp://出问题了 [英] Could not load exp:// Something went wrong

查看:119
本文介绍了无法加载exp://出问题了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Expo XDE创建了一个项目.我检查了此无法加载expo应用程序:出了点问题,但是我已经启用了在其他应用程序上绘图".当我扫描此文件时,它可以 https://expo.io/@ajaysaini/first-proj QR代码,但是当我在XDE的android设备上运行它时却没有.

I have created a project using Expo XDE. I checked this Can't load expo app: Something went wrong but I have already enabled "Draw over other apps". It works https://expo.io/@ajaysaini/first-proj when I scan this QR code but it doesn't when I run it on android device from XDE.

main.js

import Expo from 'expo';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

class App extends React.Component {
  render() {
    return (
      <View style={styles.container}>
        <Text>Updating!</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

Expo.registerRootComponent(App);

当我在设备上运行它时,它在android设备上显示以下错误.我尝试了多次在XDE中重新启动,但对我没有帮助.

When I am running it on device it shows below error on android device. I tried restart in XDE multiple times but it didn't help me.

Dependency graph loaded.
11:19:21 AM
Starting React Native packager...
11:19:24 AM
Scanning 528 folders for symlinks in D:\Expo\first-proj\first-proj\node_modules (18ms)
11:19:24 AM
Loading dependency graph.
11:19:24 AM
Running packager on port 19001.
11:19:25 AM
11:19:33 AM
Project opened! You can now use the "Share" or "Device" buttons to view your project.
11:19:44 AM
Opening on Android device
11:19:54 AM
Dependency graph loaded.
11:21:41 AM
Opening on Android device
11:23:31 AM
Opening on Android device

错误:

There was an unhandled error: Could not load exp://
Stack Trace:

任何人都可以帮我解决问题吗?

Can anyone help me what is going wrong ?

推荐答案

您最好打开XDE Client并启用开发模式.然后,点击灰色齿轮以创建 Host> LAN (局域网-意味着通过WiFi与实际设备共享软件包).

You better open XDE Client and enable development mode. Then, click on the gray cog to make Host > LAN (Local area network - which means sharing packages over WiFi with a real device).

Localhost选项也可以使用,但是根据 Expo Debugging文档:

Localhost option may work as well but according to Expo Debugging docs:

如果您使用的是LAN,请确保您的设备与开发计算机位于同一wifi网络上.在某些公共网络上,这可能不起作用.除非您在模拟器中,否则本地主机将无法在iOS上运行,并且只有在您的设备通过USB连接到计算机的情况下,本地主机才能在Android上运行.

If you are using LAN, make sure your device is on the same wifi network as your development machine. This may not work on some public networks. localhost will not work for iOS unless you are in the simulator, and it only works on Android if your device is connected to your machine via USB.

此外,这是我几个月前写的一个直观的,有启发性的答案,该答案也可能会有所帮助:

Also, here is a visual informative answer that I wrote a few months ago that may also help: How do I run an app on a real iOS device using Expo?

这篇关于无法加载exp://出问题了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆