After following those instructions it reverts to 4.6.0 as soon as you add a platform.
Ok, so I decided to once again try a fresh new project …
Android when EMulating:
Run your project for android ...
✔ Copying web assets from www to android/app/src/main/assets/public in 16.89ms
✔ Creating capacitor.config.json in android/app/src/main/assets in 1.08ms
[info] Inlining sourcemaps
✔ copy android in 31.75ms
✔ Updating Android plugins in 611.68μs
✔ update android in 31.01ms
✖ Running Gradle build - failed!
[error]
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not open proj generic class cache for build file '/Users/bradlawryk/Documents/Kopar/Apps/2024 Client
Gateway App/android/app/build.gradle'
(/Users/bradlawryk/.gradle/caches/8.0.2/scripts/9lf15vvlki1q1w0vdd1gpbuuw).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major
version 64
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 724ms
Error running your project for android!
iOS when trying to add the platform:
Again, this was a fresh new mobile project.
Brad, same error as you, but I was able to fix it.
- Check your java version
- Find the release file under
\Android\Android Studio\jbr
(could be:\Android\Android Studio\jre
)
And replace with the version you see on terminal.
That did the trick for me, recently (about 2 minutes ago)
Thanks Franse, I don’t know where to find that Android folder (step 2).
I am running same Java version as you.
Yes you can change those back to 5.0.0 for now manually.
We will be updating Wappler soon to support the latest Capacitor 5.
Check on android studio -> project structure -> sdk location -> jdk location, what do you see?
What about Gradle … seems it is still install v4 when v8 is now out. Seems all errors point to Gradle.
Brad, you don’t need to have any separate Java version installed. The one bundled with Android studio will be used and you can just enter the correct jdk path as I explained above.
I can’t find the Android Studio Folder … I am on a Mac
When you have the latest Android Studio it will work all fine with grade 8
@brad I used the Mac path above - you should better read my comments
In MY case, I had, the error:
[Could not open settings generic class cache for build file ']
(Same as brad)
The workaround was:
-
Closing Wappler and Android Studio
-
Killing jdk platform on task manager
-
Deleting
/Users/<username>/.gradle/caches
files -
On my jbr folder, the “release” file says: 17.X.X, changed to 20.0.2
No errors now.
Ok, Android is now emulating (and opening in Android Studio) on fresh project. But how do I fix iOS now? This error happens when trying to install platform.
EDIT: Got this solved. I now have a new project that emulates in both iOS and Android. Now to see if they open in xCode and Android Studio.
Another issue is my app keeps stopping in Android. The emulator will launch, show my loading screen then stop.
See:
Thank you for that. I do think this is a CORS problem and not Wappler, but it won’t let me inspect because the app keeps stopping right away in the emulator. I will post a solution if I find one.
The problem is that it changes right back as soon as you do anything like install a plugin, switch to your backend in Wappler. add a platform.
I am just about fed up.
I have had luck with making sure Capacitor/core is on latest version (it will revert a lot) then open Android studio from Wappler before launching the emulator, then let it auto update grade to 8. Then go back and launch the emulator from Wappler.
Sorry for my previous answer, have you tried debugging the app on AS ?
I was able to run it under api 34.
After reading the log, I found that com.franse.app was not aplying as I tought:
Was such a little mistake, wich I was not seeing.
Changed that, now: not only my app is running in the Wappler/Android Studio emulator, I also have fully deployed the apk file and running on my cellphone like a plane piloted by Tom Cruise.
I’m totally scared on how I was able to do this. Of course all the credits go to this amazing community.
I’ve been following this thread trying to set up a new mobile project. I’ve had all these errors (and more ) but I feel like I’m getting close. I now can at least open the project in Android Studio without errors. When I try to run the emulator in Wappler I get as far as the mobile flashing up with a default home screen (generic and not the quick page I built) but then it disappears. The play triangle (“run on connected device or emulate” button) is still flashing. If I try to run it in Android studio it throws an error:
Anyone have any ideas? I’m on Windows if that makes a difference (e.g. I had to use a different path for the JDK setting to the one George posted)