2

I'm having problems importing my Android library (which builds to .aar) in my Android project (.apk). I've imported my library as was anwsered here.

Inside the Android Studio editor, my imported library sources are not found - all my imports cannot be resolved.

Application actually builds successfully without any error messages as apk.

Project root build.gradle:

include ':app', ':Library'
project(':Library').projectDir = new File('libs/Library/app')

Project apk build.gradle dependencies:

compile project(':Library')
Community
  • 1
  • 1
Peter
  • 340
  • 4
  • 13

1 Answers1

0

The problem was in my Android Library folder structure. Structure did not correspond to my actual package name. IDE underlined package name as the following error, but it still compiled and built aar library archive:

package name 'somepackage' does not correspond to the file path 'com.whatever.somepackage.someclass'

Seems like this issue confused Android Studio and it didn't recognise the package, when using it in the android application.

Peter
  • 340
  • 4
  • 13