Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black Screen Showing when released as APK #87

Open
selvananbu opened this issue Jan 15, 2021 · 1 comment
Open

Black Screen Showing when released as APK #87

selvananbu opened this issue Jan 15, 2021 · 1 comment

Comments

@selvananbu
Copy link

Everything works well in debug mode but when i tried to release an APK it shows a black screen can any one help on this.The following is the component i use

       <View style={isDarkMode ? styles.containerDark: styles.container}>
        <View  style={{  width: width(95), height: height(50),alignItems:"center",justifyContent:"center" }} >
        {this.state.image 
        ?
          <Image style={{  width: width(95), height: height(45) }}  source={{ uri:this.state.image}} resizeMode="contain" /> 
          :
          <Scanner
            useBase64
            onPictureTaken={data => this.setState({ image: data.croppedImage })}
            overlayColor="rgba(255,130,0, 0.7)"
            enableTorch={this.state.flashEnabled}
            useFrontCam={this.state.useFrontCam}
            brightness={0.2}
            saturation={0}
            quality={0.5}
            contrast={1.2}
            onRectangleDetect={({ stableCounter, lastDetectionType }) => this.setState({ stableCounter, lastDetectionType })}
            detectionCountBeforeCapture={10}
            detectionRefreshRateInMS={50}
            style={styles.scanner}
          />
        }
        </View>
        
        {this.state.image === null ?
          <View style={{width:width(99),height:height(20),alignItems:"center",justifyContent:"space-evenly",flexDirection:"row"}}>
            </View>
             :
          <View style={{width:width(99),height:height(10),alignItems:"center",justifyContent:"space-evenly",flexDirection:"row"}}>
          <TouchableOpacity style={{backgroundColor:isDarkMode ? "#023056" : "#023056",height:height(8),alignItems:"center",justifyContent:"center",width:width(45),borderRadius:12}} onPress={() => this.setState({ image: "" })}>
            <Text style={{color:isDarkMode?colors.textColorDark:colors.textColor,fontSize:14,fontFamily:mainFont.medium}}>Take another picture</Text>
          </TouchableOpacity>
          <TouchableOpacity style={{backgroundColor:isDarkMode ? "#023056" : "#023056",height:height(8),alignItems:"center",justifyContent:"center",width:width(30),borderRadius:12}} onPress={this.onSavePressed.bind(this)}>
            <Text style={{color:isDarkMode?colors.textColorDark:colors.textColor,fontSize:14,fontFamily:mainFont.medium}}>Save</Text>
          </TouchableOpacity>
          </View>
        }

        <TouchableOpacity style={[styles.button, styles.left,{backgroundColor:isDarkMode ? "#023056" : "#023056"}]} onPress={() => this.setState({ flashEnabled: !this.state.flashEnabled })}>
          <Text style={{color:isDarkMode ? colors.textColorDark : colors.textColor}}>📸 Flash</Text>
        </TouchableOpacity>
        <TouchableOpacity style={[styles.button, styles.right,{backgroundColor:isDarkMode ? "#023056" : "#023056"}]} onPress={() => this.setState({ useFrontCam: !this.state.useFrontCam })}>
          <Text style={{color:isDarkMode ? colors.textColorDark : colors.textColor}}>📸 Front Cam</Text>
        </TouchableOpacity>
      </View>

Screenshot_2021-01-15-20-14-35-71_eee9b64344c01a06f2ab3c12ecc3baf6
`

@mohdaamir8182
Copy link

mohdaamir8182 commented Mar 25, 2021

DUE TO PERMISSIONS ISSUE:

: If you see black screen then it is due to permissions. Allow the permissions manually or using a library totally up to you.
: after allowing permissions everything will work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants