Getting unresolved reference error in Kotlin Android Library Project


#1

I am getting unresolved reference error in Kotlin Android Library project.

1.) standard_kotlin_lib.jar --> contains: Kotlin classes, META-INF/standard_kotlin_lib.kotlin_module
2.) A.aar --> compiles only standard_kotlin_lib.jar file. After compilation, inside generated A.aar file’s classes.jar: META-INF/standard_kotlib_lib.kotlin_module is missing, infect whole META-INF is missing
3.) B.aar --> compiles A.aar. Here, kotlin source code importing classes define in “standard_kotlin_lib.jar”. Getting unresolved reference error at import

B.aar <-- A.aar <-- standard_kotlin_lib.jar

Tools Version:
1.) I am using android gradle plugin 3.0.0 and gradle version 4.3.0. With previous plugin version i.e. 2.2.3 and gradle version 3.2.1, this error was not coming. Kotlin version is 1.1.4

Issue I think:
1.) META-INF is missing inside A.aar file. When I manually copy the META-INF inside A.aar’s classes.jar, B.aar compiled successfully.


#2

I am getting unresolved reference error in Kotlin Android Library project.

1.) standard_kotlin_lib.jar --> contains: Kotlin classes, META-INF/standard_kotlin_lib.kotlin_module

2.) A.aar --> compiles only standard_kotlin_lib.jar file. After compilation, inside generated A.aar file’s classes.jar: META-INF/standard_kotlib_lib.kotlin_module is missing, infect whole META-INF is missing

3.) B.aar --> compiles A.aar. Here, kotlin source code importing classes define in “standard_kotlin_lib.jar”. Getting unresolved reference error at the same time

B.aar <-- A.aar <-- standard_kotlin_lib.jar

Tools Version:
1.) I am using android gradle plugin 3.0.0 and gradle version 4.3.0. With previous plugin version i.e. 2.2.3 and gradle version 3.2.1, this error was not coming. Kotlin version is 1.1.4

Issue I think:
1.) META-INF is missing inside A.aar file. When I manually copy the META-INF inside A.aar’s classes.jar, B.aar compiled successfully.