一直在寻找关于导航错误模块的解决方案。我尝试过重置缓存,删除nodu_modules,重新安装模块,但仍然不能工作。
错误的全部细节
Unable to resolve module `@react-navigation/native` from `src/App.js`: @react-navigation/native could not be found within the project.
Package.json
"@react-native-community/masked-view": "^0.1.9",
"native-base
我正在尝试建立反应原生项目的ios版本,android版本正在运行。我不能让ios版本在mac上运行,尝试使用expo,或者只使用模拟器。 ? 在运行expo start之后,以下是错误: Error: RNFirebase core module was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects `Podfile` and have run `pod install`.
Invariant Violation: "main"
当我尝试将本地图像的地址与存储在useState中的值连接起来时,我遇到了一个问题。
import React, { useState } from 'react';
import { ImageBackground, ScrollView } from 'react-native';
import { Container, Button, Text } from 'native-base';
import styles from './DescobertaGravidezStyle';
import Header from
我有一个组件,它使用来自react本机的Animated组件。我开始编写一个测试用例来模拟组件的onPress (它调用了其中包含Animated.timing的函数)和setState。
运行jest很好,但是测试从未停止运行,我以前写过的一个无关的测试用例现在似乎从未通过过(以前已经通过过)。
运行jest --watch时,我会得到以下错误:
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.
at Function.bezier (
尝试运行yarn test并尝试了许多节点版本(8和11)、react (57,58),但无法修复此错误。
FAIL __tests__/index.ios.js
● Test suite failed to run
/xyz/mobile-react/node_modules/react-native/jest/setup.js: babel-plugin-jest-hoist: The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables.
In
我在React Native中得到以下代码的错误: Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array object must have a [symbol.iterator]() method counter-context.js import React, {useState, createContext} from 'react'
export const CounterContext = createContext();
export co
react-native run-android在与react-native-ble-plx链接后失败
Task :react-native-ble-plx:compileDebugJavaWithJavac FAILED
这是一个新创建的应用程序,带有react-native init,除了min sdk没有改变任何东西。已经尝试清理项目,将min sdk设置为18,尝试使用android studio构建以获取更具体的错误,但仍然无法理解问题来自何处。
我得到的错误是:
Deprecated Gradle features were used in this build, making i
要让一个简单的jest测试正常工作,我有很多麻烦。Jest坚持认为我的Ajax调用没有发生,并显示以下错误消息:
FAIL authTest.js (1.828s)
● Authentication: Logging In › it Doesn't currently have a logged in user
- Expected Function to be called with { url : 'api/loggedin', type : 'GET', error : <jasmine.any(function Funct
在我写的东西似乎不起作用后,我将React Navigation的文档中的代码复制到了我的项目中。但是我仍然得到了相同的错误:undefined is not an object (evaluating 'route.key') 代码如下: import React from 'react'
import { NavigationContainer } from '@react-navigation/native'
import { createNativeStackNavigator } from '@react-navigation
我在另一个项目中遇到了问题,它指向了我正在使用的test导航抽屉,所以我决定打开一个测试文件,尝试重新创建这个问题。
我从ran导航网站复制代码并运行它,它给了我这个错误。
ERROR TypeError: undefined is not an object (evaluating 'InnerNativeModule.installCoreFunctions')
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplicatio
如何在Mac上卸载react-native-cli??
我尝试过npm uninstall react-native-cli,它给出了下面的结果。
npm WARN eslint-plugin-react@7.12.4 requires a peer of eslint@^3.0.0 || ^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-react-native@3.6.0 requires a peer of eslint@^
我正在尝试从运行示例代码
import * as React from 'react';
import {Text, View} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
function HomeScreen() {
return (
<View
我试图生成APK,但遇到了一个障碍,这是一个错误:
> Task :react-native-gesture-handler:generateReleaseRFile FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-gesture-handler:generateReleaseRFile'.
> Coul
我正在尝试使用从获取的画布,但是,在尝试生成时,WebView似乎创建了以下错误:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of 'Canvas'
我已经从包含画布的index.ios.js中附加了一个片段。任何关于WebView产生这个错误的原因的帮助都将是非常有用的(如果你移除WebView并离开视