Getting the following issue when notification received on android
java.lang.RuntimeException: Unable to instantiate service com.evollu.react.fcm.MessagingService: java.lang.ClassNotFoundException: Didn't find class "com.evollu.react.fcm.MessagingService" on path: DexPathList[[zip file "/data/app/com.vytaapp.worker-1/base.apk"],nativeLibraryDirectories=[/data/app/com.vytaapp.worker-1/lib/arm, /data/app/com.vytaapp.worker-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
dependencies {
compile(project(':react-native-fcm')){
exclude group: 'com.google.android.gms'
exclude group: 'com.google.firebase'
}
compile(project(':react-native-maps')){
exclude group: 'com.google.android.gms'
}
compile(project(':react-native-mauron85-background-geolocation')){
exclude group: 'com.google.android.gms'
}
compile project(':react-native-twilio-ip-messaging')
compile(project(':react-native-image-picker')){
exclude group: 'com.google.android.gms'
}
compile project(':react-native-vector-icons')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile 'com.google.firebase:firebase-core:9.2.1'
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'com.google.android.gms:play-services-maps:9.2.1'
compile 'com.google.android.gms:play-services-gcm:9.2.1'
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vytaapp.worker"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission
android:name="com.vytaapp.worker.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.vytaapp.worker.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />
<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme">
<service android:name="com.evollu.react.fcm.MessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service android:name="com.evollu.react.fcm.InstanceIdService" android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="fcm.ACTION.HELLO" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="#######################" />
</application>
</manifest>
package com.vytaapp.worker;
import android.app.Application;
import android.util.Log;
import com.facebook.react.ReactApplication;
import com.evollu.react.fcm.FIRMessagingPackage;
import com.evollu.react.fcm.MessagingService;
import com.marianhello.react.BackgroundGeolocationPackage;
import com.airbnb.android.react.maps.MapsPackage;
import com.bradbumbalough.RCTTwilioIPMessaging.RCTTwilioIPMessagingPackage;
import com.facebook.react.ReactInstanceManager;
import com.imagepicker.ImagePickerPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.vytaapp.worker.BuildConfig;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new FIRMessagingPackage(),
new BackgroundGeolocationPackage(),
new RCTTwilioIPMessagingPackage(),
new ImagePickerPackage(),
new MapsPackage()
);
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
}
fixed, was not compiling firebase messagaging
@sf577 I have same issue, how did you solved this? How do you forced the firebase to compile?
@AdrianZghibarta You need to add compile 'com.google.firebase:firebase-messaging:11.0.4' to your dependencies
Most helpful comment
@AdrianZghibarta You need to add
compile 'com.google.firebase:firebase-messaging:11.0.4'to your dependencies