I have two modules in android studio
- Standard android app module
- domain module
The domain module in been added to both settings.gradle
and build.gradle
include ':mobile', ':domain'
&
compile project(':domain')
respectively like this
Inside domain module I have a class like this :
public class DomainUtils {
Context mContex;
public DomainUtils(Context context){
this.mContex = context;
}
public void toast(String string){
Toast.makeText(mContex, string,Toast.LENGTH_LONG).show();
}
public String returnHi(){
return "hi";
}
}
But when i try to call new DomainUtils(context).toast("hi");
from a class inside App module :
- The method inside DomainUtils does not execute
- Program flow does not continue to next line in the calling class ( program flow stops"
- I do not see any error logs in logcat.
------------BUT ----------
When I run the method returnHi()
It works fine .
From file settings.gradle add full path module.
include ':your_module'
project(':your_module').projectDir = new File(settingsDir, 'absolute_path').
absolute_path start from folder container settings.gradle