In AndroidStudio
, I want to create a java-class I can use in several projects. I found a suggestion here, in which I followed the alternative method, and created a project named "LibraryProject" with 'app' renamed to "LibraryModule", and I changed settings.gradle
in the main project to the following content:
include ':LibraryModule', ':app'
project(':LibraryModule').projectDir = new File(settingsDir, '../LibraryProject/LibraryModule')
The LibraryProject
contains a java class named MyLogger
at the location LibraryModule/java/com.example.alexander.libraryproject
. But when I try to use it somewhere in the main code (after doing a 'sync'), the MyLogger
class is not being found.
Maybe the example in the link is outdated? Or I forgot something 'obvious'? Or made an error somewhere else? How to include the MyLogger
java class from LibraryProject
into a file in the main project?