0

gradle sync keeps failing with my android studio. need help

https://github.com/linkedin/dexmaker This is the open source i am trying to use called dexmaker. I tried to download by using

androidTestCompile 'com.linkedin.dexmaker:dexmaker-mockito-inline:2.21.0'

but it gets errors like this

Failed to resolve: com.linkedin.dexmaker:dexmaker-mockito-inline:2.21.1

I finally tried

androidTestCompile 'com.linkedin.dexmaker:dexmaker-mockito-inline:2.19.1'

this works but in my java code

The problem is even though i succeeded on syncing gradle, i still can't use the opensource.

 DexMaker dexMaker = new DexMaker();

DexMaker gets red lines and if i click it it says

cannot resolve symbol 'DexMaker'

what's the problem?

dusrud
  • 33
  • 4

1 Answers1

0

I'm not sure, but as I understand your situation:

You add dependency using androidTestCompile directive. That means that this package will become available only inside android test classes. For more understanding each dependency could be added in three ways: compile, testCompile and androidTestCompile.

  • compile : Dependency is available everywhere in your application code.
  • testCompile : Dependency available only in regular tests.
  • androidTestCompile : Dependency available only in android tests.

So if you want that dependency to be available in your application - replace androidTestCompile with compile. But I not sure, that you SHOULD do that, cause that library is for tests.

P.S. Using compile directives is deprecated and you should use implementation, testImplementation and androidTestImplementation.

Andrei Vinogradov
  • 1,865
  • 15
  • 32