0

I have imported a module to my android project. Since I would like to have an opportunity to update my library, I did not import jar-file, but just a link.

  1. In settings.gradle I wrote

    include ':myLib'    
    project (':myLib').projectDir = new File('C:\\path\\to\\myLib\\')
    
  2. in app > build.gradle I added:

    compile project(':myLib')
    

After these manipulations Android Studio started to see my library module and added it to the project.

But it still does not see imported classes and cannot build. What I have done:

  • I started gradlew clean & gradlew build
  • I checked Android Plugin Version: it is equal for my app and for my imported module.

What can I do else?

So my Android Studio version is 2.1.1

My build tools version is 23.0.0

Adroid Plugin Version is 2.1.0

Gradle version is 2.10

user2957954
  • 1,221
  • 2
  • 18
  • 39
  • Was it mandatory to add the second line in settings.gradle? I import usually .aar and a simple `include` statement is enough for the settings.gradle file. The app's build.gradle seems fine. – dragi May 18 '16 at 15:04
  • 1
    @helleye, I wrote: Since I would like to have an opportunity to update my library, I did not import jar-file, but just a link. This method was described [here](http://stackoverflow.com/questions/32579557/how-to-update-an-imported-module-in-android-studio) – user2957954 May 18 '16 at 15:08
  • Thanks, I wasn't aware of that. I tried to reproduce your behaviour, but gradle cannot sync with an error: "Configuration with name 'default' not found". Do you have build.gradle file inside myLib module? – dragi May 18 '16 at 17:17
  • @helleye, it happens when the path is wrong – user2957954 May 19 '16 at 06:53
  • Ok, I managed to reproduce your case and saw the same issue. However, I also tried to do the same with an .aar instead of .jar, and it works fine. There used to be similar issue with .aar before, but it is fixed now https://code.google.com/p/android/issues/detail?id=159805 I assume this could be an issue on Google side as well (but there may be a workaround). – dragi May 19 '16 at 07:15
  • @helleye, so you suggest to build .aar? – user2957954 May 19 '16 at 07:27
  • My initial suggestion is to report an issue to Google. If .aar suits your needs then you can switch to it. – dragi May 19 '16 at 10:39

0 Answers0