Is it no longer possible to build an Android app with Wappler?

@HeikoK So Ive tried electric eel and Im still getting the same problem.

@George @Teodor has there been any developments on running a Wappler app on the Android emulators? Apparently there have been some changes to Gradle and AS that make the Wappler Docs on the subject obsolete.

Hi All,

Change to the following:-

classpath ‘com.android.tools.build:gradle:7.2.1’
classpath ‘com.google.gms:google-services:4.3.13’

and using Electric Eel Solved the issue and able to run in simulator successfully.

1 Like

android-studio-2022.1.1.19-windows - This is the version I used.

1 Like

The latest version 5.8.1 seems not that stable… I use back V 5.2.5 and everything work fine like before… Just for info…

1 Like

I am still running into errors. I cannot get the app to run

@phan @kfawcett @HeikoK @brad

Thank you all so much for taking the time to work with me on this. I found a solution and wanted to share. I spent weeks ripping my hair out over this and am stoked to have finally figured it out.

  1. Upgrade to AS Flamingo (I know, many of us thought this was the problem, but stick with me here)
  2. Install SDK 33 (not 31 like Wappler docs say, and not 34 which is the default). Also make sure you have command line tools installed and your desired emulators set up. Also make sure you have downloaded the disk images from the SDK package.
  3. Open the Android folder from your Wappler project in Android Studio (if you haven’t added it from Wappler yet, do so now. Or if you already have, delete it and re-add it to your Wappler project so you can start fresh.
  4. Under project structure set Android Gradle Plugin Version to 7.4.2
  5. Then set Gradle version to 7.5 (this will get you past the namespace error)

Now at this point to project will build but will not run. When you try to run you will likely get the duplicate classes error. This is something dumb in Kotlin. but I have a hacky fix here:

  1. Open your build.gradle (Module :app) file (NOT build.gradle (Project :android)…important distinction)
  2. Paste the following code at the very bottom of that file

configurations.implementation {
exclude group: ‘org.jetbrains.kotlin’, module: ‘kotlin-stdlib-jdk8’
}

  1. Sync, build in AS and run from AS or Wappler.

The app should now run on the emulator and you should be able to launch it from Wappler

Please note that I am on a Mac M1 and my project is using Capacitor 5.0.5 on a node.js and BS5 mobile app project.

If anyone is still stuck with this, please feel free to reach out.

1 Like

How to set above? Thanks

So in Wappler add Android to your project so it creates an Android folder in your project folder.

Then open the Android folder in Android Studio (Don’t open the entire project folder in AS, just the Android folder. Should look like this.

Then in AS go to file>Project Structure

Then from the drop-down select the plugin and Gradle version

Do note that if you have updated Capacitor to a new version, there might be some project changes needed.

See:

HI,

I have summarized below the steps I use to make Wappler run successfully in Android using the latest Wappler Version.

Create a wappler mobile app as usual; select either bootstrap or framework7 based on your own preference. After that generate the Android Platform as usual. Wappler will update the entire necessary file together with capacitor settings… Let it run until completed with success. At this point, if you try to run the App in Android Simulator, you will face error. Please open the file menu and change the following files by following the settings as stated.

package.json

@capacitor/cli”: “^5.0.5”

=====================================================

project.json

“target”: “Pixel_2_API_31”

=====================================================

build.gradle

classpath ‘com.android.tools.build:gradle:7.2.1’

classpath ‘com.google.gms:google-services:4.3.13’

=====================================================

variables.gradle

compileSdkVersion = 32

targetSdkVersion = 32

androidxActivityVersion = ‘1.4.0’

androidxAppCompatVersion = ‘1.4.2’

androidxCoreVersion = ‘1.8.0’

androidxFragmentVersion = ‘1.4.1’

coreSplashScreenVersion = ‘1.0.0-rc01’

androidxWebkitVersion = ‘1.4.0’

androidxJunitVersion = ‘1.1.3’

androidxEspressoCoreVersion = ‘3.4.0’

=====================================================

gradle-wrapper.properties

distributionUrl=https://services.gradle.org/distributions/gradle-7.4.2-all.zip

===============================================================================

After that you should be able to run in android simulator successfully. I tested both for Bootstrap and Freamework7 and it works.

2 Likes

Hi @phan, thanks for doing this. The default Android support in Wappler certainly looks to be broken and could do with some fixing up.

Regarding your instructions, would you be able to specify the paths to the files you’ve listed above? My project looks to have multiple instances of some of the files and I want to make sure I’m updating the correct one.

The reason I’m asking this is that I’ve had an attempt at following your instructions and it was giving me an error. So clearly I’ve done something wrong.

Here’s the error:

BUG! exception in phase ‘semantic analysis’ in source unit ‘BuildScript’ Unsupported class file major
version 63

1 Like

I attached the Print screen for your easy reference. Hope it help you so that we all can focus on mobile development instead of cracking our head on how to make it work on the Simulator.

Let me know if you face any issue…

3 Likes

scottclee,

You manage to make it work?

Did you ever get this to work? Iv’e tried everything in this thread with no luck.