我目前正在尝试在Android模拟器上运行ES6 react-native-webpack-server.不同之处在于我升级了我package.json并build.grade使用react 0.18.0,并且在启动时遇到此错误.据我所知AppRegistry,正确导入.即使我要注释掉代码,这个错误仍然会出现.这在iOS上没有问题.
我究竟做错了什么?
编辑:尝试其他支持0.18.0的样板后,我仍然遇到同样的问题.
我遇到了我们团队正在进行的共享github项目的问题.我一直在打击这个问题大约一个星期,现在没有任何运气.
问题是在我的团队计算机上运行的全新克隆,无法在我的计算机上正常运行.它抛出错误,"模块AppRegistry不是可调用模块".我正在开发一个ios项目.我删除了所有文件夹并重新开始.我创建了具有各种权限的新用户,但没有运气.
还有什么我想念的吗?谢谢!
Index.ios.js
const { AppRegistry } = require('react-native');
const setup = require('./app/setup');
AppRegistry.registerComponent('mobileapps', setup);
Run Code Online (Sandbox Code Playgroud)
Setup.js
import App from './index';
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import configureStore from './store';
const store = configureStore();
function setup() {
class Root extends Component {
render() {
return (
<Provider store={store}>
<App />
</Provider>
);
}
}
return Root;
}
module.exports = setup;
Run Code Online (Sandbox Code Playgroud) 在过去 1.5 天左右的时间里,我试图让 React-native-track-player 工作,但我就是无法实现它。无论我尝试什么,我总是会遇到相同的错误块:
\nERROR TypeError: null is not an object (evaluating \'TrackPlayer.RATING_HEART\')\nERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. \n This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.\nRun Code Online (Sandbox Code Playgroud)\n我使用react-native expo和 “正常” react-native(根据react-native docu)设置它。对于我尝试过的所有变体:JSTS
我根本找不到让反应导航工作的方法.我从互联网上复制了工作示例,但它们似乎也没有用.谁能告诉我我做错了什么.
我正在使用节点:8.9.4 react:16.3.0-alpha.1 react-native:0.54.0 react-navigation:^ 1.4.0
//index.js
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import {
TabNavigator,
StackNavigator
} from 'react-navigation';
import Home from './first';
import Homes from './second';
export default class demoApp extends Component {
render() {
return (
<SimpleNavigation/>
);
}
}
export const SimpleNavigation = StackNavigator({
Home: {
screen: Home,
header: { visible: false },
navigationOptions: {
title: 'Home',
header: null
},
},
Homes: {
screen: Homes,
navigationOptions: …Run Code Online (Sandbox Code Playgroud)