2016-05-31 5 views
1

종속/하위 구성 요소를 추가 할 때 DaggerAppComponent/DaggerBComponent/DaggerCComponent에 대한 심볼 클래스 찾기를 찾을 수 없을 때 Dagger 2와 관련된 문제가 있습니다. 내가 BComponent에있는 더하기 방법을 추가 할 때마다단검 2 : 하위 구성 요소/종속 구성 요소를 사용할 때 기호 클래스를 찾을 수 없습니다.

public class ApplicationComponent { 
@Singleton 
@Component(modules= {...}) 
public interface AppComponent { 
    SomeManager someManager(); 
    void inject(Application application); 
} 
} 

@UserScope 
@Component(modules = {...}, dependencies = ApplicationComponent.AppComponent.class) 
public interface BComponent{ 
    CComponent plus (AModule aModule, BModule bModule); 
    void inject (SomeActivity someActivity); 
} 

@PerFragment 
@Subcomponent (modules = {AModule.class,BModule.class}) 
public interface CComponent { 
    void inject (SomeFragment someFragment); 
} 

, 나는 오류가 내가 빌드하려고 할 때마다 대거 생성 된 클래스의 모든 3 심볼 클래스를 찾을 수 없습니다 얻을 : 같은

구성 요소는. 내가 더하기 메서드를 주석 처리하면 빌드됩니다. 내가 뭘 잘못하고 있니?

+0

도움이 될 것 도서관에서이 라인을 넣어 것을 잊었다 너 사용하고있어? – EpicPandaForce

+0

대거 2.2 컴파일러, 대거 2.2, jsr250 주석 종속성. – hakuteru

+0

Dagger 2.4로 업데이트하면 문제가 해결 될지 궁금하지만,'apt 'com.google.guava : guava : 19.0''을 추가해야 할 수도 있습니다. – EpicPandaForce

답변

1

하위 구성 요소가 라이브러리 프로젝트에있을 때 나는 같은 문제에 직면하고 난/build.gradle

apply plugin: 'com.android.library' 
apply plugin: 'com.neenbedankt.android-apt' 
... 
... 
dependencies { 
    ... 
    apt 'com.google.dagger:dagger-compiler:2.5' 
} 

희망이 있습니다 Dagger2 어떤 버전의 당신에게

관련 문제