Hello,
I'm looking to switch my project from dagger to transfuse.
Playing around with sample project and not able to get it works.
If I do add @Factory or @TransfuseModule annotation project not able to compile with that error message:
Error:Execution failed for task ':app:compileDebugJava'.
> java.lang.TypeNotPresentException: Type android.app.Application not present
I'm using Android Studio 1.3
That gradle dependencies:
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.7'
classpath 'com.android.tools.build:gradle:1.2.3'
That project dependencies:
apt 'org.androidtransfuse:transfuse:0.3.0-beta-7'
compile 'org.androidtransfuse:transfuse-api:0.3.0-beta-7'
Including that apt settings:
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
}
}
All classes from example:
http://androidtransfuse.org/documentation.html#dependency_injection_dipublic class Example {
}
public class ExampleProvider implements Provider<Example> {
public Example get() {
return new Example();
}
}
@TransfuseModule
@BindProviders({
@BindProvider(type = Example.class, provider = ExampleProvider.class)
})
public class Module {
}
public class MainActivity extends Activity {
@Inject
Example mExample;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d("MainActivity", "mExample: " + mExample);
}
}
Thanks for help,