Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / POSSIBLE BUG? : Exported APK failed to detect gyroscope?

Author
Message
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 8th Mar 2016 14:32
Hello everybody.

I was testing a VR application I made using AppGameKit V2.0.17, and by broadcasting, the app works great on my android Xperia Z2.
No problem whatsoever.

But, when I exported it as .apk and installed it, the problem arises.
Just right after installing it , if I chose to run it, then it works fine.

But when I close the app, and ran it again, the app failed to detect gyroscope movement.

And, when I return to home screen (without closing the app), and return back to the app, the screen just appears black.

If I remember correctly, some times ago, .apk also failed to detect sensors movements . But that was fixed.
Is this related to that?

I exported the .apk with permissions: Write external storage, wifi, and wake lock.

Anybody have any idea? Pretty sure its not related to the code.
Here's the .apk.

Attachments

Login to view attachments
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 8th Mar 2016 14:57
Tested the sensor demo on a Nexus 7 with version 2.0.18 and it worked here. Note that if you are using SetRenderToImage then 2.0.18 fixed a bug with Android causing a black screen when resuming.
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 8th Mar 2016 15:21 Edited at: 8th Mar 2016 15:56
I updated everything to 2.0.18, and exported in again, and reinstalled it in a Xperia Z2, but the problem still persists.

The black screen is gone though.

But the app still won't respond to gyroscope when it's restarted.

I tried to clear the phone app cache, install and reinstalled again, but still won't respond to gyroscopes.
It only does respond to gyroscope when it's was ran the first time. Subsequent run would not respond.

The app works fine if you broadcast it, but if you export and install it, the problem arises.

Here's the project folder, just in case. Its almost exactly the same as the VR demo.
I only make it so that it run only on 1 device at a time.
And the camera rotation feeds from gyroscope only, not from quarternion.
P.S - Dont mind the correctness of character movement. It's still not really well made yet. I just wanted to fix the gyroscope detection on exported .apk.

Attachments

Login to view attachments
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 8th Mar 2016 16:07
Your project works here on a Nexus 7, it must be a device issue. I would need to see the LogCat from the device to debug it any further. If you install Android Studio and enable USB debugging on your device then it should display the LogCat in the Android Monitor window automatically.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 8th Mar 2016 20:20
hakimfullmetal:
Are you running the built in OS or some other OS? I recall that someone had problems with the gyroscope using CyanogenMod.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 9th Mar 2016 10:13
Quote: "? I recall that someone had problems with the gyroscope using CyanogenMod."

That was me. Removing CyanogenMod and returning to stock Nexus android resolved my issue.
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 9th Mar 2016 10:14
Thanks for you attention guys.

I used Xperia Z2 on Android version 5.1.1 from the official update. No custom OS.

I'll try to get some LogCat after I got back from work and download Android Studio.
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 9th Mar 2016 11:52 Edited at: 9th Mar 2016 11:57
Err sorry newb question

I installed Android Studio, and enabled debugging mode on my phone.

But how do I get bug report on app running on my phone?

I managed to get bug report straight from my phone without Android Studio. Will that do?
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 9th Mar 2016 12:04
Here's the bug report. Not sure if this will help.

Attachments

Login to view attachments
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 9th Mar 2016 16:02
Thanks for the bug report, it includes the LogCat output so I can see what's going on when the app resumes. It looks like that device only hides the activity, it doesn't pause it, so when the app resumes it tries to restart processes that were never paused. I've attempted to fix it but I can't test it, so I've attached a file to see if it fixes it for you. Place this file in the "AGK\Tier 1\Editor\data\android\lib\armeabi-v7a" folder and then export an APK as normal. This may also fix the issue with CyanogenMod, but I can't be sure.

Attachments

Login to view attachments
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 10th Mar 2016 09:22 Edited at: 10th Mar 2016 09:41
I've downloaded that file, and replaced the original file with that one, and restarted AGK.
Exported, installed it.
But the problem still happened. I can't detect any changes.

Here's the bug report:

Attachments

Login to view attachments
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 10th Mar 2016 16:33
Ok, try the attached version instead and let me know if anything changes.

Attachments

Login to view attachments
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 11th Mar 2016 03:45 Edited at: 11th Mar 2016 03:46
Nope, still no changes.

But I've noticed that before we tried to fix anything, if I leave the phone for sometime (maybe hours), and if I restarted the app, sometimes it became responsive back to gyroscope.
But after that, if I close it and restarted it, the problem returned.
Maybe some hidden old cache was deleted after a few hours if app was unused. I don't know.

Here's the current bug report.

Attachments

Login to view attachments
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Mar 2016 15:34
Well I'm out of ideas, for some reason the device isn't waking up the sensors when the app resumes. I might see if I can get my hands on an Xperia Z2 to replicate the problem, but there's a chance it might be a combination of the OS version and apps that modify system settings causing a problem.
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 11th Mar 2016 16:13
Thanks for your effort.

But if all of you guys phone did not have that problem, I guess I can just upgrade my phone in the future without worrying too much.
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 11th Mar 2016 16:32
I have also some problems with the delay of the acceleration sensor and the rotation sensor. I hope this files could fix it.

[/url]
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Mar 2016 19:58
You should upload to Google Play if you have an account, and let it analyse which devices it is compatible with. It might reveal something.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 12th Mar 2016 01:55
No changes right now it seems, that the accelerometer delay for the rotation vector fusion is way too slow on my S7. If I use "StartGPSTracking()", the regular acceleration sensor seems to be fixed, but it has no effect on the rotation vector.

Quote: "combination of the OS version and apps that modify system settings causing a problem."


I try to install a diffrent firmware and see if there are changes, but currently there are no custom roms for the S7, so I have to move this into the future.
The sensors seem to work as they should, but not in AGK.

[/url]
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 16th Apr 2016 10:46 Edited at: 16th Apr 2016 10:48
Hey, Sony Xperia Z2 had an update to Android 6.0. Previously version 5.
After update, the problem seems to be gone.
I guess the problem is the way Sony's previous custom Android handling memories or something.

Login to post a reply

Server time is: 2024-11-25 07:55:56
Your offset time is: 2024-11-25 07:55:56