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

x/mobile: failed to transform file 'hello.aar' to match attributes #25290

Closed
QQMBR opened this issue May 8, 2018 · 6 comments

Comments

Projects
None yet
5 participants
@QQMBR
Copy link

commented May 8, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using?

go 1.10.2 on arch linux

What operating system and processor architecture are you using (go env)?

Arch Linux, amd64

What did you do?

I'm trying to use go with Android Studio and have followed the introduction at the go mobile wiki, importing the hello project, setting my GOPATH etc. and than building the project.

What did you expect to see?

A successful build

What did you see instead?

I got the errors

Unable to resolve dependency for ':app@debug/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

Unable to resolve dependency for ':app@release/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

The same error presents itself when trying to import an already built .aar
I'd be very thankful if anyone can point me in the right direction!

@gopherbot gopherbot added this to the Unreleased milestone May 8, 2018

@gopherbot gopherbot added the mobile label May 8, 2018

@bradfitz

This comment has been minimized.

Copy link
Member

commented May 8, 2018

@eliasnaur

This comment has been minimized.

Copy link
Contributor

commented May 8, 2018

Please provide the detailed steps to reproduce the problem. What version of Android Studio? Which commands are you running? And so on.

@QQMBR

This comment has been minimized.

Copy link
Author

commented May 8, 2018

Using Android Studio 3.1.2 (latest).
Ran
go get -d golang.org/x/mobile/example/bind/...
To get the example hello project, from then on importing it into Android Studio and editing the GOPATH and GO paths in the hello/build.gradle, as per the gomobile wiki.

After that, simply syncing gradle returns this error.

@ALTree ALTree changed the title x/mobile: x/mobile: failed to transform file 'hello.aar' to match attributes May 8, 2018

@eliasnaur

This comment has been minimized.

Copy link
Contributor

commented May 9, 2018

It seems this is a dup of #23307.

@eliasnaur eliasnaur closed this May 9, 2018

@gopherbot

This comment has been minimized.

Copy link

commented May 9, 2018

Change https://golang.org/cl/112455 mentions this issue: misc/androidstudio: drop the clean task to fix Android Studio gradle sync

@eliasnaur

This comment has been minimized.

Copy link
Contributor

commented May 9, 2018

The CL should fix the issue. Note that only gradle sync fails; running a gomobile project from Android Studio does work.

gopherbot pushed a commit to golang/mobile that referenced this issue May 9, 2018

Elias Naur
misc/androidstudio: drop the clean task to fix Android Studio gradle …
…sync

Suggestion from

golang/go#23307 (comment)

I've manually verified in Android Studio that removing the clean task
does fix the issue reported in golang/go#25290.

Fixes golang/go#25290.
Fixes golang/go#23307.

Change-Id: Ic1a8c240fc8e4c4aaf59977fd559dd221ff605b1
Reviewed-on: https://go-review.googlesource.com/112455
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>

@golang golang locked and limited conversation to collaborators May 9, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.