我正在创建用于预订的android应用,并且我还需要在android app中进行FCM消息传递。当我实现FCM消息传递时,它运行良好,但是在我在应用程序中实现了Google日历后,发送时应用程序崩溃了该行上FCM上显示的消息:
java.lang.NoSuchMethodError: No static method
createRootContext(II)Lcom/fasterxml/jackson/core/json/JsonReadContext;
in class Lcom/fasterxml/jackson/core/json/JsonReadContext; or its
super classes (declaration of 'com.fasterxml.jackson.core.json.JsonReadContext' appears in /data/app/com.mmf.loggedinapp-2/split_lib_dependencies_apk.apk:classes102.dex)
这是我的FCM代码:
fireBaseReference.push().setValue(map);
这是我的FCM代码,当我在FCM上发送消息时会崩溃
使用此方法reference1.push().setValue(map);
PrefManager prefManager = new PrefManager(getApplicationContext());
Map<String, String> map = new HashMap<String, String>();
Calendar c = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String strDate = sdf.format(c.getTime());
map.put("sender_id", prefManager.getLoggedInId());
map.put("message", messageText);
map.put("time", timeString);
map.put("receiver_id", contactid);
map.put("date", strDate);
map.put("type", "mobile");
map.put("messageStatus", "0");
map.put("status", "1");
if (docUri == null) {
map.put("doc_url", "");
map.put("docFileName", "");
} else {
map.put("doc_url", docUri.toString());
map.put("docFileName", docFileName);
}
if (imageUri == null) {
map.put("imageUri", "");
map.put("imageName", "");
} else {
map.put("imageUri", imageUri.toString());
map.put("imageName", imageName);
}
reference1.push().setValue(map);
这是我的build.gradle:-
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.2'
implementation 'com.android.support:design:27.1.1'
implementation 'com.intuit.sdp:sdp-android:1.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:palette-v7:27.1.1'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation'
com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.8.2'
implementation 'net.gotev:uploadservice:2.1'
implementation 'com.github.ome450901:SimpleRatingBar:1.3.2'
implementation 'com.vincentbrison.openlibraries.android:dualcache:3.1.1'
implementation 'org.apache.commons:commons-lang3:3.5'
implementation 'com.github.travijuu:numberpicker:1.0.7'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.andanhm.quantitypicker:quantitypicker:1.1.0'
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.mikhaellopez:circularimageview:3.0.2'
implementation 'com.github.sundeepk:compact-calendar-view:2.0.2.3'
implementation 'com.hbb20:ccp:2.0.8'
implementation 'com.github.barteksc:android-pdf-viewer:2.3.0'
implementation 'org.apache.commons:commons-io:1.3.2'
implementation 'com.github.bumptech.glide:glide:4.3.0'
implementation 'com.wang.avi:library:2.1.3'
implementation 'io.branch.sdk.android:library:2.+'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
implementation 'com.devlomi.record-view:record-view:2.0.0'
implementation 'com.github.gcacace:signature-pad:1.2.1'
implementation 'com.stripe:stripe-android:7.0.0'
implementation 'com.amitshekhar.android:android-networking:1.0.0'
implementation 'com.github.franmontiel:FullScreenDialog:1.0.1'
implementation 'com.seatgeek:placesautocomplete:0.3-SNAPSHOT'
implementation 'com.jcodecraeer:xrecyclerview:1.5.9'
implementation 'com.twilio:voice-android:2.0.7'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.koushikdutta.ion:ion:2.1.8'
implementation 'com.cocosw:bottomsheet:1.3.1'
implementation 'me.leolin:ShortcutBadger:1.1.4@aar'
implementation 'net.the4thdimension:audio-wife:1.0.3'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.google.api-client:google-api-client-android:1.23.0'
exclude module: 'httpclient'
implementation 'com.google.http-client:google-http-client-gson:1.23.0'
exclude module: 'httpclient'
implementation 'com.google.apis:google-api-services-calendar:v3-rev331-
1.24.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
transitive = true;
}
implementation 'com.android.volley:volley:1.1.0'
}
apply plugin: 'com.google.gms.google-services'