2016-06-05 1 views
1

내가 도서관 프로젝트, 도서관 프로젝트의 세 번째 종속성이 프로젝트가 인식 할 수 없습니다 :안드로이드 스튜디오 2.2 미리보기 응용 프로그램은 라이브러리 의존성

라이브러리 응용 프로그램 build.gradle

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'com.android.support:appcompat-v7:23.2.1' 
    compile 'com.android.support:design:23.2.1' 
    compile 'com.android.support:support-v4:23.2.1' 

    compile 'io.reactivex:rxandroid:1.1.0' 
    compile 'com.jakewharton.rxbinding:rxbinding:0.4.0' 
    compile 'com.jakewharton:butterknife:7.0.1' 

    compile 'com.facebook.fresco:fresco:0.9.0' 
    compile 'com.google.code.gson:gson:2.6.2' 
    compile 'com.github.satyan:sugar:1.4' 
    compile 'org.greenrobot:eventbus:3.0.0' 
    compile 'com.jakewharton.timber:timber:4.1.1' 

    compile 'com.android.support:multidex:1.0.1' 
    testCompile 'junit:junit:4.12' 
} 

build.gradle을

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 

    //compile project(':library') 
    debugCompile project(path: ':library', configuration: 'debug') 
    releaseCompile project(path: ':library', configuration: 'release') 
} 

지금은 문제가 생겼습니다. 라이브러리에서 의존성 클래스를 사용할 수 없습니다. libs를 인식하지 못합니다.

enter image description here

하지만 난 응용 프로그램 build.grandle에 대한 종속성을 넣을 때. 이 문제는 사라졌습니다. 누구도 나를 도울 수 있습니까? 뭐가 문제 야.

감사합니다.

+0

'include ': library''를'settings.gradle' 파일에 추가해보십시오. 아직 가지고 있지 않다고 가정하십시오. –

+0

@leeo 문제를 팔았습니까? 나는 똑같은 문제에 봉착했습니다. –

+0

비슷한 문제가 있습니다. 내 의존성 라이브러리 중 2 개에는 기본 응용 프로그램에서 무시되는 jar 파일이 있습니다. – SKato

답변

0

gradle과의 전이 종속성이 true로 설정하려고 시도하는 경우 문제가 될 수 있습니다. 응용 프로그램의 build.gradle 파일

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 

    //compile project(':library') 
    debugCompile project(path: ':library', configuration: 'debug'){transitive = true} 
    releaseCompile project(path: ':library', configuration: 'release'){transitive = true} 
} 

완전히 확실하지만 해볼만 한 가치는 다만 추측에

.