为什么app force在Android 6中关闭运行

时间:2018-05-19 18:54:34

标签: java php android forceclose

我开发了一个使用权限记录音频并发送到服务器的应用程序。

在android 4我的应用程序没有运行问题 但当我将应用程序发送到App Store时,他们说应用程序强制在android 6.0中关闭

这是我运行应用程序时的logcat:

class ViewController: UIViewController {

    //Outlets :
    @IBOutlet weak var refreshButton: UIBarButtonItem!
    @IBOutlet weak var mainButton: UIBarButtonItem!
    @IBOutlet weak var processingSwitch: UISwitch!
    @IBOutlet weak var probStepper: UIStepper!
    @IBOutlet weak var probSlider: UISlider!
    @IBOutlet weak var progressBar: UIProgressView!
    @IBOutlet weak var mainLabel: UILabel!
    @IBOutlet weak var labelMax: UILabel!
    @IBOutlet weak var labelPossibilties: UILabel!

    //Actions :
    @IBAction func refreshValues(_ sender: UIBarButtonItem) {
        probSlider.setValue(1, animated: true)
        probStepper.value = 2
        labelMax.text = String(probSlider.value)
        labelPossibilties.text = String(probStepper.value)
    }
    @IBAction func probaSlider(_ sender: UISlider) {labelMax.text = String(Double(Int(probSlider.value)))}
    @IBAction func probaStepper(_ sender: UIStepper) {labelPossibilties.text = String(UInt32(probStepper.value))}
    @IBAction func mainButton(_ sender: UIBarButtonItem) {bigNumbersLaw(processingSwitch.isOn, UInt32(probStepper.value), Double(Int(probSlider.value)))}

    //Variables :
    var repeatNumber:Double = 0
    var randomNumber:UInt32 = 0
    var probability:Double = 0
    var timesFound:Double = 0

    //Functions :
    func bigNumbersLaw(_ liveShow: Bool, _ poss: UInt32, _ max: Double) {

        while repeatNumber < max {
            repeatNumber += 1
            randomNumber = arc4random_uniform(poss)
            progressBar.progress = Float(repeatNumber/max)
            if randomNumber == 1 {
                timesFound += 1
            }
            probability = (timesFound/repeatNumber)
            if liveShow {mainLabel.text = String(probability)}
        }
        mainLabel.text = String(probability)
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        probStepper.maximumValue = 1000000
        probStepper.minimumValue = 2
        probSlider.maximumValue = 1000000
        probSlider.minimumValue = 1
    }
}

0 个答案:

没有答案