Alcinoe icon indicating copy to clipboard operation
Alcinoe copied to clipboard

TAlMemo Alcinoe Crashes App Android

Open jhonalone opened this issue 6 years ago • 15 comments

I am trying to use a TAlMemo component in a real application but it does not work correctly.

In a very simple application you can see that it works perfectly

Using the same component in a real, more complex, app, you can see the inner frame gets smaller. Making a short tap works perfectly. But when you do a long tap or double tap, then CRASHES the application.

Both applications are in the same directory and use the same paths and use the same tools. And both use exactly the same configuration at project/options.

Can you help me, please?

Best regards and thanks in advance.

droid screen-1 droid screen-2 droid screen-3 design project-options1 project-options2

jhonalone avatar Nov 11 '18 19:11 jhonalone

Hi jhonalone, sorry for the delay

what version of android are you using? if you are using a version < android 6 then you need to include in your app some extra resource to Build the copy/past menu (else when you long tap and when the system will try to build the copy past menu you will have an error). it's because the copy/past menu was introduced in android 6, Before it's was a top bar (incompatible with delphi app).

you must include in de deployment (understand you must deploy) all the files located in Alcinoe\lib\jar\com.alcinoe\res. If you don't want to do it manually you can use the tool Alcinoe\tools\DeployMan\

Zeus64 avatar Nov 13 '18 10:11 Zeus64

Thank you very much for your answer. The android version is 7.1.1. I have done both tests on the same device. From Delphi Tokyo. The same directory, the same paths, etc ... The only thing that changes is that the TAlMemo component is included in a more complex project. I appreciate the information to use the project in versions before the Android Mashmalow. I have a video with very poor quality. I can not upload it here. I'll try to do it on YouTube and I'll send you the link. Best regards.

jhonalone avatar Nov 13 '18 14:11 jhonalone

Hi. Zeus64. I do not know if I understood correctly. Deplyment.exe is used for versions prior to Android 6.0.0? Or maybe you have to use it always? Thank you very much for your help,

jhonalone avatar Nov 13 '18 14:11 jhonalone

Sorry. I have tested the app on the same device, (Samsung Galaxy A8 2018) including all the files in the "Alcinoe \ lib \ jar \ com.alcinoe \ res" directory in the deplyment of my program and this does not solve any of the 2 problems. The inner frame keeps coming out smaller and the program is destroyed when you press a long tap. By the way, the Deplyman.exe program does not work correctly. Issues an Access Violation error. Best regards.

jhonalone avatar Nov 13 '18 16:11 jhonalone

just to be sure the ALFmxControl demo work on your mobile phone ? can you try to reproduce in it the bug and just send me the source code that i can study it ?

Zeus64 avatar Nov 13 '18 16:11 Zeus64

HI. This project run perfectly on my device. ALFmxControls2.zip

And this .apk Crashes on ..... "Aseguradoras/Nueva". "Clave" (Key to enter) is "Prueba" I hope help you.

CitAgen.zip

jhonalone avatar Nov 13 '18 18:11 jhonalone

And here is the complete directory with all the sources of the two programs. Maybe it will help you better. Complete path is "D: \ Dev \ Alcinoe \ demos \ ALFmxControls \ _source"

I unzipped the file "alcinoe-master.zip" in the folder "d: \ Dev" and then I changed the name of the "alcinoe-master" folder to "Alcinoe"

_source.zip

jhonalone avatar Nov 13 '18 19:11 jhonalone

Hi, Zeus64. Do you have enough information? If you need anything else, please let me know. Best regards.

jhonalone avatar Nov 17 '18 17:11 jhonalone

Sorry. I hit the wrong button.

jhonalone avatar Nov 17 '18 17:11 jhonalone

I also have the same problem. This happens on Android 8.0, 8.1 and 9.0 devices due to it not being able to find the required value in the dimensions xml file. All resource files have been included in my app project along with the alcinoe.jar file generated by the build scripts.

I tried editing the .java source file to replace the reference with a static value and rebuilt the .jar file (and re-attached to my project) but it still crashes.

Could you suggest a fix for this please? We would really like to use the native memo in our app but this is stopping us.

The logcat reports the following as the cause:

11-20 16:10:59.504: E/AndroidRuntime(11610): FATAL EXCEPTION: main 11-20 16:10:59.504: E/AndroidRuntime(11610): Process: com.embarcadero.MemoFix, PID: 11610 11-20 16:10:59.504: E/AndroidRuntime(11610): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/alcinoe/R$dimen; 11-20 16:10:59.504: E/AndroidRuntime(11610): at com.alcinoe.view.ALFloatingActionMode.(ALFloatingActionMode.java:95) 11-20 16:10:59.504: E/AndroidRuntime(11610): at com.alcinoe.widget.ALEditText.createFloatingActionMode(ALEditText.java:232) 11-20 16:10:59.504: E/AndroidRuntime(11610): at com.alcinoe.widget.ALEditText.startActionMode(ALEditText.java:177) 11-20 16:10:59.504: E/AndroidRuntime(11610): at com.alcinoe.widget.ALEditText.startActionMode(ALEditText.java:189) 11-20 16:10:59.504: E/AndroidRuntime(11610): at android.widget.Editor.startSelectionActionModeInternal(Editor.java:2103) 11-20 16:10:59.504: E/AndroidRuntime(11610): at android.widget.SelectionActionModeHelper.startActionMode(SelectionActionModeHelper.java:178) 11-20 16:10:59.504: E/AndroidRuntime(11610): at android.widget.SelectionActionModeHelper.-android_widget_SelectionActionModeHelper-mthref-2(SelectionActionModeHelper.java:94) 11-20 16:10:59.504: E/AndroidRuntime(11610): at android.widget.-$Lambda$tTszxdFZ0V9nXhnBpPsqeBMO0fw.$m$1(Unknown Source:6) 11-20 16:10:59.504: E/AndroidRuntime(11610): at android.widget.-$Lambda$tTszxdFZ0V9nXhnBpPsqeBMO0fw.accept(Unknown Source:15) 11-20 16:10:59.504: E/AndroidRuntime(11610): at android.widget.SelectionActionModeHelper$TextClassificationAsyncTask.onPostExecute(SelectionActionModeHelper.java:580) 11-20 16:10:59.504: E/AndroidRuntime(11610): at android.widget.SelectionActionModeHelper$TextClassificationAsyncTask.onPostExecute(SelectionActionModeHelper.java:576) 11-20 16:10:59.504: E/AndroidRuntime(11610): at android.os.AsyncTask.finish(AsyncTask.java:695) 11-20 16:10:59.504: E/AndroidRuntime(11610): at android.os.AsyncTask.-wrap1(Unknown Source:0) 11-20 16:10:59.504: E/AndroidRuntime(11610): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712) 11-20 16:10:59.504: E/AndroidRuntime(11610): at android.os.Handler.dispatchMessage(Handler.java:106) 11-20 16:10:59.504: E/AndroidRuntime(11610): at android.os.Looper.loop(Looper.java:164) 11-20 16:10:59.504: E/AndroidRuntime(11610): at android.app.ActivityThread.main(ActivityThread.java:6494) 11-20 16:10:59.504: E/AndroidRuntime(11610): at java.lang.reflect.Method.invoke(Native Method) 11-20 16:10:59.504: E/AndroidRuntime(11610): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 11-20 16:10:59.504: E/AndroidRuntime(11610): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 11-20 16:10:59.504: E/AndroidRuntime(11610): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.alcinoe.R$dimen" on path: DexPathList[[zip file "/data/app/com.embarcadero.MemoFix-CBgXbL7Y_J0w0ZlsDHy37w==/base.apk"],nativeLibraryDirectories=[/data/app/com.embarcadero.MemoFix-CBgXbL7Y_J0w0ZlsDHy37w==/lib/arm, /data/app/com.embarcadero.MemoFix-CBgXbL7Y_J0w0ZlsDHy37w==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]] 11-20 16:10:59.504: E/AndroidRuntime(11610): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125) 11-20 16:10:59.504: E/AndroidRuntime(11610): at java.lang.ClassLoader.loadClass(ClassLoader.java:379) 11-20 16:10:59.504: E/AndroidRuntime(11610): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

MyBuzzTechnologies avatar Nov 20 '18 16:11 MyBuzzTechnologies

I have found out in which situation the first problem occurs. This means that the inner frame is not resized correctly when the "TAlMemo" or TAlEdit components are included in the "TScaledLayout" component. And this is very important to adapt the size of the objects on the screen to the resolution of each device. But I do not know how to solve it. Can someone help me? Thanks in advance.

jhonalone avatar Nov 22 '18 19:11 jhonalone

can you try the last version with Rio? TALEdit/TalMemo was highly refactored to work in Rio with the new Zorder support (on android)

Zeus64 avatar Jun 24 '19 16:06 Zeus64

Thank you very much Zeus64 for your interest. But I'm sorry to tell you that the newest version of Delphi I have is Tokyo. I can not try it on Rio. Best regards.

jhonalone avatar Jun 24 '19 18:06 jhonalone

@jhonalone unfortunatly it's too hard to maintain tokyo + rio as they was a huge refactoring in Rio regarding Zorder. and anyway, in auguste, you will be unable to put anything in google play with Tokyo (because no android 64 support) so we are force to move to rio

Zeus64 avatar Jun 24 '19 20:06 Zeus64

i am not complied alfmxcontrols, [Exec Error] The command "D:\Rad Rio\alcinoe-master\tools\AddRJavaToClassesDex\AddRJavaToClassesDex.bat "D:\Rad Rio\alcinoe-master\demos\ALFmxControls_source" "D:\Rad Rio\alcinoe-master\demos\ALFmxControls\Android\Debug\ALFmxControls.so" "C:\Users\Public\Documents\Embarcadero\Studio\20.0\PlatformSDKs\android-sdk-windows\build-tools\28.0.3\aapt.exe" "C:\Users\Public\Documents\Embarcadero\Studio\20.0\PlatformSDKs\android-sdk-windows\platforms\android-28\android.jar" "C:\Users\Public\Documents\Embarcadero\Studio\20.0\PlatformSDKs\android-sdk-windows\build-tools\28.0.3\dx.bat" "C:\Program Files\Java\jdk1.8.0_60"&&D:\Rad Rio\alcinoe-master\demos\ALFmxControls_source......\tools\AddRJavaToClassesDex\AddRJavaToClassesDex.bat "D:\Rad Rio\alcinoe-master\demos\ALFmxControls_source" "" "C:\Users\Public\Documents\Embarcadero\Studio\20.0\PlatformSDKs\android-sdk-windows\build-tools\28.0.3\aapt.exe" "C:\Users\Public\Documents\Embarcadero\Studio\20.0\PlatformSDKs\android-sdk-windows\platforms\android-28\android.jar" "C:\Users\Public\Documents\Embarcadero\Studio\20.0\PlatformSDKs\android-sdk-windows\build-tools\28.0.3\dx.bat" "C:\Program Files\Java\jdk1.8.0_60"&&D:\Rad Rio\alcinoe-master\demos\ALFmxControls_source......\tools\AddRJavaToClassesDex\AddRJavaToClassesDex.bat "D:\Rad Rio\alcinoe-master\demos\ALFmxControls_source" "D:\Rad Rio\alcinoe-master\demos\ALFmxControls\Android\Debug\ALFmxControls.so" "C:\Users\Public\Documents\Embarcadero\Studio\20.0\PlatformSDKs\android-sdk-windows\build-tools\28.0.3\aapt.exe" "C:\Users\Public\Documents\Embarcadero\Studio\20.0\PlatformSDKs\android-sdk-windows\platforms\android-28\android.jar" "C:\Users\Public\Documents\Embarcadero\Studio\20.0\PlatformSDKs\android-sdk-windows\build-tools\28.0.3\dx.bat" "C:\Program Files\Java\jdk1.8.0_60"" exited with code 9009.

mirisu avatar Jun 29 '19 17:06 mirisu