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

The app has finished running #12

Closed
james-145 opened this issue Jul 16, 2016 · 11 comments
Closed

The app has finished running #12

james-145 opened this issue Jul 16, 2016 · 11 comments

Comments

@james-145
Copy link
Contributor

I've got the app connected and working fine but after anywhere from 3 minutes to 15 minutes it will just stop and display 'the app has finished running in xcode' I'm not sure where any debugs logs are that I can send you.

When the app 'finishes' I get sent straight back to my home location which is bound to cause some alarmbells :)

@james-145
Copy link
Contributor Author

james-145 commented Jul 16, 2016

The only issues I have are two warnings -

The provisioning profile "iOS Team Provisioning Profile: com.nameichose" is expiring soon
and

Warning: skipping file '/var/folders/3q/4lt7sqgd1fj27b6gbwkht8lc0000gn/T/tmp-61155lMmEQI3B4ej4/pokemonLocation.gpx' (unexpected file type 'text' in Frameworks & Libraries build phase)

I'm running xcode 7.3.1

@iam4x
Copy link
Owner

iam4x commented Jul 17, 2016

I receive the issue also, can you open the Xcode debugger console and see what message do you have when it quits. For instance I have:

 Message from debugger: Terminated due to memory issue

I don't really know what to do since the app is a blank page ¯_(ツ)_/¯

@james-145
Copy link
Contributor Author

I have the same

Message from debugger: Terminated due to memory issue

Probably a memory leak issue somewhere

http://stackoverflow.com/questions/19203790/is-it-possible-to-debug-terminated-due-to-memory-error has some suggestions

Apart from this, this is a great app :) really nice work

@iam4x
Copy link
Owner

iam4x commented Jul 18, 2016

Thank's to my iOS dev co-worker @favret I have enabled background running mode for the app, it should not crash anymore. Will update release today, I want to finish #10 in it also 👍

@iam4x iam4x closed this as completed Jul 18, 2016
@iam4x
Copy link
Owner

iam4x commented Jul 19, 2016

@danielsantiago
Copy link

I'm still having the same issue "Message from debugger: Terminated due to memory issue" using the lastest version (v1.1.0), iPhone 6, iOS 9.3.2

@danielsantiago
Copy link

@danielsantiago
Copy link

danielsantiago commented Jul 20, 2016

The solution is to play a blank mp3 on the background, I tried it and I was able to play for more than one hour without any memory issue. I'm not very familiar with Xcode so I'm going to show how I do it and I hope someone with more experience can create a pull request.

  1. Project > Capabilities > Background Modes: Mark only "Audio, Airplay, and Picture in Picture"
  2. Project > Build Phases > Link Binary with Libraries: Add "AudioToolbox.framework" and "AVFoundation.framework"
  3. Add a blank mp3 (http://www.xamuel.com/blank-mp3s/) named "silence.mp3" to the project
  4. Overwrite "ViewController.m" with the following code:
//
//  ViewController.m
//  pokemon-webspoof
//
//  Created by iam4x on 15/07/2016.
//  Copyright © 2016 iam4x. All rights reserved.
//

#import "ViewController.h"
#import "AVFoundation/AVFoundation.h"
#import "AudioToolbox/AudioToolbox.h"

@interface ViewController () <AVAudioPlayerDelegate> {
    AVAudioPlayer *_silenceBgPlayer;   // strong reference
}

@end

@implementation ViewController

- (void)viewDidLoad {
    NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"silence" ofType:@"mp3"]];
    _silenceBgPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil];
    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
    [[AVAudioSession sharedInstance] setActive: YES error: nil];
    [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
    _silenceBgPlayer.numberOfLoops = -1;
    [_silenceBgPlayer play];

    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

I got the idea from: kahopoon/Pokemon-Go-Controller#21 (comment)

@Abeldvlpr
Copy link
Contributor

Working on this implementation

iam4x pushed a commit that referenced this issue Jul 21, 2016
* Resolves #38

* Added background audio to fix #76 and #12

* Change iOS application name
@boonaloo
Copy link

I am still having this issue. The app will close with the same memory message.

@Feri90
Copy link

Feri90 commented Jul 26, 2016

Step 1 and 2 make sense and I know how to do it.
But Step 3 and 4 is quite difficult for me.

I don't know where I can add a silence-MP3 to the project and I can't find ViewController.m
Just a ViewController.swift file

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

No branches or pull requests

6 participants