在制作简单的本机反应程序时,我无法使<Button> 组件工作.我经常遇到的错误react-native run-android是
java.lang.String无法强制转换为com.facebook.react.uimanager.AccessibilityDelegateUtil $ AccessibilityRole
当我省略按钮时,一切正常,我可以单击文本就好了.
代码:
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, Button } from 'react-native';
type Props = {};
export default class App extends Component<Props> {
render() {
return (
<View style={styles.container}>
<Button onPress={()=>console.log('hi')} title="go"/>
<Text onPress={()=>console.log('hi')}>Welcome to React Native!</Text>
</View>
);
}
}
Run Code Online (Sandbox Code Playgroud)
一些依赖:
"dependencies": {
maar eens alles goed staat hoop ik gewoon dat de miserie gedaan is, cf "react": "16.6.0-alpha.8af6728",
"react-native": "0.57.3"
},
Run Code Online (Sandbox Code Playgroud) 我正在尝试制作android studio项目,
我在Android设备管理器中运行项目很好,但是当我尝试在真实设备上运行时,我有一些错误:
Error:Failed to capture snapshot of input files for task 'transformClassesWithInstantRunForDebug' property 'otherFileInputs' during up-to-date check.
> Failed to create MD5 hash for file 'C:\Users\psd1-pc\AppData\Local\Android\sdk\platforms\android-21\android.jar'.
Run Code Online (Sandbox Code Playgroud)
我的真实设备有Lollipop Android,我该怎么做才能解决这个问题
谢谢.