我正在尝试在我的设备上运行我的react本机应用程序.所以我运行react-native start
一切看起来很好.

并且在运行时react-native run-android我收到此错误

否则,我的设备出现此错误
我的问题是我给该项目的名称与AppRegistry中注册的名称不同
AppRegistry.registerComponent('proj', () => proj)
Run Code Online (Sandbox Code Playgroud)
proj 需要与gradle和config文件中的项目名称相同.
您需要导出该类。使用下面的代码
import React, { Component } from 'react'
import { AppRegistry, Text, View } from 'react-native'
export default class proj extends Component {
render() {
return (
<View style={styles.container}> <Text > Welcome to PutainDeBiere! </Text> </View> )
}
}
AppRegistry.registerComponent('proj', () => proj)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5941 次 |
| 最近记录: |