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

build android library with two or more local aar libs failed at version 3.5.0 #10882

Closed
kawais opened this issue Sep 26, 2019 · 11 comments
Closed
Labels
a:bug closed:android An issue with the Android Gradle Plugin or Android Studio

Comments

@kawais
Copy link

kawais commented Sep 26, 2019

Expected Behavior

build android library with two or more local aar libs success in AS

Current Behavior

build failed

Context

I want build the library to aar for other project, but build failed.

Steps to Reproduce

when run command: gradlew mylibrary:build

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':mylibrary:mergeDebugJavaResource'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
More than one file was found with OS independent path 'classes.jar'

example project: https://github.com/kawais/testapp

Your Environment

android stuido 3.5
windows 10

@samuelneff
Copy link

I ran into the same issue with an internal component and resolved by downgrading Gradle to 3.4.2. This issue still persists in Gradle 3.5.2.

@zabojad
Copy link

zabojad commented Sep 15, 2020

Hi there, any solution found for this problem?

@mzennis
Copy link

mzennis commented Sep 21, 2020

this problem still occurred in Gradle 3.5.3

@friederbluemle
Copy link
Contributor

this problem still occurred in Gradle 3.5.3

That's correct. If you want to "fix" it by downgrading, try using 3.4.3.

@mzennis
Copy link

mzennis commented Sep 23, 2020

I couldn't downgrade the Gradle version, I fixed it by uploading the aar's to internal artifactory

@friederbluemle
Copy link
Contributor

I couldn't downgrade the Gradle version, I fixed it by uploading the aar's to internal artifactory

Interesting.. Can you share some details which files you uploaded?

@zabojad
Copy link

zabojad commented Sep 28, 2020

@mzennis could you please describe how you did this:

I fixed it by uploading the aar's to internal artifactory

@zabojad
Copy link

zabojad commented Sep 30, 2020

OK, here is a little update from my side on this issue. I'm using React native and latest versions of RN 0.63 uses gradle plugin 3.5.3 by default.

I tried to update to gradle plugin 3.6.4 and it seems to work, solving by the way this issue with aar files.

Hope this will help someone.

@ColdLight230
Copy link

ColdLight230 commented Nov 9, 2020

I fixed it by add this code in module bulid.gradle

packagingOptions {
        merge "classes.jar"
        merge "AndroidManifest.xml"
        merge "proguard.txt"
}

@mzennis
Copy link

mzennis commented Nov 13, 2020

I couldn't downgrade the Gradle version, I fixed it by uploading the aar's to internal artifactory

Interesting.. Can you share some details which files you uploaded?

I uploaded the aar library file that was previously local to the internal repository.

before:
implementation files('libs/mylibrary.aar')

now:
implementation 'com.xxx.xxx:mylibrary:1.0@aar'

@bmuskalla
Copy link
Contributor

Thank you for your interest in Gradle!

This is an issue with the Android Gradle Plugin which is developed by Google and cannot be addressed in the core of the Gradle Build Tool.

Please open such Android-related issues on the Android Issue Tracker at https://source.android.com/source/report-bugs

@bmuskalla bmuskalla added the closed:android An issue with the Android Gradle Plugin or Android Studio label Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug closed:android An issue with the Android Gradle Plugin or Android Studio
Projects
None yet
Development

No branches or pull requests

8 participants