Jump to content
Yaron

Delphi 10.3 and the NOX emulator running Android 7

Recommended Posts

It seems that Delphi 10.3 generated APKs are not compatible with the NOX emulator running Android 7.

 

The moment I try running the APK, I get a message that the application closed.

 

This happens with every APK I generate (e.g. https://github.com/bLightZP/ElegantCalculator).

Trying to debug the issue, it seems that my first line of code is not even executed before the app closes.

 

Any ideas?

Edited by Yaron

Share this post


Link to post

I believe it does, other apps and games work fine, my own apps used to work fine on v10.2 ...

Share this post


Link to post

Which log are you referring to?  The app closes before it reaches my first line of code?

Share this post


Link to post

I used "Andoid Device Monitor" from SDK that installed with Delphi (starting  \sdk\tools\monitor.bat) but it doesn't start with Rio installed SDK. At least for me.

You either install Android Studio and use Logcat: https://developer.android.com/studio/debug/am-logcat

Or other solutions: https://android.stackexchange.com/questions/14430/how-can-i-view-and-examine-the-android-log

Share this post


Link to post

How did you manage to make Delphi recognise the emulator? I've got a similar situation and cant make it see the emulator. 

 

And something else? Do you use any virtual machines or directly on the main PC?

Share this post


Link to post
On 2/1/2019 at 3:08 AM, John Kouraklis said:

How did you manage to make Delphi recognise the emulator? I've got a similar situation and cant make it see the emulator. 

 

And something else? Do you use any virtual machines or directly on the main PC?

 

I am not trying to use NOX as the debugger, I'm trying to get it to run my compiled APKs simply by dragging the APK onto the NOX window which installs just fine.

But as soon as I try to run any Delphi 10.3 app on NOX, it instantly closes with an error message that the app has closed.

 

And I use it on my main PC, no virtual machines (other than NOX of course)

 

Share this post


Link to post
On 2/4/2019 at 10:56 AM, Yaron said:

But as soon as I try to run any Delphi 10.3 app on NOX, it instantly closes with an error message that the app has closed.

Have you tried a simple project that does nothing? 

Share this post


Link to post
On 2/4/2019 at 1:06 PM, Cristian Peța said:

If adb connection is not working then installing a Log visualizer from the market is the easiest solution to see the log.

Can you post a link to one, I tried a search on the google play store and it only came back with text viewers.

On 2/5/2019 at 5:46 PM, John Kouraklis said:

Have you tried a simple project that does nothing? 

Yes, created a new multi-platform project, compiled & deployed it without any changes, installed the APK on Nox and it crashes with "Project1 keeps stopping" instantly when executed.

Share this post


Link to post

I have recently (last couple of days) been (re)-introduced to the wonderful world of (trying to) get set up with an emulator to do Android development with Delphi.   🙂😞😫

 

(Had lots of fun and games trying to make the default Android SDK emulators work  ... eventually started looking into alternatives including Nox... hence my response to this post)

 

Suffice it to say that:

  • I can successfully run .apk's produced with my newly recently installed 10.3.1 Rio installation by dragging and dropping the .apk onto Nox version 6.2.7.1. 
  • I've also managed to make nox show up in Rad studio and deploy directly to nox, with some fiddling with adb:
  • I have however not managed to debug directly on Nox, this fails every time with the app stuck on the firemonkey icon and the Delphi debugger terminating immediately upon startup.  Not sure what's going wrong or how to debug this yet.
  • As a digression, I've also found (irritatingly) that out of the 2 phones I have available, debugging also doesn't work on the newer one (Note 8 ) because of "reasons" (something Google changed supposedly and Emba therefore says they won't fix), while it does work on the older phone (note 4). Meanwhile the test app I've tried while starting on both behaves rather inconsistently in regards of camera feature control (flipping between front and back cameras works on one, doesn't on the other, and setting the auto-focus mode doesn't seem to work the same between the phones either.)  Perhaps these are all teething issues and possible to be worked around... 

Hope that helps.

 

 

Share this post


Link to post
29 minutes ago, ByteJuggler said:
  • As a digression, I've also found (irritatingly) that out of the 2 phones I have available, debugging also doesn't work on the newer one (Note 8 ) because of "reasons" (something Google changed supposedly and Emba therefore says they won't fix), while it does work on the older phone (note 4).

If your Note 8 has Oreo 8.0 OS then debugging does not work because Google screwed up on OS level. You need to update OS to 8.1 that fixes the issue. It was not something EMBT could fix.

 

http://blog.marcocantu.com/blog/2017-december-delphi-android81-debugging.html

  • Like 1

Share this post


Link to post
17 minutes ago, Dalija Prasnikar said:

If your Note 8 has Oreo 8.0 OS then debugging does not work because Google screwed up on OS level. You need to update OS to 8.1 that fixes the issue. It was not something EMBT could fix.

 

http://blog.marcocantu.com/blog/2017-december-delphi-android81-debugging.html

Thanks, Correct yes.  That's what I read/was referring to.  And my apologies, I shouldn't have used "won't" in my post, should've been "can't". 

 

As it happens I see I've been prompted with an OS update/upgrade notice last night on said phone (which will upgrade to Android Pie) so hopefully the problem will be gone later today! 🙂

 

Share this post


Link to post

I managed to get a logcat of my app not loading in Nox (this also happens with a blank app):

I/ActivityManager( 2149): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.inmatrix.ZP_Remote/com.embarcadero.firemonkey.FMXNativeActivity bnds=[930,370][1189,525]} from uid 1000 on display 0
I/ActivityManager( 2149): Start proc 4473:com.inmatrix.ZP_Remote/u0a44 for activity com.inmatrix.ZP_Remote/com.embarcadero.firemonkey.FMXNativeActivity
D/houdini ( 4473): [4473] Added shared library /data/app/com.inmatrix.ZP_Remote-1/lib/arm/libZP_Remote.so for ClassLoader by Native Bridge.
F/DEBUG   ( 4489): pid: 4473, tid: 4473, name: atrix.ZP_Remote  >>> com.inmatrix.ZP_Remote <<<
W/ActivityManager( 2149):   Force finishing activity com.inmatrix.ZP_Remote/com.embarcadero.firemonkey.FMXNativeActivity
I/WindowManager( 2149): Failed to capture screenshot of Token{1a08a1d ActivityRecord{48bc2f4 u0 com.inmatrix.ZP_Remote/com.embarcadero.firemonkey.FMXNativeActivity t7 f}} appWin=Window{3b58c89 u0 Starting com.inmatrix.ZP_Remote} drawState=4
I/ActivityManager( 2149): Process com.inmatrix.ZP_Remote (pid 4473) has died
W/ActivityManager( 2149): Ignoring remove of inactive process: ProcessRecord{98f6a49 0:com.inmatrix.ZP_Remote/u0a44}


I'm not proficient enough to understand the debug out, can anyone shed any light?

Share this post


Link to post
On 3/13/2019 at 12:46 PM, ByteJuggler said:

I have recently (last couple of days) been (re)-introduced to the wonderful world of (trying to) get set up with an emulator to do Android development with Delphi.   🙂😞😫

 

(Had lots of fun and games trying to make the default Android SDK emulators work  ... eventually started looking into alternatives including Nox... hence my response to this post)

 

Suffice it to say that:

  • I can successfully run .apk's produced with my newly recently installed 10.3.1 Rio installation by dragging and dropping the .apk onto Nox version 6.2.7.1. 

 

Are you running Nox with the Android 7 image?  By default Nox will run with older versions of Android.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×