Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dagger2 and objectbox are used simultaneously, indicating that DaggerActivity cannot be found #1188

Closed
mclmdream opened this issue Sep 10, 2024 · 4 comments
Labels
more info required Further information is requested

Comments

@mclmdream
Copy link

buildscript {
dependencies {
classpath "io.objectbox:objectbox-gradle-plugin:4.0.2"
}
}

plugins {
// id 'com.android.application' version '7.1.2' apply false
id 'com.android.application' version '8.0.0' apply false
id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
}

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'io.objectbox'
}

image

@mclmdream mclmdream added the bug Something isn't working label Sep 10, 2024
@greenrobot-team
Copy link
Member

Thanks for reporting. Can you please share a more complete build script that also shows how Dagger is used? Is there any relevant log output when building the app? Otherwise, this is rather hard for me to reproduce.

Note: I labeled this issue with "more info required" so it will auto-close in a few days if there are no follow-up comments.

@greenrobot-team greenrobot-team added the more info required Further information is requested label Sep 10, 2024
@mclmdream
Copy link
Author

mclmdream commented Sep 10, 2024

'com.google.dagger:dagger:2.51.1',
  'com.google.dagger:dagger-compiler:2.51.1',
@ActivityScope
@Component(dependencies = DnetComponent.class,
        modules = {ActivityModule.class,
                DBaseActivityModule.class,

        })
public interface ActivityComponent {
    Activity getBaseActivity();
}



@Scope
@Retention(RUNTIME)
public @interface ActivityScope {
}


@Module
public class ActivityModule {
    private Activity mActivity;

    public ActivityModule(Activity mActivity) {
        this.mActivity = mActivity;
    }

    @Provides
    @ActivityScope
    public BaseActivity provideActivity() {
        return mActivity;
    }

}

DaggerActivityComponent.builder(), Unable to find DaggerActivityComponent,thanks

@github-actions github-actions bot removed the more info required Further information is requested label Sep 11, 2024
@greenrobot-team
Copy link
Member

Tried this with our Android app Java example and it works just fine.

It looks like you are using Kotlin though. IIRC in that case make sure that all Dagger related classes are written in Kotlin as well and then use kapt instead of annotationProcessor. But that's not related to ObjectBox.

If you still think this is related to ObjectBox, please share a full example that I can use to verify.

@greenrobot-team greenrobot-team added more info required Further information is requested and removed bug Something isn't working labels Sep 16, 2024
Copy link

github-actions bot commented Oct 8, 2024

Without additional information, we are unfortunately not sure how to resolve this issue. Therefore this issue has been automatically closed. Feel free to comment with additional details and we can re-open this issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info required Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants