18

I've the following line in my gradle android project inside the module build.gradle

dependencies {
 // a lot of dependencies
 implementation 'org.tensorflow:tensorflow-lite-select-tf-ops:0.0.0-nightly-SNAPSHOT'
}

and it causes the gradle build to fail with the following error

Null extracted folder for artifact: ResolvedArtifact(componentIdentifier=org.tensorflow:tensorflow-lite-select-tf-ops:0.0.0-nightly-SNAPSHOT:20210331.060351-75, variantName=null, artifactFile=C:\Users\USER\.gradle\caches\modules-2\files-2.1\org.tensorflow\tensorflow-lite-select-tf-ops\0.0.0-nightly-SNAPSHOT\b03a88bda4ad93e6fefe285f9ea303d28433eacc\tensorflow-lite-select-tf-ops-0.0.0-nightly-SNAPSHOT.aar, extractedFolder=null, dependencyType=ANDROID, isWrappedModule=false, buildMapping={__current_build__=C:\Users\USER\Desktop\Myapp2}, mavenCoordinatesCache=com.android.build.gradle.internal.ide.dependencies.MavenCoordinatesCacheBuildService$Inject@5c4450a)

I had the same implementation in a diffrent project and it worked but in this project this error keep on appearing.

what causes this error? and how can I fix it?

Daniel Botnik
  • 539
  • 1
  • 6
  • 20

7 Answers7

32

I got the same error when I was adding aar. I changed the implementation path and then fixed.

old path

implementation files('libs/test.aar')

new path

implementation files('../libs/test.aar')

Marsad
  • 859
  • 1
  • 14
  • 35
Umut Gültekin
  • 336
  • 3
  • 3
25

In my case I had to increase amount of RAM to 4096 in gradle.properties:

org.gradle.jvmargs=-Xmx4096M

After that project synced correctly.

Maciej S
  • 792
  • 1
  • 7
  • 16
8

I got the error when I was adding unit-ads.aar . I changed this in my code and its works for me.

Old Code

implementation files('../libs/unity-ads.aar')

New Code

implementation files('libs/unity-ads.aar')
Vinay Sharma
  • 91
  • 1
  • 3
1

In my case I had to go to the equivalent folder:

C:\Users\USER.gradle\caches\modules-2\files-2.1\org.tensorflow\tensorflow-lite-select-tf-ops

And delete it, then try to sync again, and worked.

M. Massula
  • 3,730
  • 2
  • 11
  • 14
1

You must check the path well for example:

implementation(files("./src/libs/myfile.aar")) 

or

implementation files("./src/libs/myfile.aar")
0

Well, you can be more explicit like this.

implementation files("$rootProject.projectDir/libs/test.aar")
Morgan Koh
  • 2,297
  • 24
  • 24
0

When importing arr/jar to AS, I have encountered this issue. My method is switching Project view to Project mode (not Android mode) and after that add aar/jar to libs folder (or any folder)

dotrinh

dotrinh PM
  • 903
  • 1
  • 7
  • 19