Recent

Author Topic: <SOLVED> INDY 10 And LAMW  (Read 3826 times)

freris

  • New Member
  • *
  • Posts: 42
  • A Retired hobbist programmer from Greece
<SOLVED> INDY 10 And LAMW
« on: December 04, 2018, 07:19:18 pm »
Hi to All !

I have a problem with Indy components (latest version 10.6)  and my Android application. Once I place any indy component in the application form, and install it on my mobile phone (Android 5.1 - Samsung S4 Phone), the application crashed immediately.

My IDE is Laz4Android 1.8 and latest version of LAMW.

NDK r15c and SDK 25.2.5, JDK 1.8.0.25 (No difference with NDK r17 or r18

Please help !

Thank you
« Last Edit: December 17, 2018, 03:08:57 pm by freris »
As I get older, the more I learn !!

jmpessoa

  • Hero Member
  • *****
  • Posts: 1479
Re: INDY 10 And LAMW
« Reply #1 on: December 04, 2018, 07:49:37 pm »
Hi, Freris!

1) goto "Project" ---> "Project Inspector"

....Exists any LCL dependency?

2) gotp  "Package" ---> "Open package File"   and open Indy  installed Indy
package.... Exists any LCL dependency?

Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

freris

  • New Member
  • *
  • Posts: 42
  • A Retired hobbist programmer from Greece
Re: INDY 10 And LAMW
« Reply #2 on: December 04, 2018, 08:05:46 pm »
Thanks jmpessoa for your answer.

In my project no LCL dependency exists.

In Indy package - yes exists ! What i have to do ? Delete dependency ?

Note that with laz4android version 1.6 I did not have a problem with my application....

Now i have removed LCL from Indy, making a clean / build but with same results
« Last Edit: December 04, 2018, 08:29:37 pm by freris »
As I get older, the more I learn !!

jmpessoa

  • Hero Member
  • *****
  • Posts: 1479
Re: INDY 10 And LAMW
« Reply #3 on: December 04, 2018, 08:31:48 pm »
No! 
But we can ask the Author!
[only package "LCLBase"  dependecy is allowed...]
« Last Edit: December 04, 2018, 08:35:14 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

freris

  • New Member
  • *
  • Posts: 42
  • A Retired hobbist programmer from Greece
Re: INDY 10 And LAMW
« Reply #4 on: December 04, 2018, 08:36:48 pm »
Ok jmpessoa

Can you do it ?  I mean, ask the author ?
As I get older, the more I learn !!

jmpessoa

  • Hero Member
  • *****
  • Posts: 1479
Re: INDY 10 And LAMW
« Reply #5 on: December 04, 2018, 08:45:28 pm »

Hello, Remy Lebeau!

Please,  can you help here?

[Laz4Android + LAMW + Indy compatibility ...]

refs.
https://sourceforge.net/projects/laz4android/
https://github.com/jmpessoa/lazandroidmodulewizard

Thank you!!!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

freris

  • New Member
  • *
  • Posts: 42
  • A Retired hobbist programmer from Greece
Re: INDY 10 And LAMW
« Reply #6 on: December 04, 2018, 08:47:26 pm »
Ok Thank you.

I will be waiting for an answer
As I get older, the more I learn !!

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 680
    • Lebeau Software
Re: INDY 10 And LAMW
« Reply #7 on: December 04, 2018, 09:00:54 pm »
I have a problem with Indy components (latest version 10.6)  and my Android application.

Which EXACT version of Indy are you using?  10.6 is very broad.  The current version is 10.6.2.5488.

Once I place any indy component in the application form, and install it on my mobile phone (Android 5.1 - Samsung S4 Phone), the application crashed immediately.

Crashes HOW exactly?  Is there an error message?  What is it?  And are you SURE it is Indy that is crashing?

In my project no LCL dependency exists.

In Indy package - yes exists ! What i have to do ? Delete dependency ?

Which dependency are you referring to exactly?

Note that with laz4android version 1.6 I did not have a problem with my application....

So, if you simply updated to a newer Laz4Android, why do you think this is an Indy issue?
« Last Edit: December 04, 2018, 09:03:17 pm by Remy Lebeau »
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

freris

  • New Member
  • *
  • Posts: 42
  • A Retired hobbist programmer from Greece
Re: INDY 10 And LAMW
« Reply #8 on: December 04, 2018, 09:08:21 pm »
Yes Indy is my problem. And i have the latest version. Yes

Look below:

Once I place any indy component in the application form, and install it on my mobile phone (Android 5.1 - Samsung S4 Phone), the application crashed immediately.

I wonder why with older versions of indy and laz4android my application works ok.

I will try to install again the older versions of laz4android and indy 10.2 and Lamw also.

And i hope to begin work again with my project

As I get older, the more I learn !!

jmpessoa

  • Hero Member
  • *****
  • Posts: 1479
Re: INDY 10 And LAMW
« Reply #9 on: December 04, 2018, 10:18:33 pm »

Hi, freris!

Please, try   "Run" -->  "Clen up and Build" 

before  "[LAMW] build Android Apk ..."
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 680
    • Lebeau Software
Re: INDY 10 And LAMW
« Reply #10 on: December 04, 2018, 10:26:10 pm »
Once I place any indy component in the application form, and install it on my mobile phone (Android 5.1 - Samsung S4 Phone), the application crashed immediately.

But, that does not tell me anything about HOW it is crashing, or WHERE it is crashing.

Do you have the same problem if you instantiate the Indy component(s) dynamically in code at runtime, instead of at design-time?  Can you put a try/except block around the instantiation and catch the failure?

I wonder why with older versions of indy and laz4android my application works ok.

I can't answer that without more information about the actual crash itself.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

freris

  • New Member
  • *
  • Posts: 42
  • A Retired hobbist programmer from Greece
Re: INDY 10 And LAMW
« Reply #11 on: December 04, 2018, 11:10:57 pm »
I can not have details of how the error is generated. Simply starting the application gives the message unfortunately app has stopped.

Is it possible that fpc(3.0.4) is responsible?

Ok tomorrow i will try the older versions and i hope to make my app working again.

Thank you.
As I get older, the more I learn !!

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 680
    • Lebeau Software
Re: INDY 10 And LAMW
« Reply #12 on: December 05, 2018, 02:47:58 am »
I can not have details of how the error is generated. Simply starting the application gives the message unfortunately app has stopped.

What about Android's own application logging?  Any error message in there about why it thinks the app stopped?

And you didn't answer my question - if you change your project to instantiate the Indy components in code at runtime, instead of dropping them on your Form at design-time, do you get the same crash?  And if so, can you catch that error?
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

freris

  • New Member
  • *
  • Posts: 42
  • A Retired hobbist programmer from Greece
Re: INDY 10 And LAMW
« Reply #13 on: December 05, 2018, 12:02:54 pm »
First, sorry for my bad English and also yesterday here in Greece it was late night...

Second, Thank you for all your answers.

I will describe exactly the steps I have followed below.

Quote
And you didn't answer my question - if you change your project to instantiate the Indy components in code at runtime, instead of dropping them on your Form at design-time, do you get the same crash?  And if so, can you catch that error?

Yes i have change my project to instantiate the Indy components in code at runtime but the same results.

Also I found that if I add to my project as depenedecy the indy package (indylaz) without adding any indy component to the form, i have the same results - Crash on start up.

A strange think that occurs after all updates (indy - laz4android - LAMW) is that during android compilation, i got the message "unit iconvec not found" - I have attach a jpg file to see exactly.

Ok i found that this unit is in fpc folder (..\fpc\3.0.4\source\packages\iconvenc\src). i add the path to laz4android search path and then i have another error.

Error linking....

I search on internet and i found that this error occurs because missing the library libiconv.so.  So i found in github a precompiled library for android and i put in project folder (..\jni\).

Then ok, the compilation it was done safely and correctly. Then i build the apk.

And when upload the apk in phone, i have the problems I mentioned above.

Also i have attach the logcat file to see what happens. Look and search for " ipannouncer " - it is my app.

Thank you very much one more time...
As I get older, the more I learn !!

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 680
    • Lebeau Software
Re: INDY 10 And LAMW
« Reply #14 on: December 05, 2018, 08:26:04 pm »
Quote
And you didn't answer my question - if you change your project to instantiate the Indy components in code at runtime, instead of dropping them on your Form at design-time, do you get the same crash?  And if so, can you catch that error?

Yes i have change my project to instantiate the Indy components in code at runtime but the same results.

At app startup again?  Or at the time the code actually creates instances of the Indy components?

If the former, then the crash is likely happening during unit initialization.

If the latter, the crash is likely during class construction, and you should be able to use a try/except to catch it.

Also I found that if I add to my project as depenedecy the indy package (indylaz) without adding any indy component to the form, i have the same results - Crash on start up.

So, it is likely a crash during unit initialization.  Several of Indy's units have initialization sections on them, to setup global resources and such.

A strange think that occurs after all updates (indy - laz4android - LAMW) is that during android compilation, i got the message "unit iconvec not found"

Indy uses the iconv library on Unix platforms, which includes Android (which is a Java layer running on top of Linux).  Indy uses the iconvenc unit when compiled in FPC.

Ok i found that this unit is in fpc folder (..\fpc\3.0.4\source\packages\iconvenc\src). i add the path to laz4android search path and then i have another error.

Error linking....

I search on internet and i found that this error occurs because missing the library libiconv.so.  So i found in github a precompiled library for android and i put in project folder (..\jni\).

OK.

Also i have attach the logcat file to see what happens. Look and search for " ipannouncer " - it is my app.

The only errors I see that are related to an app crash as follows, but they have nothing to do with Indy, they look more like the UI framework crashed during initialization:

Quote
E/art     (17226): dlopen("/data/app/org.dublex.ipannouncer-1/lib/arm/libipannouncer_udp.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "CONTROLS$_$TCONTROLACTIONLINK_$__$$_ASSIGNCLIENT$TOBJECT" referenced by "libipannouncer_udp.so"...
E/JNI_Loading_libipannouncer_udp(17226): exception
E/JNI_Loading_libipannouncer_udp(17226): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "CONTROLS$_$TCONTROLACTIONLINK_$__$$_ASSIGNCLIENT$TOBJECT" referenced by "libipannouncer_udp.so"...
E/JNI_Loading_libipannouncer_udp(17226):    at java.lang.Runtime.loadLibrary(Runtime.java:371)
E/JNI_Loading_libipannouncer_udp(17226):    at java.lang.System.loadLibrary(System.java:989)
E/JNI_Loading_libipannouncer_udp(17226):    at org.dublex.ipannouncer.Controls.<clinit>(Controls.java:1445)
E/JNI_Loading_libipannouncer_udp(17226):    at org.dublex.ipannouncer.App.onCreate(App.java:56)
E/JNI_Loading_libipannouncer_udp(17226):    at android.app.Activity.performCreate(Activity.java:6289)
E/JNI_Loading_libipannouncer_udp(17226):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
E/JNI_Loading_libipannouncer_udp(17226):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2655)
E/JNI_Loading_libipannouncer_udp(17226):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2767)
E/JNI_Loading_libipannouncer_udp(17226):    at android.app.ActivityThread.access$900(ActivityThread.java:177)
E/JNI_Loading_libipannouncer_udp(17226):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449)
E/JNI_Loading_libipannouncer_udp(17226):    at android.os.Handler.dispatchMessage(Handler.java:102)
E/JNI_Loading_libipannouncer_udp(17226):    at android.os.Looper.loop(Looper.java:145)
E/JNI_Loading_libipannouncer_udp(17226):    at android.app.ActivityThread.main(ActivityThread.java:5951)
E/JNI_Loading_libipannouncer_udp(17226):    at java.lang.reflect.Method.invoke(Native Method)
E/JNI_Loading_libipannouncer_udp(17226):    at java.lang.reflect.Method.invoke(Method.java:372)
E/JNI_Loading_libipannouncer_udp(17226):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
E/JNI_Loading_libipannouncer_udp(17226):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
E/art     (17226): No implementation found for int org.dublex.ipannouncer.Controls.pAppOnScreenStyle() (tried Java_org_dublex_ipannouncer_Controls_pAppOnScreenStyle and Java_org_dublex_ipannouncer_Controls_pAppOnScreenStyle__)
D/AndroidRuntime(17226): Shutting down VM
E/AndroidRuntime(17226): FATAL EXCEPTION: main
E/AndroidRuntime(17226): Process: org.dublex.ipannouncer, PID: 17226
E/AndroidRuntime(17226): java.lang.UnsatisfiedLinkError: No implementation found for int org.dublex.ipannouncer.Controls.pAppOnScreenStyle() (tried Java_org_dublex_ipannouncer_Controls_pAppOnScreenStyle and Java_org_dublex_ipannouncer_Controls_pAppOnScreenStyle__)
E/AndroidRuntime(17226):    at org.dublex.ipannouncer.Controls.pAppOnScreenStyle(Native Method)
E/AndroidRuntime(17226):    at org.dublex.ipannouncer.Controls.jAppOnScreenStyle(Controls.java:1450)
E/AndroidRuntime(17226):    at org.dublex.ipannouncer.App.onCreate(App.java:60)
E/AndroidRuntime(17226):    at android.app.Activity.performCreate(Activity.java:6289)
E/AndroidRuntime(17226):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
E/AndroidRuntime(17226):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2655)
E/AndroidRuntime(17226):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2767)
E/AndroidRuntime(17226):    at android.app.ActivityThread.access$900(ActivityThread.java:177)
E/AndroidRuntime(17226):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449)
E/AndroidRuntime(17226):    at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(17226):    at android.os.Looper.loop(Looper.java:145)
E/AndroidRuntime(17226):    at android.app.ActivityThread.main(ActivityThread.java:5951)
E/AndroidRuntime(17226):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(17226):    at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(17226):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
E/AndroidRuntime(17226):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
...
W/ActivityManager(  878):   Force finishing activity org.dublex.ipannouncer/.App
...
D/CrashAnrDetector(  878): processName: org.dublex.ipannouncer
D/CrashAnrDetector(  878): broadcastEvent : null data_app_crash
...
I/ActivityManager(  878): Process org.dublex.ipannouncer (pid 17226)(adj 15) has died(54,368)
« Last Edit: December 05, 2018, 08:28:24 pm by Remy Lebeau »
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)