我安装了虚拟盒子.当我查看主机> LAN> IP地址是exp://192.168.56.1:19000.
如何在不禁用网络的情况下更改它?因为这是我的虚拟机ip,我的设备无法连接到它.
谢谢
我正在使用creat-react-native-app构建一个简单的React Native应用程序,仅使用react-navigation和base-64(base 64编码/解码)作为依赖项.随着时间的推移,应用程序变得越来越慢,现在有时候在运行NPM启动后,"正在启动打包程序......"会卡住(等待大约30分钟).
我尝试用"npm start - --reset-cache"启动它,但没有任何改变
一旦启动并运行,我就不会在DevTools或终端中收到任何错误或警告.此外,应用程序的性能也没有问题
我能做些什么才能让NPM像以前一样平稳快速地开始?我可以采取任何一般步骤来解决此问题吗?
这是我的package.json
{
"name": "test",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "~27.0.0",
"react-devtools": "^3.2.3",
"react-native-scripts": "1.14.0",
"react-test-renderer": "16.3.1"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "jest"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"base-64": "^0.1.0",
"expo": "^27.0.1",
"react": "16.3.1",
"react-native": "~0.55.2",
"react-navigation": "^2.11.2"
}
}
Run Code Online (Sandbox Code Playgroud) 尝试在 Macbook(2012 年中)上启动 expo 项目,出现以下错误:
*** -SimDevice _onBootstrapQueue_bootWithOptions:error:, SimDevice.m:2057 2021-12-25 21:21:29.751 simctl[3424:48740] 中断言失败 *** 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“启动设备时无法确定运行时包。”
我该如何解决?提前致谢。
> expo start --ios
Starting project at /Users/johngfisher/App
Developer tools running on http://localhost:19002
Starting Metro Bundler
xcrun exited with signal: SIGABRT
2021-12-25 21:21:29.748 simctl[3424:48740] *** Assertion failure in -[SimDevice _onBootstrapQueue_bootWithOptions:error:](), SimDevice.m:2057
2021-12-25 21:21:29.751 simctl[3424:48740] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to determine runtime bundle when booting device.'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff2f046727 __exceptionPreprocess + 250
1 …
Run Code Online (Sandbox Code Playgroud) 我正在考虑使用Expo在React Native中构建移动应用程序,我注意到在FAQ下现有的React Native项目可以转换为Expo.
我们究竟在转变什么?我真的很喜欢保持尽可能的纯净和干净,中间没有太多的抽象层,这可能会模糊我理解在应用程序中工作的真实情况的能力.
关于转换过程中真正发生的事情以及Expo正在为现有项目添加什么,我会更加清楚.
我需要修复这个错误。
不变违规:requireNativeComponent:在 UIManager 中找不到“RNGestureHandlerRootView”。
这个错误位于: 在RNGestureHandlerRootView(由GestureHandlerRootView创建)中 在GestureHandlerRootView(由StackView创建)中 在StackView(由StackView创建)中 在StackView中 在Unknown(由Navigator创建)中 在Navigator(由SceneView创建)中 在SceneView(由SwitchView创建)中在SwitchView(由Navigator创建)中 在Navigator(由NavigationContainer创建)中 在NavigationContainer(由ExpoRoot创建)中 在ExpoRoot中 在RCTView(由View创建)中 在View(由AppContainer创建)中 在RCTView(由View创建)中 在View(由AppContainer创建)中) 在 AppContainer 中
我在运行 Ventura 13.3.1 的 M1 Macbook 上安装了以下库:
$ nvm -v
0.39.3
$ node -v
v18.16.0
$ npm -v
9.6.4
$ npx expo -v
0.7.0
Run Code Online (Sandbox Code Playgroud)
我使用以下命令生成了一个新的博览会项目:
npx create-expo-app my-app --template
Run Code Online (Sandbox Code Playgroud)
我选择空白的 Typescript 模板。它生成了一个应用程序,然后我 cd 进入应用程序目录。当我运行时npx run web
,它首先要求我安装一些依赖项,然后我这样做:
npx expo install react-native-web@~0.18.10 react-dom@18.2.0 @expo/webpack-config@^18.0.1
Run Code Online (Sandbox Code Playgroud)
现在,当我尝试运行时npx run web
,出现以下错误:
/Users/paul/.npm/_npx/755986f37193a6d8/node_modules/run/run.js:127
if (minimatch(file, pattern)) {
^
TypeError: minimatch is not a function
Run Code Online (Sandbox Code Playgroud)
如何修复此错误并启动 expo 服务器?
我当时正在与一个小组一起开发 React Native 项目,并被要求在工作时使用 iPhone 13 模拟器作为模型。我只能访问iPhone 12模拟器,我看到我的XCode版本落后,所以我更新了它。现在,使用新的 XCode,当我启动 React Native 服务器并尝试打开 iOS 模拟器时,出现错误。错误如下所示:
根据建议运行此命令build with -s Assertions=1
会显示以下内容:
我的package.json如下:
知道发生了什么或如何继续吗?Expo 似乎可以运行,但尝试打开模拟器会使服务器崩溃。我正在进行的项目临近截止日期,我完全被这个问题耽搁了。无论是解决此错误的方法还是回滚我的 XCode 安装并仅使用过时的模拟器的方法都将不胜感激。
Unhandled promise rejection: Error: No native splash screen registered for given view controller. Call 'SplashScreen.show' for given view controller first.
当我第一次启动该应用程序时,仅在我的 ios 模拟器上收到以下警告。不在我的 ios 物理设备或 Android 模拟器上。我用于expo-splash-screen
我的闪屏。这是我可以忽略的事情还是我需要解决它,因为我不知道如何解决它。启动画面似乎加载良好。这是一个错误吗expo-splash-screen
?我按照世博会的教程进行设置。
警告:
[Unhandled promise rejection: Error: No native splash screen registered for given view controller. Call 'SplashScreen.show' for given view controller first.]
at node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:103:50 in promiseMethodWrapper
at node_modules/@unimodules/react-native-adapter/build/NativeModulesProxy.native.js:15:23 in moduleName.methodInfo.name
at node_modules/expo-splash-screen/build/SplashScreen.js:23:17 in hideAsync
at node_modules/expo-splash-screen/build/SplashScreen.js:19:7 in hideAsync
at [native code]:null in callFunctionReturnFlushedQueue
Run Code Online (Sandbox Code Playgroud)
索引.js
import React, { useState, …
Run Code Online (Sandbox Code Playgroud) 我正在与 Mosh 一起学习 React Native 课程(https://codewithmosh.com/)。我正在使用世博会。我对本机反应非常陌生,并不真正知道我在做什么,但我知道我的代码应该可以工作。我根据他的代码仔细检查了我的代码,甚至将我的项目复制到朋友的 mac 上,看看代码是否可以在 ios 上运行(因为 mosh 正在 ios 模拟器上运行他的代码)。在ios模拟器上,我的代码运行完美,但在android上,没有任何反应。
这是我实现可滑动本身的地方:
import React from 'react';
import { StyleSheet, View, Image, TouchableHighlight } from 'react-native';
import Swipeable from 'react-native-gesture-handler/Swipeable';
import AppText from './AppText';
import colors from '../config/colors';
function ListItem({title, subtitle, image, onPress, renderRightActions}) {
return (
<Swipeable renderRightActions={renderRightActions} >
<TouchableHighlight underlayColor={colors.light} onPress={onPress} >
<View style={styles.container} >
<Image style={styles.image} source={image} />
<View>
<AppText style={styles.title} >{title}</AppText>
<AppText style={styles.subTitle}>{subtitle}</AppText>
</View>
</View>
</TouchableHighlight>
</Swipeable>
);
}
Run Code Online (Sandbox Code Playgroud)
然后我将其导出到另一个屏幕:
function MessagesScreen(props) …
Run Code Online (Sandbox Code Playgroud) 我正在尝试将我的 React Native EXPO 应用程序提交到 Google Play 商店以获得批准,但我收到此错误:
SDK Segment Analytics Android (com.segment.analytics.android:analytics) 4.9.4 收集个人或敏感数据,包括但可能不限于广告 ID、Android ID 标识符。持久性设备标识符不得链接到用户数据政策中所述的其他个人和敏感用户数据或可重置设备标识符。
由于此政策问题,您无法发布此版本。为了获得发布许可,您可以考虑迁移到另一个SDK;删除此 SDK;或者(如果您的 SDK 提供商提供)升级到此 SDK 的符合策略且不包含违规代码的版本。
根据您的SDK提供商提供的信息,您可以考虑升级到4.10.1。请咨询 SDK 提供商以获取更多信息。
所需操作:上传新的合规版本并停用不合规版本。
我是 React Native 的新手。请帮忙。
expo ×10
react-native ×9
android ×2
firebase ×1
gesture ×1
ios ×1
javascript ×1
node.js ×1
npm-start ×1
npx ×1
react-native-gesture-handler ×1
xcode ×1