Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build out-of-the-box. (Sponsorship) #644

Open
StevanWhite opened this issue Jun 19, 2024 · 5 comments
Open

Fails to build out-of-the-box. (Sponsorship) #644

StevanWhite opened this issue Jun 19, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@StevanWhite
Copy link

Description

The project fails to build out-of-the box on latest Android Studio.

Environment

  • Device:
  • OS:
  • Version: git as of 06/19/2024
  • Android Studio 2024.1.1

To reproduce

Steps to reproduce the behaviour:

  1. git clone https://github.com/Slion/Fulguris.git

  2. open Fulguris project in Android studio

  3. allow to synch

  4. build

  5. see error:

    Cannot find symbol class Sponsorship
    $PROJECTS$/Fulguris/app/build/generated/source/buildConfig/androidTest/slionsFullDownload/debug/fulguris/test/
    BuildConfig.java:17: error: cannot find symbol
    public static final Sponsorship SPONSORSHIP = Sponsorship.BRONZE;

Expected behaviour

It should just build.

Additional

I made no changes to the source, and just use the AS distro JDK, etc.

@StevanWhite StevanWhite added the bug Something isn't working label Jun 19, 2024
@Slion
Copy link
Owner

Slion commented Jun 19, 2024

Last I checked the build server worked so it's likely to be the usual configuration issues with Android Studio. Try to build another flavor maybe, the F-Droid one maybe. Make sure you clear the Android Studio caches and clean things up properly by deleting the proper directories. Maybe just clone the repo in a new folder and try again if you are not familiar with sorting out Android Studio issues. It could also be that they changed something in the latest Android Studio version and that things need adjusting again.

@StevanWhite
Copy link
Author

I see no declarations of "Sponsorship" anywhere in this project.
Where should that come from?

The "flavor" menu is grayed out. Is this a clue?

I have deleted .gradle/ and clear-caches-restarted. No smiles.

I am horribly familiar with sorting out AS issues.

I tried updating all the dependencies... now I'm getting an error I didn't see before: the dreaded "Duplicate class found"
(But this is not the original issue... this is a general Gradle issue.)

@StevanWhite
Copy link
Author

Update: I got build flavors now.

AS wanted to update something about "test coverage", and I let it do that.
Now I was able to build the F-Droid release variant, and...
same problem.

OK. I'm debugging the thing for you now.

I found the root of the first problem. The gradle property
android.defaults.buildfeatures.buildconfig
has been deprecated. It now no longer functions.

Instead, under android{} in build.gradle:
buildFeatures {
buildConfig = true
}

NOW it finds "Sponsorship". Not building yet. Will advise.

@StevanWhite
Copy link
Author

Updated dependencies and re-built.
Now get "Duplicate class found"
info.guardianproject.netcipher.R found in modules netcipher-2.1.0.jar ->
jetified-netcipher-2.1.0 (info.guardianproject.netcipher:netcipher:2.1.0) and
netcipher-webkit-2.1.0.jar ->
jetified-netcipher-webkit-2.1.0 (info.guardianproject.netcipher:netcipher-webkit:2.1.0)

Known problem.
https://gitlab.com/guardianproject/tormobile/NetCipher/-/issues/17

Tried downgrading

// tor proxy
implementation "info.guardianproject.netcipher:netcipher:2.0.0-alpha1"
// Updating this breaks our build
implementation 'info.guardianproject.netcipher:netcipher-webkit:2.0.0-alpha1'

That gets rid of the Duplicate class problem.

Next:
Missing class org.jspecify.annotations.NullMarked (referenced from: org.jsoup.internal.FieldsAreNonnullByDefault and 2 other contexts)

Try adding dependency:
implementation 'org.jspecify:jspecify:0.3.0'

Now it builds.

I can give you further help, if you're unfamiliar with sorting out Android Studio problems!

@StevanWhite
Copy link
Author

Let me clarify some of that.
The main problem, and the one I had the most trouble figuring out, is the deprecated

android.defaults.buildfeatures.buildconfig

This deprecation is not new. You should be able to remove that directive, and replace it with

buildFeatures {
    buildConfig = true
}

under android{} in build.gradle.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants