博览会:安装独立APK后出现错误

时间:2019-03-30 06:32:52

标签: javascript android react-native expo

我刚打完expo build:android,当我将APK安装到设备上时,当我通过expo start运行APK时,它却可以正常工作,但是当我尝试创建一个独立应用程序时(遵循Expo中的文档)它显示了一个错误(下面的截图)

这是我的app.json(即开箱即用的设置):

{
  "expo": {
    "name": "MyApp",
    "slug": "myapp-expo",
    "privacy": "public",
    "sdkVersion": "32.0.0",
    "platforms": [
      "ios",
      "android"
    ],
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "cover",
      "backgroundColor": "#faed2b"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": false
    },
    "android": {
      "package": "com.doman.application"
    }
  }
}

我的javascript仅包含以下内容:

import React from 'react';
import {Button, Text, TextInput, View, Image } from 'react-native';
import {layouting, typography, colors, inputs} from './theme/theme';
export default class App extends React.Component {

  constructor(props){
    super(props);

    this.state = {
      inputFocus: {
        email:false,
        password:false
      }
    }
  }

  focusInput = (key) => {
    this.setState((prevState) => {
      prevState.inputFocus[key] = true;

      return prevState;
    })
  }

  blurOutput = (key) => {
    this.setState((prevState) => {
      prevState.inputFocus[key] = false;

      return prevState;
    })
  }

  focusStyle = (value) => {
    if(value) return colors.white;

    return colors.offColor;
  }

  login = (e) => {
    return e;
  }

  render() {
    return (
      <View style={layouting.loginContainer}>
        <View style={{padding:30,alignItems:'center'}}>
          <Image style={{width:75,height:75,marginLeft:10}} source={require('./assets/transparentIcon.png')} />
        </View>
        <View style={layouting.loginBox}>
          <TextInput keyboardType='email-address' textContentType='emailAddress' placeholder="Email address" onBlur={(e) => this.blurOutput('email')} onFocus={(e) => this.focusInput('email')} style={{borderBottomColor:this.focusStyle(this.state.inputFocus.email),borderBottomWidth:2,paddingTop:10,paddingBottom:5,paddingLeft:5,paddingRight:15,marginBottom:15,color:'#fff',fontSize:16}} placeholderTextColor='rgba(255,255,255,0.7)'/>
          <TextInput secureTextEntry={true} textContentType='password' placeholder="Password" onBlur={(e) => this.blurOutput('password')} onFocus={(e) => this.focusInput('password')} style={{borderBottomColor:this.focusStyle(this.state.inputFocus.password),borderBottomWidth:2,paddingTop:10,paddingBottom:5,paddingLeft:5,paddingRight:15, marginBottom:30,color:'#fff',fontSize:16}} placeholderTextColor='rgba(255,255,255,0.7)' />
          <Button title='Login' color={colors.brandYellow} onPress={(e) => this.login(e)} />
        </View>
      </View>
    );
  }
}

enter image description here

0 个答案:

没有答案