I'd like to make a small patch to Fenix, so I attempted to build it locally on an Arch Linux amd64 server.
The instructions say to clone the master branch and run:
./gradlew clean app:assembleGeckoBetaDebug
At first it failed with a cryptic message: "General error during semantic analysis: Unsupported class
file major version 57". After googling, it seems that an old version of Groovy is being used that isn't compatible with the currrent OpenJDK. Downgrading to OpenJDK 12 seems to be a workaround. Perhaps this could be mentioned or versions updated?
I then get the following error below, which seems to indicate that the build variant is no longer valid.
[me@dev3 fenix]$ ./gradlew clean app:assembleGeckoBetaDebug
> Task :buildSrc:compileKotlin UP-TO-DATE
> Task :buildSrc:compileJava NO-SOURCE
> Task :buildSrc:compileGroovy NO-SOURCE
> Task :buildSrc:pluginDescriptors UP-TO-DATE
> Task :buildSrc:processResources NO-SOURCE
> Task :buildSrc:classes UP-TO-DATE
> Task :buildSrc:inspectClassesForKotlinIC UP-TO-DATE
> Task :buildSrc:jar UP-TO-DATE
> Task :buildSrc:assemble UP-TO-DATE
> Task :buildSrc:compileTestKotlin NO-SOURCE
> Task :buildSrc:pluginUnderTestMetadata UP-TO-DATE
> Task :buildSrc:compileTestJava NO-SOURCE > Task :buildSrc:compileTestGroovy NO-SOURCE
> Task :buildSrc:processTestResources NO-SOURCE
> Task :buildSrc:testClasses UP-TO-DATE
> Task :buildSrc:test NO-SOURCE
> Task :buildSrc:validateTaskProperties UP-TO-DATE > Task :buildSrc:check UP-TO-DATE
> Task :buildSrc:build UP-TO-DATE
[settings] Missing local.properties; see https://github.com
/mozilla-mobile/fenix/blob/master/README.md#local-properties-helpers for instructions.
> Configure project :app
WARNING: The option setting 'android.enableR8.fullMode=true
' is experimental and unsupported.
The current default is 'false'.
Generated versionCode: 13380031
FAILURE: Build failed with an exception.
* What went wrong:
Task 'assembleGeckoBetaDebug' not found in project ':app'.
* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --in
fo 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 890ms
Similar issue...
Task 'assembleGeckoBetaDebug' not found in project ':app'.
Similarly:
Task 'assembleGeckoNightlyDebug' not found in project ':app'.
And so on... (assembleDebug) too.
Doing:
./gradlew init
./gradlew wrapper
Seemed to do more stuff... but all end with failure.
I noticed the same issue on a clean clone of the repo.
However, if I open the project in Android Studio 3.5, I can build with Studio. If I then go back to the command line and try rebuilding, the 'assembleGeckoBetaDebug' task is available will build the project.
I hit this issue also. After much head scratching, I realized that a local.properties
file needs to be added to the root fenix
folder, containing a valid sdk.dir=<path to android sdk>
.
For a gecko developer on macosx, this looks like:
sdk.dir=/Users/<user name>/.mozbuild/android-sdk-macosx
Once I created this file, ./gradlew app:assembleGeckoBetaDebug
suddenly appeared.
Most helpful comment
I hit this issue also. After much head scratching, I realized that a
local.properties
file needs to be added to the rootfenix
folder, containing a validsdk.dir=<path to android sdk>
.For a gecko developer on macosx, this looks like:
Once I created this file,
./gradlew app:assembleGeckoBetaDebug
suddenly appeared.