Lazarus
Programming => Operating Systems => Android => Topic started by: Agmcz on May 09, 2022, 11:39:37 pm
-
Hello
There is a fatal error with Samsung devices and Android 12!!!
The error message is just "Something went wrong with [App]. [App] closed because this app has a bug. Try updating this app after its developer provides a fix for this error.", and then the app fails to start.
Tested on Samsung Note 10 and Samsung S9 Plus, Android 12
Lazarus
Apk builder: gradle
Chipset: Aarch64
SDK version: 31
Please fix bug
-
Does this mean that there is no solution to the problem? :(
-
Does this mean that there is no solution to the problem?
No!
But a generic error message doesn't help....
-
Hello
There is a fatal error with Samsung devices and Android 12!!!
The error message is just "Something went wrong with [App]. [App] closed because this app has a bug. Try updating this app after its developer provides a fix for this error.", and then the app fails to start.
Tested on Samsung Note 10 and Samsung S9 Plus, Android 12
Lazarus
Apk builder: gradle
Chipset: Aarch64
SDK version: 31
Please fix bug
Try SDK version: 30 LAMW is not yet ready for SDK 31
-
Thanks to reply
No!
But a generic error message doesn't help....
Error msg appears when startup app, how debugging?
Try SDK version: 30 LAMW is not yet ready for SDK 31
SDK version 30 also same problem!!
-
Error msg appears when startup app, how debugging?
Please, look for "android adb command line" ...
-
Problem not yet appear :D, 80% my project are using sdk 31 + gradle 7.1.3 -> android studio chipmunk for building.
-
Have you tested app on your samsung note 10/s9 plus with Android 12? :o
-
s20 plus -> inventory + pos -> ok -> no problem
-
s20 plus -> inventory + pos -> ok -> no problem
Very cool :'(
I use Android Studio SDK.
Can you put path to gradle for Android Studio... :o
and jdk version
My settings are attached
-
I found gradle path here "C:\Users\user123\.gradle\wrapper\dists\gradle-7.3.3-bin"
I will test and come back... 8)
-
Try ndk 21, gradle >7 not yet supported for building inside lazarus, you must build your project using android studio. That is the easiest to get ride sdk31 + gradle >7, but anyway that are my journey to LAMW, if you get more easy to get ride you are awesome 8)
-
I used Android Studio SDK
gradle 7.3.3
ndk-r21e
there is still the same problem :o
I found this solution but it didn't work for me
https://stackoverflow.com/questions/71410279/app-is-not-working-and-shuts-down-on-samsung-galaxy-s22
-
I also confirm that LAMW apps crash on Android 12.
In Google Play I have a number of apps which were made using LAMW. When Android 12 was released, the crash statistics in Google Play shows that all my apps which were made using LAMW are crashing on Android 12. Unfortunately I do not have physical device running Android 12, so I am unable to find the reason of crash. In Android 12 emulator apps run fine, however apps crash on physical devices running Android 12.
-
however apps crash on physical devices running Android 12.....
Please, update LAMW from github and run "Clean up and Build" before make your apk again....
I think that this issue was fixed by @ADiV
Thanks to All!
-
I will update LAMW, CLEAN and tell you result, if problem is solved or not.
-
Hi guys,
I also had the same problem with the applications in android 12, I tried on a real device the "debug" version worked correctly and the "release" version died horribly. After many tests with LAMW I discovered the bug:
This line of code generated the error:
//InitInheritedComponent(Self, TAndroidWidget {TAndroidForm});
InitInheritedComponent(Self, jForm {Need for Android 12});
Another particularity of Google Play is that you cannot create "CreateForm" anywhere, only the "begin ... end" of the "Project source" but when the operating system is updated, your application will stop working.
//Example
begin
gApp:= jApp.Create(nil);
gApp.Title:= 'LAMW JNI Android Bridges Library';
gjAppName:= 'org.lamw.doubleflashfree';
gjClassName:= 'org/lamw/doubleflashfree/Controls';
gApp.AppName:=gjAppName;
gApp.ClassName:=gjClassName;
gApp.Initialize;
gapp.CreateForm(TfrmTools, frmTools);
gapp.CreateForm(TfrmScreen, frmScreen);
gapp.CreateForm(TfrmTime, frmTime);
gapp.CreateForm(TfrmParty, frmParty);
gapp.CreateForm(TfrmSOS, frmSOS);
gapp.CreateForm(TfrmConfig, frmConfig);
gapp.CreateForm(TfrmQR, frmQR);
gapp.CreateForm(TfrmZoom, frmZoom);
gapp.CreateForm(TfrmPro, frmPro);
gApp.CreateForm(TfrmSplash, frmSplash);
end.
I have also improved certain things such as compatibility with mipmap so that in Android 12 it loads the icons correctly.
Multidex support to avoid problems with the 64k limit.
Greetings.
-
Please, update LAMW from github and run "Clean up and Build" before make your apk again....
I think that this issue was fixed by @ADiV
ADiV, have you already updated LAMW code in github to be compatible with Android 12?
When we can download fixed LAMW which is compatible with Android 12?
All my apps made with LAMW crash in Android 12, so this is urgent issue.
-
Does that issue affect me when I do not use LAMW, but FPC-only ?
-
I hope this works to all, thank you. :) , CTRL+F1 only, not need Android studio.
-
This 1, is my LAMW setting. Setted sdk is 30, but if i change to sdk 31 it also works great.
****important*****
-Create your "mipmap" folder inside res folder + add your beautiful android icon inside (just copy from xhdp folder).
If this solution is acceptable, you can close your thread with "SOLVED" mark.
-
Please, update LAMW from github and run "Clean up and Build" before make your apk again....
I think that this issue was fixed by @ADiV
ADiV, have you already updated LAMW code in github to be compatible with Android 12?
When we can download fixed LAMW which is compatible with Android 12?
All my apps made with LAMW crash in Android 12, so this is urgent issue.
If it was already updated on github as soon as it was discovered.
-
SDK 32 :), i did this until "release" mode, not only "debug" mode. No die or something.
Recipe:
1. never init something anywhere -> create your form inside main form oncreate procedure -> this would be fine/never die on your debug or release on sdk / android 12.
2. The problem is inside gradle distribution url, just change it from 6.8.3 to 7.4.2 -> if you want build it until release mode.
or select gradle >7.3.3 from this services url
https://services.gradle.org/distributions/
** LAMW need to upgrade their gradlewrapper.properties -> from max 6.8.3, or we can set it up from external tools -> bulit using old mode or recent mode. Old mode -> max 6.8.3 , recent mode or fresh code/recent hype sdk. Sometimes old are best.
Thank you all LAMW contributors and creator you are awesome -> pascal great again! :D
Happy coding to all my friend!
Old project -> throw away every line that has form.init(gApp) or form.init from entire your form.
this picture is on release mode sdk32, ndk24
-
The report of two bugs.
Bug #1.
Changing of Launcher icon fails to work.
Just create new project and change Launcher icon by going to menu:
Project -> Project Options -> [LAMW] Android project options -> Launcher icon
Then run menu
[LAMW] Build Android Apk and run
The result is:
Fatal: FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mergeDebugResources'.
> [mipmap/ic_launcher] D:\AppLAMWProject1\res\mipmap\ic_launcher.png [mipmap/ic_launcher] D:\AppLAMWProject1\res\mipmap\ic_launcher.webp: Error: Duplicate resources
[mipmap-hdpi-v4/ic_launcher] D:\AppLAMWProject1\res\mipmap-hdpi\ic_launcher.png [mipmap-hdpi-v4/ic_launcher] D:\AppLAMWProject1\res\mipmap-hdpi\ic_launcher.webp: Error: Duplicate resources
[mipmap-mdpi-v4/ic_launcher] D:\AppLAMWProject1\res\mipmap-mdpi\ic_launcher.png [mipmap-mdpi-v4/ic_launcher] D:\AppLAMWProject1\res\mipmap-mdpi\ic_launcher.webp: Error: Duplicate resources
[mipmap-xhdpi-v4/ic_launcher] D:\AppLAMWProject1\res\mipmap-xhdpi\ic_launcher.png [mipmap-xhdpi-v4/ic_launcher] D:\AppLAMWProject1\res\mipmap-xhdpi\ic_launcher.webp: Error: Duplicate resources
[mipmap-xxhdpi-v4/ic_launcher] D:\AppLAMWProject1\res\mipmap-xxhdpi\ic_launcher.png [mipmap-xxhdpi-v4/ic_launcher] D:\AppLAMWProject1\res\mipmap-xxhdpi\ic_launcher.webp: Error: Duplicate resources
[mipmap-xxxhdpi-v4/ic_launcher] D:\AppLAMWProject1\res\mipmap-xxxhdpi\ic_launcher.png [mipmap-xxxhdpi-v4/ic_launcher] D:\AppLAMWProject1\res\mipmap-xxxhdpi\ic_launcher.webp: Error: Duplicate resources
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
Bug #2.
Just create new empty project:
New Project -> LAMW [GUI] Android module
Then go to the menu:
Tools -> [LAMW] Android module wizard -> Convert the Project to AppCompat Theme -> AppAppCompatNoActionBar
Lazarus crashes with the error:
"" is invalid integer