Looking to do a simple game and test on my Pixel Watch 2.
Using WearOS 4.0, I’ve been following a mix of these:
This thread:
and this blog from a while ago:
The Unity documentation, specifically the android build settings page:
On Unity 2020.3.33f1 for reasons, can export (from Unity) to an AAB as long as using Target API Level ‘Android 11.0 (API level 30)’, via IL2CPP. When importing the project (Importing the Module in current Android Studio does nothing, to my knowledge), I get all kinds of errors in Android studio when it comes to importing the project and letting Gradle do its thing. I’m running in circles now and feel stuck.
Here’s the pertinent info I know people will want to see, and please ask if there’s more:
Build settings:
Player Settings:
And the error in Android Studio:
Build file 'D:\Unity\ws\WearDice\Build\launcher\build.gradle' line: 1
A problem occurred evaluating project ':launcher'.
> Failed to apply plugin 'com.android.application'.
> Could not create an instance of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.
> Could not create an instance of type com.android.build.gradle.internal.dsl.TestOptions.
> Could not create an instance of type com.android.build.gradle.internal.dsl.TestOptions$UnitTestOptions.
> 'void org.gradle.api.internal.DefaultDomainObjectSet.<init>(java.lang.Class)'
* 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.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 244ms
When running with --info:
Build file 'D:\Unity\ws\WearDice\Build\launcher\build.gradle' line: 1
A problem occurred evaluating project ':launcher'.
> Failed to apply plugin 'com.android.application'.
> Could not create an instance of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.
> Could not create an instance of type com.android.build.gradle.internal.dsl.TestOptions.
> Could not create an instance of type com.android.build.gradle.internal.dsl.TestOptions$UnitTestOptions.
> 'void org.gradle.api.internal.DefaultDomainObjectSet.<init>(java.lang.Class)'
There is basically nothing in the project so far, I just wanted to see something get on the watch first, but I can’t even get that far.
Is there anyone out there that has some advice for building for WearOS, or where to look for hints/ideas on what I could be doing wrong?
– I just realized someone may ask, “Why even use Android Studio in the first place, if you’re just trying to see it work on your device? Just build to an APK and sideload it!” Yes, I have thought of that, but side-loading onto WearOS 4 is tricky, nigh-impossible even. The solutions I’ve found on the web include downloading separate programs on my phone that can then sync with the watch and load them that way, but as Unity doesn’t build things in a Component (which WearOS needs), I’ve only met with failure there. One would THINK a standard APK could just work on a derivative of Android, but no. Thus the need for the extra step (which is why I used the blog I posted above as a starting point).