在下面的小吃中:
我收到了错误消息:
设备:(1002:881)无法解析模块‘模块://@expo/向量-图标/vector Awesome5.js’评估模块://@expo/Vector-图标/FonAwesome5.js评估模块://本机-base.js评估模块://App.js加载模块://App.js
我尝试过将@expo/vector-icons添加到package.json中,但我得到了:
package.json: (5:5) The package "@expo/vector-icons" can be imported without adding
我学习了jest,使用react-native & expo为组件编写了我的第一个快照测试。我可以在没有Icon组件的情况下运行测试,该组件来自我的组件中的'react-native-vector-icons/MaterialIcons‘。但是,当我尝试使用前面提到的图标组件运行测试时,我得到了以下错误:
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.
at Object.get Text [as Text] (node_mod
我正在使用bare react原生测试驱动开发,并使用包jest和酶。我为UI组件安装了NativeBase。当我使用来自NativeBase的图标时,我得到了错误
FAIL src/screens/Welcome/Welcome.test.js
● Test suite failed to run
/Users/../node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/AntDesign.ttf:1
({"Object.<anonymous>":functio
Google Play说。
阻塞我们检测到你的应用程序在一个或多个应用程序包或APK的清单文件中包含了requestLegacyExternalStorage标志。在运行Android 11+的设备上使用应用程序的开发人员必须使用作用域存储,以使用户更好地访问设备存储。若要在5月5日以后在Android 11或更高版本上发布应用程序,您必须在5月5日之后更新应用程序,以使用更加隐私友好的最佳实践,例如存储访问框架( Storage )或媒体存储API ( Media ),更新应用程序来声明清单文件中的所有文件访问权限(MANAGE_EXTERNAL_STORAGE)权限,并从5月5日起在游戏控
尝试使用https://github.com/callstack/react-native-testing-library + https://github.com/testing-library/jest-native进行一些单元测试,测试纯javascript文件没有问题,但在组件上测试时遇到以下错误: ● Test suite failed to run
Jest encountered an unexpected token
Details:
C:\Users\admin\Documents\my_project\node_modules\@expo\
我让Jest调试了很多次并运行了很多次。由于某种原因,在这个回购(我是新手)调试器将停止在jest.js
但不会停在测试本身。测试:
it('opens the drawer and presses the reset button', async () => {
debugger; // never stops here
console.log('test should have stopped');
我正在运行的命令:
✗ node --inspect-brk node_modules/.bin/jest --runIn
因此,我正在测试我的react本地应用程序,但它给了我这样的警告:
AsyncStorage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-async-storage/async-storage' instead of 'react-native'. See https://github.com/react-native-async
node_modules@expo\vector-icons\build\vendor\react-native-vector-icons\lib\create-icon-set.js:#不能被克隆。错误:#无法克隆。(节点:v8:260:7)在(D:\React\CanReel\node_modules@babel\core\lib\transformation\util\clone-deep.js:16:30) at normalizeFile (D:\React\CanReel\node_modules@babel\core\lib\transformation\normalize-fi
我正在尝试使用Storybook,带有expo和react-native-web。每当我尝试使用expo模块时,我都会得到以下错误
ERROR in ./node_modules/expo-linear-gradient/build/LinearGradient.js
Module not found: Error: Can't resolve './NativeLinearGradient' in '/Fleyver/front/node_modules/expo-linear-gradient/build'
@ ./node_modules/exp
我无法在Android上的世博环境上运行React本地应用程序;在我的Android手机上运行该应用程序时,它会抛出这个错误:
Something went wrong.
32.0.0 is not a valid sdk version. Options are 35.0.0, 34.0.0, 33.0.0, UNVERSIONED.
在我的iOS手机上,同样的应用程序在世博环境下也能很好地工作。
我从我的MAC启动‘世博开始’,并将两部手机连接到与我的MACBOOK相同的WIFI上。
这是我的app.json文件:
{
"expo": {
"name
为了使用jest进行单元测试,我用以下代码模拟了expo目录:
jest.mock('expo', () => {
const { View } = require('react-native');
const constantsMock = { // the camera class has constants defined on it
Type: {
back: 'BACK',
front: 'FRONT',
},
};
const cameraMock = Ob
我正在尝试用以下代码向我的堆栈导航器标题添加一个菜单类型的图标: import React, { Component } from 'react';
import { createStackNavigator, HeaderTitle } from '@react-navigation/stack';
import Home from '../HomeComponent';
import Button from 'react-native';
import {Icon} from 'react-native-vector
我有一个反应-本地应用程序,使用博览会。位置权限在android上工作,但在iOS上不起作用。在真正的iPhone (iOS 14.4.2版)上,它什么也不做。在模拟器上,我得到以下错误消息:
未处理的承诺拒绝:错误:执行此操作需要LOCATION_FOREGROUND权限。在node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:103:50 in promiseMethodWrapper at node_modules/@unimodules/react-native-adapter/build/NativeMo