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

Cannot build from source #1328

Closed
nikonakoneko opened this issue Mar 4, 2023 · 7 comments · Fixed by #1329
Closed

Cannot build from source #1328

nikonakoneko opened this issue Mar 4, 2023 · 7 comments · Fixed by #1329

Comments

@nikonakoneko
Copy link

Well, maybe I'm missing something stupid I never built android apps before.

With latest commit from dev branch I get an error about androidx features and gradle tell me to fix it by enabling androidx in gradle.properties:

Execution failed for task ':app:checkDebugAarMetadata'.                                                                                                                                                                                [24/1359]
> Configuration `:app:debugRuntimeClasspath` contains AndroidX dependencies, but the `android.useAndroidX` property is not enabled, which may cause runtime issues.
  Set `android.useAndroidX=true` in the `gradle.properties` file and retry.
  The following AndroidX dependencies are detected:
  :app:debugRuntimeClasspath -> androidx.annotation:annotation:1.5.0
  :app:debugRuntimeClasspath -> androidx.appcompat:appcompat:1.6.0-rc01
  :app:debugRuntimeClasspath -> androidx.appcompat:appcompat:1.6.0-rc01 -> androidx.activity:activity:1.6.0-rc02
  :app:debugRuntimeClasspath -> androidx.preference:preference:1.2.0 -> androidx.collection:collection:1.1.0
  :app:debugRuntimeClasspath -> androidx.core:core:1.9.0
  :app:debugRuntimeClasspath -> com.google.android.material:material:1.7.0 -> androidx.annotation:annotation-experimental:1.3.0
  :app:debugRuntimeClasspath -> androidx.core:core:1.9.0 -> androidx.concurrent:concurrent-futures:1.0.0
  :app:debugRuntimeClasspath -> com.google.android.material:material:1.7.0 -> androidx.lifecycle:lifecycle-runtime:2.5.1
  :app:debugRuntimeClasspath -> com.google.android.material:material:1.7.0 -> androidx.lifecycle:lifecycle-runtime:2.5.1 -> androidx.arch.core:core-common:2.1.0
  :app:debugRuntimeClasspath -> com.google.android.material:material:1.7.0 -> androidx.lifecycle:lifecycle-runtime:2.5.1 -> androidx.arch.core:core-runtime:2.1.0
  :app:debugRuntimeClasspath -> com.google.android.material:material:1.7.0 -> androidx.lifecycle:lifecycle-runtime:2.5.1 -> androidx.lifecycle:lifecycle-common:2.5.1
  :app:debugRuntimeClasspath -> androidx.legacy:legacy-support-v13:1.0.0 -> androidx.legacy:legacy-support-v4:1.0.0 -> androidx.media:media:1.0.0 -> androidx.versionedparcelable:versionedparcelable:1.1.1
  […]

But if I do so, I have error about duplicated classes:

> Task :app:checkDebugDuplicateClasses FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
 > Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.1-runtime (com.android.support:support-compat:27.0.1)
   Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.1-runtime (com.android.support:support-compat:27.0.1)
   Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.1-runtime (com.android.support:support-compat:27.0.1)
   Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.1-runtime (com.android.support:support-compat:27.0.1)
   Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.1-runtime (com.android.support:support-compat:27.0.1)
   Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.1-runtime (com.android.support:support-compat:27.0.1)
   Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.1-runtime (com.android.support:support-compat:27.0.1)
   Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.1-runtime (com.android.support:support-compat:27.0.1)
   Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.1-runtime (com.android.support:support-compat:27.0.1)
   Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-27.0.1-runtime (com.android.support:support-compat:27.0.1)

I also tried to build stable branch and last tag. But I cannot either because org.bitbucket.haibison:underdogs dependency isnt available anymore

@ukanth
Copy link
Owner

ukanth commented Mar 4, 2023

Try beta branch.

@nikonakoneko
Copy link
Author

this is beta branch

following the build instructions: https://envs.sh/h0K.svg
and trying what gradle tells me to do about androidx deps: https://envs.sh/h0z.svg

@ukanth
Copy link
Owner

ukanth commented Mar 7, 2023

I don't have any issue building it locally. Even the CI job configured with the repo also able to build it without any issue.

https://github.com/ukanth/afwall/actions/runs/4349884599/jobs/7600040674

@NeroProtagonist
Copy link
Contributor

NeroProtagonist commented Mar 7, 2023

this is beta branch

following the build instructions: https://envs.sh/h0K.svg and trying what gradle tells me to do about androidx deps: https://envs.sh/h0z.svg

Remove your gradle.properties (with android.useAndroidx=true) and it should build (with warnings).

There is some work necessary before android.useAndroidx=true can be enabled.

Sorry, I actually need gradle.properties to build otherwise I get similar errors to you.

The contents of mine is:

android.useAndroidX=true
android.enableJetifier=true

@NeroProtagonist
Copy link
Contributor

NeroProtagonist commented Mar 7, 2023

@ukanth Should we add ./gradle.properties to the repo?
The CI build copies one from ./.github/ dir during the build.

@nikonakoneko
Copy link
Author

Ok thanks, I'll try that later and confirm if it works

@ukanth
Copy link
Owner

ukanth commented Mar 7, 2023

@ukanth Should we add ./gradle.properties to the repo? The CI build copies one from ./.github/ dir during the build.

I remembered, it was left out for f-droid builds i guess. We can add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants