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.

Android / [SOLVED] Problems porting over tier2 code from VC++ to android studio

User Offline
Joined: 27th Apr 2020
Posted: 14th Jul 2020 17:46 Edited at: 14th Jul 2020 17:49
I made a game using Visual studio c++ with a windows PC, and now I am trying to copy the code over to Android Studio to make the mobile app version.
At first I pasted the whole template.cpp file into the android template folder, but the problem is the app would just dump immediately (with an android error message saying "The app keeps stopping"). So I decided to try copy and paste small bits of the code at a time to see where the problem might be.
After pasting a few functions including the app::Begin (void), I ran jniCompile.bat, which worked fine, and I successfully ran the app -- the media loaded up, music started, etc...
The next function I pasted seemed to cause an issue, I noticed that jniCompile.bat didn't run as long, it only showed one line:

"[armeabi-v7a] Compile++ arm : android_player <= template.cpp"

Normally it spits out these 6 lines:

[armeabi-v7a] Compile++ arm : android_player <= template.cpp
[armeabi-v7a] SharedLibrary :
[armeabi-v7a] Install : => jniLibs/armeabi-v7a/
[arm64-v8a] Compile++ : android_player <= template.cpp
[arm64-v8a] SharedLibrary :
[arm64-v8a] Install : => jniLibs/arm64-v8a/

Now running the app with that next function pasted in causes it to dump again. The problem is that there is no indicator of what the error is, so I have no idea what to do to fix the issue. I have tried commenting out certain lines to see if I can narrow it down but that hasn't worked so far.
Oddly enough I am not even calling the function from the main loop (or anywhere in the code), it's causing the issue simply by being there.. Which makes no sense to me.

Here is the function causing the issue:

The author of this post has marked a post as an answer.

Go to answer

User Offline
Joined: 27th Apr 2020
Posted: 14th Jul 2020 17:56 Edited at: 14th Jul 2020 18:02
Update: I have determined the exact line of code causing the problem:

Any ideas on the issue?
User Offline
Joined: 27th Apr 2020
Posted: 14th Jul 2020 19:39
This post has been marked by the post author as the answer.
Turned out to be a C++ issue not an AppGameKit issue.

I solved the problem by using the following code instead:

Login to post a reply

Server time is: 2021-04-11 19:33:58
Your offset time is: 2021-04-11 19:33:58