tompos
Veteran developer
Profile
Posts: 127
Reg: Oct 19, 2013
Würzburg
7,370
02/01/24 07:18 AM (9 months ago)

State of the Buzztouch Art for Android

Last year I had added a question at the end of thread on BT-5 version for Android apps (https://www.buzztouch.com/forum/thread.php?tid=98E1FB1DA39F1F66CBB3697&fid=06DB0BCB08E3333&sortColumn=FT.id&sortUpDown=DESC&currentPage=1) ... after my client took his time to decide on an update of the app, we are now ready for updating the source code to the most recent BT version for Android (iOS will follow, but the Android is most urgent). I just copy my question from the thread mentioned above: -------------------------------------------------------------- Hi, just got back to see what is going on with the Android source code. The background is that I want to update the Android version of an app for a client. I developed the app on my self hosted version and had developed several individual plugins for my client. So my questions are 1) Is it possible to use the new Buzztouch 5.0 version for Android on my self hosted server? Is there a recipe to receive and use the patch? 2) As the BT core is refactored in Kotlin, will I have to modify my plugins massively? I am just trying to see the effort it takes to roll out the next version of the app. 3) In former updates I had successfully used a "mixed update" strategy: I downloaded a fresh version from buzztouch.com (to benefit from new core implementations) and added my plugin files and the config file from my self hosted server. Would that be an appropriate (or perhaps the only?) option to benefit from the new Buzztouch 5.0 Android code? Thanks in advance for your help! Thomas
 
Sherry
Lost but trying
Profile
Posts: 135
Reg: Jan 05, 2013
South Africa
11,650
like
02/04/24 11:41 AM (9 months ago)
Must admit I didnt have much success trying to update and puplish an Android app towards the end of llast year and tried reaching out to Chris1 to see if he could fix the bugs but he never replied to my message. I hope it doesnt get there butI might need to ditch BT for Android and look for a platform better maintained for android.
 
Cakebit
Code is Art
Profile
Posts: 501
Reg: Dec 15, 2010
In your local b...
16,510
like
02/07/24 01:50 AM (9 months ago)
Hi Thomas! Currently, we've opted to only release any beta Core releases only to Buzztouch.com– this is to reduce smaller updates to the Self Hosted Core... while the official support is only currently through Buzztouch.com, there's no reason why you couldn't take a hybrid approach where you pull the source from the Buzztouch.com panel and then edit the configuration data url to point to self hosted instance. There aren't any major changes to the JSON structure for apps running Buzztouch 5.0 for Android, so you really shouldn't run into any issues with using a Self Hosted server (other than having to download the package from Buzztouch.com)... Your Java plugins should still be supported in the new core, but you may want to refactor them slightly or port them to Kotlin. Perhaps run a sample project and see what issues the compiler throws to know what to tackle... As we move out of beta we'll need to provide a patch to your Self Hosted panel to allow you to download the new source (there's some modifications needed for the Kotlin file extensions to be compatible in the package download process). I'll look into the effort required to do this (behind the scenes we put some systems in place to help getting these updates out faster in the future). We can always use this thread or start a chat conversation to tackle the issues you run into as the update process begins... it's probably a good excuse for me to touch up my Android skills as it's been a long time since I've released a project on Google Play... Sherry, Are there any specific questions or issues you ran into? I can probably be a resource to help if you need additional support getting your Android project running (and of course we want to fix any bugs before it hits main release!). Thanks all!
 
tompos
Veteran developer
Profile
Posts: 127
Reg: Oct 19, 2013
Würzburg
7,370
like
02/08/24 09:31 AM (9 months ago)
Hi Cakebit, thanks for your detailed help. I hoped that the transition might not be too complex... and as it seemed pretty straigthforward I started the transition. Unfortunately, I had much more basic problems than my plugin code. Although it may be a bit lengthy and boring to read my road blocks on the way, it may help others to develop their Android apps. E. g., here were similar error reports: https://www.buzztouch.com/forum/thread.php?tid=408092B6D5268BE83BB2FE1&fid=06DB0BCB08E3333&sortColumn=FT.id&sortUpDown=DESC&currentPage=1 1) I followed the guide to install the latest version of Android Studio: https://buzztouch.notion.site/Installing-Android-Studio-on-macOS-23c82965ed454adda5bbc6abc0f8a945 and created a virtual device for Tiramisu (33). 2) I had created a BT project in my buzztouch.com account that I had always used for testing. I downloaded both BT4 and BT5 versions. 3) BT4 version The first error message was : * The project uses Gradle 3.3 which is incompatible with Java 11 or newer. * Possible solution: Upgrade Gradle wrapper to 7.2 version and re-import the project * Upgrade to Gradle wrapper 7.2 I upgraded as proposed... and got 2 errors... but I simply did not solve the first one: * Exception java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema [in thread "Daemon worker"] The suggestions on https://stackoverflow.com/questions/46402772/failed-to-install-android-sdk-java-lang-noclassdeffounderror-javax-xml-bind-a did not help, the error message remained even after installing the command-line tools 4) BT5 version * Unsupported Java. * Your build is currently configured to use Java 17.0.7 and Gradle 7.0.2. * Possible solution: - Upgrade Gradle wrapper to 7.2 version and re-import the project I upgraded... BUILD SUCCESSFUL in 2s. Sounds good. When I try to run the app... * java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x4f75c7e8) cannot access class com.sun.tools.javac.util.Context (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x4f75c7e8 at org.jetbrains.kotlin.kapt3.base.KaptContext.<init>(KaptContext.kt:29)... many lines follow * Execution failed for task ':app:kaptGenerateStubsDebugKotlin'. * On https://stackoverflow.com/questions/71525731/java-lang-illegalaccesserror-class-org-jetbrains-kotlin-kapt3-base-kaptcontext there are many different suggestions... I tried the "kotlin_version = '1.6.21') path * Indeed, the error was removed... it was substituted by Run: Execution failed for task ':app:kaptDebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction > java.lang.reflect.InvocationTargetException (no error message) ... exactly at the place where https://www.buzztouch.com/forum/thread.php?tid=408092B6D5268BE83BB2FE1&fid=06DB0BCB08E3333&sortColumn=FT.id&sortUpDown=DESC&currentPage=1 had landed... So, in summary. I have spent several hours to find a path to run my simple Buzztouch app for Android. 1) Any obvious mistakes that I had done on the way? 2) Has anyone succeeded on this path in the last months? 3) Wouldn't it be a good idea to have a step-by-step guide that goes beyond the "install Android Studio and open your Buzztouch project". If I get beyond these initial problems I might write something along those lines... but at the moment I do not really see how I can succeed with my apps. Thanks for reading the much too long report Thomas
 
Cakebit
Code is Art
Profile
Posts: 501
Reg: Dec 15, 2010
In your local b...
16,510
like
02/09/24 12:11 AM (9 months ago)
Hi Thomas, Your process was actually really helpful! Let's start with the Android 5.0 Beta, as that will be easier to get up and running. What is the minimum Android version you'd like to target? (You mentioned Tiramisu, so potentially v33?) The error you're getting ... Run: Execution failed for task ':app:kaptDebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction > java.lang.reflect.InvocationTargetException (no error message) ... is like the generic "Something went wrong" message– and doesn't give us much info about what went wrong... but typically it comes down to some configuration issue between your Gradle(:project) or Gradle(:app) files. I downloaded a fresh Buzztouch Android project, and made a couple tweaks to get it running: - Ran Gradle updates From Android Studio (this included updating libraries) - Updated targetSdkVersion to v34 - Updated compose and kotlin versions (as the last time I did an Android project was a looonnngg time ago) - Updated AndroidManifest.xml to adjust file permissions for newer Android version(s) - Tweaked a couple files to adjust for changes in syntax since I updated libraries (these would have been fine if I left as-is) I uploaded a generic project that might be a good starter for you to download and try out. If you have Xcode installed it comes with a helpful utility called FileMerge that you can use to compare your project to this one and merge together the changes. http://buzztouch.com/files/patches/buzztouch_Android_BTv5.0.0_v34.zip (Not sure if it matters, but running in Android Studio Hedgehog) > Wouldn't it be a good idea to have a step-by-step guide that goes beyond the "install Android Studio and open your Buzztouch project"...? Ideally yes! (Or hopefully even better, that should be all you really need to do... just drag it over a fairly modern version of Android Studio and it runs!)... unfortunately Android is so fragmented that every version breaks something or other that requires manual intervention... and this is why I'm not an Android developer. 😭 *cries in Android* Let me know how it goes!
 
tompos
Veteran developer
Profile
Posts: 127
Reg: Oct 19, 2013
Würzburg
7,370
like
02/09/24 04:25 AM (9 months ago)
Hi! Thank you so much... I just read your message, so I am very optimistic to get beyond my problems. Great! I will give a feedback soon. As I am developing for Apple devices since 1992 the Android world is pretty confusing for me as well. While reading your message several of your steps led to instant questions on my side (where & how do I update compose and kotlin version... and to what values? What does it mean to "tweak a couple files" in detail ;-) ). But as I finally saw that you provide a project that should work fine, I am optimistic now... at the end, the Android projects that we download within buzztouch.com will (at some point in the future) mirror those modifications that you just did for me...? So... on to testing your work. Thanks again!!!!
 
tompos
Veteran developer
Profile
Posts: 127
Reg: Oct 19, 2013
Würzburg
7,370
like
02/09/24 06:13 AM (9 months ago)
... it works! I could build the app and run it on a virtual device. Great! Two comments... 1) I could not run the app on my physical device that I had used for testing (outdated SDK version 28). My question here: The project has a minimum SDK version of 34, is this a good idea or does that mean that the app runs only on devices with the last SDK version? 2) When looking at your project I see that I had just used the minimally suggested updates (upgrade grade to 7.x) where you seem to have updated it to a more recent version (8.2). So it had required a major update on several levels... my attempts were something in between ;-). Thanks again, now I can focus on the Buzztouch specific topics.
 
Sherry
Lost but trying
Profile
Posts: 135
Reg: Jan 05, 2013
South Africa
11,650
like
03/03/24 04:20 AM (8 months ago)
Hi Cakebit I used your zip file (http://buzztouch.com/files/patches/buzztouch_Android_BTv5.0.0_v34.zip) to install on an Android device and that part worked, thanks for that update. What isn't working however is: - the pdf plugin, it isn't opening files downloaded from a URL or local files. - app refresh is causing the app to crash.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
03/17/24 08:45 AM (8 months ago)
Cakebit - Thanks for propping this up.
 
tompos
Veteran developer
Profile
Posts: 127
Reg: Oct 19, 2013
Würzburg
7,370
like
03/25/24 08:03 AM (8 months ago)
Thanks, again, Cakebit, I just wanted to follow on and report a similar problem. I could update my project and the build phase was fine. Running the app, however, was not possible as the "app refresh" part crashes the app, similar to what Sherry had reported. I am trying to understand the problem with debug and log, but I did not succeed yet.
 
Cakebit
Code is Art
Profile
Posts: 501
Reg: Dec 15, 2010
In your local b...
16,510
like
03/26/24 12:58 AM (8 months ago)
Getting things running is a good start... could you see if there are any errors from Logcat that appear around the time you refresh / the app crashes? (Also not sure it will matter, but what plugin are you using as the Home Screen of your app?) I'm going to try and replicate the issue on my end... :) Edit: Think I found the issue. Can you please try replacing the function at line 13 in /app/src/main/java/com/{your_app_name}/extensions/NetworkingExtensions.kt with: suspend fun String.readTextFromUrl(saveAsFileName: String? = null): String { val client = HttpClient(CIO) val response: HttpResponse = client.get(this) val responseBody = response.bodyAsText() client.close() saveAsFileName?.let { BT_fileManager.saveTextFileToCache(responseBody, it) } return response.bodyAsText() }
 
Cakebit
Code is Art
Profile
Posts: 501
Reg: Dec 15, 2010
In your local b...
16,510
like
03/26/24 01:52 AM (8 months ago)
Also, not sure if this is an easier route for you, but I've enabled the 5.0.1 beta on the downloads page, so if you'd like to just grab a fresh copy of the source-code you can do so by selecting the "[Android Beta] Buzztouch Core v5.0.1" dropdown. (Small note: Not all plugins support the import method used in the Kotlin source so if any builds fail, perhaps try un-checking any non-market plugins)
 
tompos
Veteran developer
Profile
Posts: 127
Reg: Oct 19, 2013
Würzburg
7,370
like
03/27/24 11:51 PM (8 months ago)
Thanks, again, Cakebit, I just wanted to follow on and report a similar problem. I could update my project and the build phase was fine. Running the app, however, was not possible as the "app refresh" part crashes the app, similar to what Sherry had reported. I am trying to understand the problem with debug and log, but I did not succeed yet.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
03/30/24 05:41 PM (7 months ago)
My App uses the Location Map Plugin. It's been over 10 years since I did anything with the code. (It runs fine! But I can't have it in the Google Apps Store because it is old and doesn't conform in some ways.) Can someone help me update the core, and make G Play happy?
 
tompos
Veteran developer
Profile
Posts: 127
Reg: Oct 19, 2013
Würzburg
7,370
like
04/04/24 12:48 AM (7 months ago)
Thanks, again, Cakebit, I just wanted to follow on and report a similar problem. I could update my project and the build phase was fine. Running the app, however, was not possible as the "app refresh" part crashes the app, similar to what Sherry had reported. I am trying to understand the problem with debug and log, but I did not succeed yet.
 
tompos
Veteran developer
Profile
Posts: 127
Reg: Oct 19, 2013
Würzburg
7,370
like
04/04/24 02:40 AM (7 months ago)
Thanks, again, Cakebit, I just wanted to follow on and report a similar problem. I could update my project and the build phase was fine. Running the app, however, was not possible as the "app refresh" part crashes the app, similar to what Sherry had reported. I am trying to understand the problem with debug and log, but I did not succeed yet.
 
tompos
Veteran developer
Profile
Posts: 127
Reg: Oct 19, 2013
Würzburg
7,370
like
04/08/24 05:17 AM (7 months ago)
 
Gledy
Aspiring developer
Profile
Posts: 109
Reg: Feb 25, 2013
Fleet, UK
3,240
like
08/14/24 11:08 AM (3 months ago)
Hi Cakebit, The last suggestion was to download a 5.0.1 beta but that no longer works as this is the following error when trying to package a project: Errors occurred processing your request... 1) No Imports Fixed. 2) No Imports Fixed. I've managed to get your simple Android app to work fine in Android studio. So I downloaded a v5 package of my app, a large amount of issues start with the gradel like the last time I tried, but I remember you suggesting somewhere to use FileMerge in Xcode against the simple app, I got it past the grade errors, but I get errors within the app eg: NetworkingExtenions.kt etc, so unable to run it on a device. Im guessing these errors weren't coming up in 5.0.1? Anyway long story short, I'd love to get my app to work on Android, is there anything that can be done so this is possible?
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.