Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 如何在android studio上运行expo弹出应用程序_React Native_Expo - Fatal编程技术网

React native 如何在android studio上运行expo弹出应用程序

React native 如何在android studio上运行expo弹出应用程序,react-native,expo,React Native,Expo,我的应用程序在启动时崩溃 ejected expoKit java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gy.expoproject/host.exp.exponent.MainActivity}: java.lang.IllegalArgumentException: Invalid URL host: "" at android.app.ActivityThread.perfor

我的应用程序在启动时崩溃

ejected expoKit 
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gy.expoproject/host.exp.exponent.MainActivity}: java.lang.IllegalArgumentException: Invalid URL host: ""
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.IllegalArgumentException: Invalid URL host: ""
        at okhttp3.HttpUrl$Builder.parse(HttpUrl.java:1405)
        at okhttp3.HttpUrl.get(HttpUrl.java:916)
        at okhttp3.Request$Builder.url(Request.java:165)
        at host.exp.exponent.kernel.ExponentUrls.addExponentHeadersToUrl(ExponentUrls.java:45)
        at host.exp.exponent.kernel.ExponentUrls.addExponentHeadersToManifestUrl(ExponentUrls.java:57)
        at host.exp.exponent.ExponentManifest.fetchManifest(ExponentManifest.java:220)
        at host.exp.exponent.ExponentManifest.fetchManifest(ExponentManifest.java:204)
        at host.exp.exponent.AppLoader.fetchRemoteManifest(AppLoader.java:186)
        at host.exp.exponent.AppLoader.startTimerAndFetchRemoteManifest(AppLoader.java:182)
        at host.exp.exponent.AppLoader.startTimerAndFetchRemoteManifest(AppLoader.java:176)
        at host.exp.exponent.AppLoader.access$800(AppLoader.java:20)
        at host.exp.exponent.AppLoader$3.onError(AppLoader.java:153)
        at host.exp.exponent.ExponentManifest.fetchCachedManifest(ExponentManifest.java:274)
        at host.exp.exponent.AppLoader.start(AppLoader.java:91)
        at host.exp.exponent.experience.ExperienceActivity.onCreate(ExperienceActivity.java:241)
        at host.exp.exponent.experience.DetachActivity.onCreate(DetachActivity.java:35)
        at android.app.Activity.performCreate(Activity.java:7802)
        at android.app.Activity.performCreate(Activity.java:7791)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.app.ActivityThread.main(ActivityThread.java:7356) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

第一次运行expo start时,您将得到如下一行:

您的本机应用程序正在expa0d上运行。。。。。。。。。。。。。。。。。a://192.1………:19000

然后去

android\app\src\main\java\host\exp\exponent\MainActivity.java

您将找到一个名为
developmentUrl
的函数,其中包含以下行:

返回DetachBuildConstants.DEVELOPMENT\u URL

最后,用你得到的那条线替换它
返回“expa0d………..a://192.1………..19000;

更多信息。 我希望这对你有帮助