braze-inc / braze-cordova-sdk

Public repo for the Braze Cordova SDK
https://www.braze.com
Other
21 stars 62 forks source link

Unable to create service com.appboy.AppboyFirebaseMessagingService #85

Closed chitchu closed 1 year ago

chitchu commented 1 year ago

Hi, we've been getting this error on the google pre-launch report and in the Crashes and ANRs section.

java.lang.RuntimeException: Unable to create service com.appboy.AppboyFirebaseMessagingService: 
java.lang.ClassNotFoundException: Didn't find class "com.appboy.AppboyFirebaseMessagingService" 
on path: DexPathList ...trimmed

Our configuration is as follows:

AndroidManifest.xml

<service android:name="com.appboy.AppboyFirebaseMessagingService" android:exported="true">
    <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT"/>
    </intent-filter>
</service>

variables.gradle

ext {
    minSdkVersion = 22
    compileSdkVersion = 32
    targetSdkVersion = 32
    androidxActivityVersion = '1.4.0'
    androidxAppCompatVersion = '1.4.2'
    androidxCoordinatorLayoutVersion = '1.2.0'
    androidxCoreVersion = '1.8.0'
    androidxFragmentVersion = '1.4.1'
    junitVersion = '4.13.2'
    androidxJunitVersion = '1.1.3'
    androidxEspressoCoreVersion = '3.4.0'
    cordovaAndroidVersion = '10.1.2'
    coreSplashScreenVersion = '1.0.0-rc01'
    androidxWebkitVersion = '1.4.0'
}

package.json

"appboy-cordova-sdk": "github:appboy/appboy-cordova-sdk#2.30.1"

We we're previously using appboy-cordova-sdk#2.24.0. Using this version has a separate issue

Manifest merger failed : android:exported needs to be explicitly specified for element <service#com.appboy.AppboyFirebaseMessagingService>.

Which we already have defined. Updating fixed this issue.


Capacitor version 4.

Bucimis commented 1 year ago

@chitchu please update your manifest to use com.braze.push.BrazeFirebaseMessagingService instead of com.appboy.AppboyFirebaseMessagingService. See e.g. https://github.com/Appboy/appboy-android-sdk/blob/e97b12a2078e8ab614e1bb866c2ab7dac806d41e/samples/firebase-push/src/main/AndroidManifest.xml#L26