使用Android后退按钮重新启动应用程序后,热重装失败吗?

时间:2020-02-06 09:58:39

标签: flutter dart

在Android上以调试模式运行Flutter应用。按“后退”按钮关闭应用程序,然后使用任务开关将其切换回该应用程序。然后进行热装。

flutter_tools将引发异常:

 Exception from flutter run: NoSuchMethodError: Class 'NoSuchMethodError' has no instance method '[]'.
    Receiver: Instance of 'NoSuchMethodError'
    Tried calling: []("code")

1 个答案:

答案 0 :(得分:1)

经过多次尝试,我以此解决了以上错误。

  • 运行import React,{ Component } from 'react'; import { View, Text, StyleSheet, Platform } from 'react-native'; import { HeaderButtons, Item } from "react-navigation-header-buttons"; import HeaderButton from "../components/HeaderButton"; import { Avatar } from 'react-native-elements'; const OrderInformationScreen = props => { return( <View style={{ height: 150, backgroundColor: '#00BFFF', alignItems: 'center', justifyContent: 'center' }} > <Avatar size='large' overlayContainerStyle={{ backgroundColor: '#00BFFF' }} containerStyle={{ marginTop: 30 }} activeOpacity={0.2} rounded source={('../assets/up.png')} style={{ height: 120, width: 120, borderRdius: 60 }} /> <Avatar size='large' overlayContainerStyle={{ backgroundColor: '#00BFFF' }} containerStyle={{ marginTop: 30 }} activeOpacity={0.2} rounded source={('../assets/down.png')} style={{ height: 120, width: 120, borderRdius: 60 }} /> <View> <Text style={{ fontSize: 30 }}>Side Menu</Text> </View> </View> ); }; const styles = StyleSheet.create({}); export default OrderInformationScreen
  • 后已解决此问题

我希望这对某些人有帮助

相关问题