2014-06-27 35 views
38

Tôi đang sử dụng Android Studio 0.6.1, với Crouton thư viện và hôm nay sau khi gradle sync tôi đã nhận lỗi sau:Crouton phụ thuộc vào thư viện nhưng không phải là một thư viện riêng của mình

Error:A problem occurred configuring root project 'project_name'. 
Module version de.keyboardsurfer.android.widget:crouton:1.8.4 depends on libraries but is not a library itself 

Đó đang xảy ra?

+0

Tôi đã có, cùng một lỗi ở đây. Đang cố gắng giải quyết. – 3mpty

+0

Vẫn gặp sự cố này vào cuối của tôi – kabuto178

+0

Điều này đã giúp thực sự – kabuto178

Trả lời

61

Sự cố này do cập nhật gần đây của com.android.support-v4.

Vì vậy, tôi đã thay đổi

compile 'com.android.support:support-v4:20.+' 

để

compile 'com.android.support:support-v4:19.1.+' 

và crouton hoạt động tốt

workaround khác nhau là sử dụng @aar:

compile('de.keyboardsurfer.android.widget:crouton:[email protected]') { 
    exclude group: 'com.google.android', module: 'support-v4' 
} 
+0

Cảm ơn! Điều này cố định nó. Làm thế nào bạn tìm thấy điều này? –

+0

@ChristopheSmet Tôi biết về bản cập nhật gần đây hỗ trợ-v4 và suy nghĩ đầu tiên là: hmmm, hạ cấp nó là gì? Giải pháp thứ hai tôi tìm thấy trên trang vấn đề crouton github :) – IlyaEremin

+2

Hiện tại Crouton vẫn là một cái lọ. Phiên bản sắp tới sẽ chỉ được triển khai dưới dạng aar và sử dụng plugin 'com.android.library'. – keyboardsurfer

7

Giải pháp của tôi theo @ Revedko trả lời, usin g @aar và thay đổi tất cả các hỗ trợ cho phiên bản thấp hơn 21 -> 20. +

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.loopj.android:android-async-http:1.+' 
    compile "com.bugsense.trace:bugsense:3.5" 
    compile('de.keyboardsurfer.android.widget:crouton:[email protected]') { 
     exclude group: 'com.google.android', module: 'support-v4' 
    } 
    compile 'com.android.support:appcompat-v7:20.+' 
    compile 'com.google.android.gms:play-services:5.0.77' 
} 
Các vấn đề liên quan