1

I placed the files of the repository in the .m2 folder but android studio is unable to resolve it

Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.redcpt:sdk:0.0.1

does anyone know what might be the issue

zedlabs
  • 523
  • 7
  • 18
  • Why did you place the files manually? Maven will do it for you. It would be helpful to share related parts of `pom.xml`/ `settings.xml` if present. Also android studio by default uses gradle as build tool. The exception you have shared comes from gradle, are you sure you are using Maven? – leopal May 28 '20 at 07:44
  • I dont have much experience with maven, my company shared with me a sdk folder and in the install steps they said to place it in the .m2 folder, I didnt have a .m2 folder, so I installed maven and placed it there. – zedlabs May 28 '20 at 07:46
  • the structure of that folder is sdk -> 0.0.1 ->.pom, .jar, .aar files here. – zedlabs May 28 '20 at 07:48
  • A dependency with coordinates `com.redcpt:sdk:0.0.1` should exist in `.m2/repository/com/redcpt/sdk/0.0.1/` – Mark Rotteveel May 28 '20 at 13:09
  • @MarkRotteveel thank you very much, I feel so stupid for wasting 2 days due to this, please post this as an answer so that I can accept it. – zedlabs May 28 '20 at 13:28

2 Answers2

2

In the comments you mention "the structure of that folder is sdk -> 0.0.1 ->.pom, .jar, .aar files here.". That is the wrong location. A Maven dependency with coordinates com.redcpt:sdk:0.0.1 should be saved in .m2/repository/com/redcpt/sdk/0.0.1/.

It might be simpler to use Maven to install files into your local repository, see also How to add local jar files to a Maven project? (although I don't know what needs to be done to store the .aar file that way).

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
0

Android Studio automatically places the Maven repositories in the correct location when you download them from Maven. There's no reason to go into any local maven folders.

Start a new project from scratch while connected online and see if that helps. You will be given updated options on dependencies sourced from Maven.