fadelakin / vortex

a simple weather app for android
MIT License
9 stars 1 forks source link

I can't open the aplicaton #1

Open logos88 opened 9 years ago

logos88 commented 9 years ago

Hello. I have installed Vortex from F-droid in a Moto G LTE with Android 4.4.4 and when I try to open it it says "The aplication has been stopped". I have tried to reboot the smartphone, but the issue still persist. I have tried with GPS activated and without it too.

fadelakin commented 9 years ago

@logos88 that's odd. i don't really know what could be the problem since it should run on devices 4.0 and above. i probably have to test on other devices and get a feeling for what's wrong since it opens and runs fine on my nexus 5.

EDIT: you need GPS & network for it to work iirc. because it chooses the best one to use for location. but i'll look into it.

logos88 commented 9 years ago

I have tried with my fathers phone and happens the same. Is a Jiayu F1 with android 4.4.2. By the way, is there no option to choose a location to use without GPS activated? That would be very useful

fadelakin commented 9 years ago

@logos88 i'll look into your problem and see what i can do. it might just be the model of your phone. there's a way to choose a location using the network rather than gps but the app automatically does that. the only caveat is that you'd still have to turn on your location.

but like i said, i'll look into it.

maninthemiddle01 commented 9 years ago

For me its the same problem: "The aplication has been stopped". I use Motorola Defy+ with CM11

DocSniper commented 9 years ago

Same problem here with the F-Droid build. I'm using a LG G2 with CM12.

fadelakin commented 9 years ago

@maninthemiddle01 @sniperle I'll be buying a OPO at the end of this month and that comes with CM11 or CM12 so I'll be able to debug and see if it's the operating system. I'm looking into the problems specified. I just need some time since I'm busy right now.

MafiaInc commented 9 years ago

I have the same problem using Samsung Glaxy S5 with Android 5.0

DocSniper commented 9 years ago

Does a Logcat help ?

04-21 10:57:35.270 I/ActivityManager(2216): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.fisheradelakin.vortex cmp=com.fisheradelakin.vortex/.ui.MainActivity} from uid 10137 on display 0 04-21 10:57:35.340 I/ActivityManager(2216): Start proc com.fisheradelakin.vortex for activity com.fisheradelakin.vortex/.ui.MainActivity: pid=11835 uid=10364 gids={50364, 9997, 3003} abi=armeabi-v7a 04-21 10:57:35.510 W/System.err(11835): at com.fisheradelakin.vortex.ui.MainActivity.i(Unknown Source) 04-21 10:57:35.510 W/System.err(11835): at com.fisheradelakin.vortex.ui.MainActivity.k(Unknown Source) 04-21 10:57:35.510 W/System.err(11835): at com.fisheradelakin.vortex.ui.MainActivity.l(Unknown Source) 04-21 10:57:35.510 W/System.err(11835): at com.fisheradelakin.vortex.ui.MainActivity.onCreate(Unknown Source) 04-21 10:57:35.520 E/AndroidRuntime(11835): Process: com.fisheradelakin.vortex, PID: 11835 04-21 10:57:35.520 E/AndroidRuntime(11835): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.fisheradelakin.vortex/com.fisheradelakin.vortex.ui.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference 04-21 10:57:35.520 E/AndroidRuntime(11835): at com.fisheradelakin.vortex.ui.MainActivity.k(Unknown Source) 04-21 10:57:35.520 E/AndroidRuntime(11835): at com.fisheradelakin.vortex.ui.MainActivity.l(Unknown Source) 04-21 10:57:35.520 E/AndroidRuntime(11835): at com.fisheradelakin.vortex.ui.MainActivity.onCreate(Unknown Source) 04-21 10:57:35.530 W/ActivityManager(2216): Force finishing activity com.fisheradelakin.vortex/.ui.MainActivity 04-21 10:57:36.060 W/ActivityManager(2216): Activity pause timeout for ActivityRecord{1c18b16a u0 com.fisheradelakin.vortex/.ui.MainActivity t18642 f} 04-21 10:57:37.200 I/ActivityManager(2216): Process com.fisheradelakin.vortex (pid 11835) has died

fadelakin commented 9 years ago

@MafiaInc make sure your location is turned on. @sniperle thanks for the logcat info. i've added a new release to the release channel. if it still doesn't open, send me the logcat info if you can get it. let me know if the new build fixes it for you. if not, i'll have to keep working on it then.

cc @logos88 @maninthemiddle01

EDIT: and make sure your location is turned on. the app should display a dialog if your location is not turned on though.

DocSniper commented 9 years ago

Still waiting for F-Droid to update to 2.0.1 .... after that I will give you a report here.

DocSniper commented 9 years ago

Update to 2.0.2 arrived, but nothing changed. Here the logcat:

04-27 13:57:57.178 I/Timeline(2888): Timeline: Activity_launch_request id:com.fisheradelakin.vortex time:39483360 04-27 13:57:57.178 I/ActivityManager(2209): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.fisheradelakin.vortex/.ui.MainActivity (has extras)} from uid 10009 on display 0 04-27 13:57:57.258 I/ActivityManager(2209): Start proc com.fisheradelakin.vortex for activity com.fisheradelakin.vortex/.ui.MainActivity: pid=2421 uid=10366 gids={50366, 9997, 3003} abi=armeabi-v7a 04-27 13:57:57.578 W/System.err(2421): at com.fisheradelakin.vortex.ui.MainActivity.j(Unknown Source) 04-27 13:57:57.578 W/System.err(2421): at com.fisheradelakin.vortex.ui.MainActivity.l(Unknown Source) 04-27 13:57:57.578 W/System.err(2421): at com.fisheradelakin.vortex.ui.MainActivity.m(Unknown Source) 04-27 13:57:57.578 W/System.err(2421): at com.fisheradelakin.vortex.ui.MainActivity.onCreate(Unknown Source) 04-27 13:57:57.578 E/AndroidRuntime(2421): Process: com.fisheradelakin.vortex, PID: 2421 04-27 13:57:57.578 E/AndroidRuntime(2421): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.fisheradelakin.vortex/com.fisheradelakin.vortex.ui.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference 04-27 13:57:57.578 E/AndroidRuntime(2421): at com.fisheradelakin.vortex.ui.MainActivity.l(Unknown Source) 04-27 13:57:57.578 E/AndroidRuntime(2421): at com.fisheradelakin.vortex.ui.MainActivity.m(Unknown Source) 04-27 13:57:57.578 E/AndroidRuntime(2421): at com.fisheradelakin.vortex.ui.MainActivity.onCreate(Unknown Source) 04-27 13:57:57.588 W/ActivityManager(2209): Force finishing activity com.fisheradelakin.vortex/.ui.MainActivity 04-27 13:57:58.128 W/ActivityManager(2209): Activity pause timeout for ActivityRecord{310a4142 u0 com.fisheradelakin.vortex/.ui.MainActivity t19732 f} 04-27 13:57:58.888 I/ActivityManager(2209): Process com.fisheradelakin.vortex (pid 2421) has died

logos88 commented 9 years ago

I have installed the 2.0.2 version from F-Droid and still can't open. I have tried to install it from Google Play and then I can open the app, but it says "Please turn on your Location" continually despite to have the location turned on (and to be in an open place).

I tried the 2.0 version in both, f-droid and google play, and neither of them opened. So now has improved in one at least :D

fadelakin commented 9 years ago

@logos88 i rewrote the location code to use either gps or cellular network to get your current location. So if you switch your location to battery saving mode, it will use the cellular network to get your location and if you switch it to high accuracy, it will use the gps to get your location, same with device only. I'm not sure if that would fix the location issues but it should be a start. I pushed a new update for the new build. It should be live in a couple hours in Google Play. I don't know how long it would take to update on FDroid though. If you still run into problems, then honestly, I don't know what it could be. Maybe you could try going through logcat like @sniperle and see what causes the problem if you can. If you don't want to wait for the updates, you can just download the apk here: https://github.com/fadelakin/vortex/releases/tag/2.0.3

@sniperle i see that the problem is a null pointer exception for you but I don't see where it's coming from because I don't use the .length() method on any of my strings. Is that the entire output for logcat? What you should be seeing is something like below in the logcat but I don't know if my log messages are displayed in the signed apk. You can try filtering out the logcat output. I have a new build added to the release channel so you can try that again I guess. If you don't want to wait for the updates, you can just download the apk here: https://github.com/fadelakin/vortex/releases/tag/2.0.3

I/MainActivity(19874): Provider: gps, Accuracy: 11.0
V/MainActivity(19874): {"latitude":41.6973876,"longitude":-86.0847076,"timezone":"America/Indiana/Indianapolis","offset":-4,"currently":{"time":1430153067,"summary":"Mostly Cloudy","icon":"partly-cloudy-day","nearestStormDistance":146,"nearestStormBearing":54,"precipIntensity":0,"precipProbability":0,"temperature":50.53,"apparentTemperature":50.53,"dewPoint":36.56,"humidity":0.59,"windSpeed":13.63,"windBearing":330,"visibility":10,"cloudCover":0.66,"pressure":1017.7,"ozone":375.65},"minutely":{"summary":"Mostly cloudy for the hour.","icon":"partly-cloudy-day","data":[{"time":1430153040,"precipIntensity":0,"precipProbability":0},{"time":1430153100,"precipIntensity":0,"precipProbability":0},{"time":1430153160,"precipIntensity":0,"precipProbability":0},{"time":1430153220,"precipIntensity":0,"precipProbability":0},{"time":1430153280,"precipIntensity":0,"precipProbability":0},{"time":1430153340,"precipIntensity":0,"precipProbability":0},{"time":1430153400,"precipIntensity":0,"precipProbability":0},{"time":1430153460,"precipIntensity":0,"precipProbability":0},{"time":1430153520,"precipIntensity":0,"precipProbability":0},{"time":1430153580,"precipIntensity":0,"precipProbability":0},{"time":1430153640,"precipIntensity":0,"precipProbability":0},{"time":1430153700,"precipIntensity":0,"precipProbability":0},{"time":1430153760,"precipIntensity":0,"precipProbability":0},{"time":1430153820,"precipIntensity":0,"precipProbability":0},{"time":1430153880,"precipIntensity":0,"precipProbability":0},{"time":1430153940,"precipIntensity":0,"precipProbability":0},{"time":1430154000,"precipIntensity":0,"precipProbability":0},{"time":1430154060,"precipIntensity":0,"precipProbability":0},{"time":1430154120,"precipIntensity":0,"precipProbability":0},{"time":1430154180,"precipIntensity":0,"precipProbability":0},{"time":1430154240,"precipIntensity":0,"precipProbability":0},{"time":1430154300,"precipIntensity":0,"precipProbability":0},{"time":1430154360,"precipIntensity":0,"precipProbability":0},{"time":1430154420,"precipIntensity":0,"precipProbability":0},{"time":1430154480,"precipIntensity":0,"precipProbability":0},{"time":1430154540,"precipIntensity":0,"precipProbability":0},{"time":1430154600,"precipIntensity":0,"precipProbability":0},{"time":1430154660,"precipIntensity":0,"precipProbability":0},{"time":1430154720,"precipIntensity":0,"precipProbability":0},{"time":1430154780,"precipIntensity":0,"precipProbability":0},{"time":1430154840,"precipIntensity":0,"precipProbability":0},{"time":1430154900,"precipIntensity":0,"precipProbability":0},{"time":1430154960,"precipIntensity":0,"precipProbability":0},{"time":1430155020,"precipIntensity":0,"precipProbability":0},{"time":1430155080,"precipIntensity":0,"precipProbability":0},{"time":1430155140,"precipIntensity":0,"precipProbability":0},{"time":1430155200,"precipIntensity":0,"precipProbability":0},{"time":1430155260,"precipIntensity":0,"precipProbability":0},{"time":1430155320,"precipIntensity":0,"precipProbability":0},{"time":1430155380,"precipIntensity":0,"precipProbability":0},{"time":1430155440,"precipIntensity":0,"precipProbability":0},{"time":1430155500,"precipIntensity":0,"precipProbability":0},{"time":1430155560,"precipIntensity":0,"precipProbability":0},{"time":1430155620,"precipIntensity":0,"precipProbability":0},{"time":1430155680,"precipIntensity":0,"precipProbability":0},{"time":1430155740,"precipIntensity":0,"precipProbability":0},{"time":1430155800,"precipIntensity":0,"precipProbability":0},{"time":1430155860,"precipIntensity":0,"precipProbability":0},{"time":1430155920,"precipIntensity":0,"precipProbability":0},{"time":1430155980,"precipIntensity":0,"precipProbability":0},{"time":1430156040,"precipIntensity":0,"precipProbability":0},{"time":1430156100,"precipIntensity":0,"precipProbability":0},{"time":1430156160,"precipIntensity":0,"precipProbability":0},{"time":1430156220,"precipIntensity":0,"precipProbability":0},{"time":1430156280,"precipIntensity":0,"precipProbability":0},{"time":1430156340,"precipIntensity":0,"precipProbability":0},{"time":1430156400,"precipIntensity":0
DocSniper commented 9 years ago

Your version is working great as every version before, just only the f-droid version has this problem. Here the logcat from your apk:

04-27 19:23:34.606 I/Timeline(2888): Timeline: Activity_launch_request id:com.fisheradelakin.vortex time:55656723 04-27 19:23:34.606 I/ActivityManager(2209): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.fisheradelakin.vortex/.ui.MainActivity (has extras)} from uid 10009 on display 0 04-27 19:23:34.676 I/ActivityManager(2209): Start proc com.fisheradelakin.vortex for activity com.fisheradelakin.vortex/.ui.MainActivity: pid=22471 uid=10370 gids={50370, 9997, 3003} abi=armeabi-v7a 04-27 19:23:38.136 I/ActivityManager(2209): Displayed com.fisheradelakin.vortex/.ui.MainActivity: +3s495ms 04-27 19:23:38.136 I/Timeline(2209): Timeline: Activity_windows_visible id: ActivityRecord{283d1d82 u0 com.fisheradelakin.vortex/.ui.MainActivity t19775} time:55660256 04-27 19:23:49.336 W/PackageManager(2534): Failure retrieving resources for com.fisheradelakin.vortex: Resource ID #0x0

Another problem in this version is the GPS activation. When this version is running GPS is turned on and eats my battery. How about using the approximate location as default and only if it is not available switching to GPS. This should be fine for a weather based location look up. :-)

fadelakin commented 9 years ago

@sniperle you don't have to turn GPS on in this new version. You can put your location in battery saving mode and it will use your cellular networks to get your location instead. And I honestly have no idea what could be wrong with the F-Droid version when my version straight from Github works fine.

DocSniper commented 9 years ago

You are right, but if I'd choose battery saving mode then routing and maps applications are no more working without switching the location setting manally to high accuracy before using them and switching back to battery saving after.

Ridiculous why the f-droid build has this problem.

fadelakin commented 9 years ago

@sniperle that's the thing about android though. Vortex is just using what the user provides. When the user navigates away from the screen, it records the last known location and stops using the GPS or cellular network. If Vortex were a widget and it was constantly getting data back from the server, then it'd make sense to switch things around but because you have to open it and then it makes the request, getting whatever the user is using for their location is fine. The choice is up to you. If your location is set to high accuracy by default since you need to use maps then just leave it. My location is usually in battery saving and I switch to high accuracy when I need to use Maps for driving directions or other things. I'll look into doing approximate location though to reduce the stress on the battery.

As for the f-droid build, I don't know if they're changing something in my code or what. The .apk file should be what's uploaded and should remain the same. What happens between taking my build and putting into f-droid, I don't know. I don't get how my build would work fine for you but the f-droid build won't.

DocSniper commented 9 years ago

Then we better change the status from bug to problem is caused by external package builder ;-)

DocSniper commented 9 years ago

Oh, and the location mode high accuracy is using GPS, WiFi and mobile networks to determine the location, but not forcibly GPS only.

fadelakin commented 9 years ago

@sniperle if the high accuracy is using all those 3 then I guess I better rework mine then. I'll look into int and get back to you. I think the problem is that it chooses the BEST one to get the location and usually GPS is the best way to get your location so it goes with that. Just like how it switches to using the cellular networks when you're in battery saving because it's what is best. But like I said, I'll look into it.

ghost commented 9 years ago

As for the f-droid build, I don't know if they're changing something in my code or what. The .apk file should be what's uploaded and should remain the same. What happens between taking my build and putting into f-droid, I don't know. I don't get how my build would work fine for you but the f-droid build won't.

FDroid builds them from source, so that's why there are differences. In this case that means that we are missing the api key which you don't include in your repo.

W/System.err(26358): java.io.FileNotFoundException: apikey.json
fadelakin commented 9 years ago

@krt16s that makes sense. the thing is i don't want to put my api key on github so i don't know if there's a way i can give f-droid a version of code with the api key or if they can just upload the apk instead.

CiaranG commented 9 years ago

You can't give us (F-Droid) a version of the code with the api key in. Well, you can, but we will redistribute that code. Which seems to be what you're trying to avoid.

Your api key is already on github though, it's in here (for example)... https://github.com/fadelakin/vortex/releases/download/2.0.3/app-release.apk

fadelakin commented 9 years ago

@CiaranG If I were to give the api key out, there's a chance someone might use my key to run up the service I use. The old api key is available on Github but it no longer works since I switched for a new one. The new one isn't posted to Github so it's not available and I don't expect the everyday user to decompile my apk to find the api key.

ghost commented 9 years ago

The only solution I can think of is something weird: Don't crash if the file is not found, but prompt the end-user to provide to a valid API key.