उपयोग नहीं कर सकते मैं अपने प्रोजेक्ट के लिए इन निर्भरता को शामिल किया है:पुराना वापस कनवर्टर कारखाना GsonConverterFactory
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
मैं एक वर्ग है, जहां मैं पुराना वापस के माध्यम से मेरी एपीआई का उपयोग करने के लिए जा रहा हूँ है:
public static <S> S createService(Class<S> serviceClass, String baseUrl) {
Retrofit builder = new Retrofit.Builder()
.baseUrl(baseUrl)
.addConverterFactory(GsonConverterFactory.create())
.build();
RestAdapter adapter = builder.build();*/
return builder.create(serviceClass);
}
और अब , यह मुझे यह संकलन समय त्रुटि देता है:
Error:(24, 17) error: method addConverterFactory in class Builder cannot be applied to given types; required: Factory found: GsonConverterFactory reason: actual argument GsonConverterFactory cannot be converted to Factory by method invocation conversion
मैं इसे कैसे हल कर सकता हूं? मैंने प्रलेखन का पालन किया। गलत क्या है?
आप एक बड़े आदमी हैं)। लेकिन कोई संसाधन नहीं है जो इंगित करता है कि मुझे उसी बीटा 2 संस्करण का उपयोग करना होगा। – AEMLoviji
@AEMLoviji संसाधन को सामान्य ज्ञान कहा जाता है, क्या आप सहमत नहीं होंगे? सबसे विशेष रूप से क्योंकि बीटा चरण इंटरफेस के दौरान परिवर्तन के अधीन हैं जो रेट्रोफिट दस्तावेज़ों में लिखा गया है। –
मैं बस इस समस्या में भाग गया। और उसने 2 घंटे पहले हल किया। धन्यवाद!) – ip696