Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Exception: java.lang.RuntimeException Unable to create service com.clevertap.android.sdk.pushnotification.amp.CTBackgroundJobService: java.lang.ClassNotFoundException #576

Closed
aaditya-doshi-hztl opened this issue Mar 2, 2024 · 9 comments

Comments

@aaditya-doshi-hztl
Copy link

Using the 6.1.0 version for SDK and upon releasing the app to prod started getting this crash event in Firebase Crashlytics heavily. Any probable cause as to why it would happen ? Would be helpful if you can let me know the same and any solution to overcome the same. TIA

Stack trace from Crashlytics
Fatal Exception: java.lang.RuntimeException
Unable to create service com.clevertap.android.sdk.pushnotification.amp.CTBackgroundJobService: java.lang.ClassNotFoundException: Didn't find class "com.clevertap.android.sdk.pushnotification.amp.CTBackgroundJobService" on path: DexPathList[[zip file "/data/app/~~nxBt_oG34Qurxx3T2023kg==/com.enbd.android-4SzoOZ7yindg5qvrhANC2A==/base.apk", zip file

@Anush-Shand
Copy link
Contributor

Anush-Shand commented Mar 2, 2024

This crash is due to the pushamplification feature edge case - where the user updates the app (clevertap-version v6.0.0 or below to v6.1.1) but doesn't launch the app within the pingFrequency time (4 hours by default)

This crash is once per user.

This crash is in the background (app functionality is not affected but user will see an alert that the app stopped)

Workaround until the fix is released is to disable the service by adding this to their AndroidManifest.xml

  <service
      android:name="com.clevertap.android.sdk.pushnotification.amp.CTBackgroundJobService"
      android:exported="false"
      android:enabled="false"
      tools:ignore="MissingClass"/>

@aaditya-doshi-hztl

@aaditya-doshi-hztl
Copy link
Author

aaditya-doshi-hztl commented Mar 2, 2024

@Anush-Shand Hey man, thanks for the prompt response. This helps, apart from doing this, would upgrading the SDK to latest would be a good idea ? and in the process of doing so would there be any special changes required to be done on the proguard rules or should that be taken care off itself by the SDK ?
And also adding this in manifest would stop throwing the crash in crashlytics ?

@Anush-Shand
Copy link
Contributor

@aaditya-doshi-hztl There was a critical bug identified in 6.1.0 and hence we recommend updating to v6.1.1.
Also make sure to add the above mentioned entry in the AndroidManifest file.
Other than this no other specific change is required.
Once the fix is deployed it will be great if you can confirm that all the crashes related to the above mentioned Exception go away

@aaditya-doshi-hztl
Copy link
Author

@Anush-Shand Noted ! If possible, please keep this bug open until I post an update for the behavior after SDK update.

@Lakshyasukhralia
Copy link

Lakshyasukhralia commented Mar 4, 2024

@Anush-Shand Any update about the release date for the updated SDK with the necessary fixes? Critical issues were identified in version 6.0.0, prompting an urgent update to address a token generation-related problem that has impacted many users, leading to missed Push Notification deliveries for our app.

@Anush-Shand
Copy link
Contributor

@Lakshyasukhralia Could you elaborate on the critical issues in clevertap-android-sdk v6.0.0? If it's unrelated to the above mentioned issue, please open a new issue for ease of tracking.
A workaround has been provided for the above mentioned issue regarding ClassNotFoundException.

@raghavendra-uno
Copy link

raghavendra-uno commented Mar 14, 2024

Hi @Anush-Shand We have updated the app to 6.1.1, but not added the manifest changes you asked for

still there is spike in Firebase. Should I add the above code in manifest. Adding this is showing a error in manifest of Unresolved class 'CTBackgroundJobService' is that fine?

@Anush-Shand
Copy link
Contributor

@raghavendra-uno
Yess, the manifest entry needs to be added to prevent the above mentioned crashes.
Unresolved class shoudn't be an issue as this class in not used in the latest sdk

@Anush-Shand
Copy link
Contributor

This issue has been fixed in clevertap-android-sdk v6.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants