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

Crash observed in firebase logs #2250

Open
batchuramesh opened this issue Jan 16, 2025 · 10 comments
Open

Crash observed in firebase logs #2250

batchuramesh opened this issue Jan 16, 2025 · 10 comments

Comments

@batchuramesh
Copy link

batchuramesh commented Jan 16, 2025

Your Environment

  • Plugin version: 4.17.6
  • Platform: Android
  • OS version: Android 12, 13
  • Device manufacturer / model: OnePlus Nord CE 2 Lite 5G, Zero 5G 2023, Oppo Reno7 5G/Find X5 Lite, RMX2002
  • React Native version (react-native -v): 0.66.5
  • Plugin config
import deviceInfoModule from 'react-native-device-info';
const trackerId = getTrackerId(); // c8b30d0239556adc@phu3
const userName = getUserName(); // phu3
const dutySession = getDutySession(); //1737000627215
{
        autoSync: true,
        batchSync: true,
        autoSyncThreshold: 5,
        maxBatchSize: 20,
        distanceFilter: 15,
        disableElasticity: false,
        elasticityMultiplier: 1,
        locationUpdateInterval: 10000,
        logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
        notification: {
            title: 'Tracking',
            text: 'You are on duty now',
            sticky: true,
        },
        stopOnTerminate: false,
        startOnBoot: true,
        foregroundService: true,
        stopOnStationary: false,
        preventSuspend: true,
        showsBackgroundLocationIndicator: true,
        locationAuthorizationRequest: 'Always',
        headers:
        {
            'Content-Type': 'application/json',
            'Authorization': `Bearer ${userToken}`,
        },
        // enableTimestampMeta: true,
        httpRootProperty: '.',
        authorization: {
            strategy: 'JWT',
            accessToken: userToken,
            refreshToken: token_refresh,
            refreshUrl: token_url,
            refreshPayload: {
                grant_type: 'refresh_token',
                refresh_token: '{refreshToken}',
            },
            expires: token_expired,
        },
        enableHeadless: true,
        url: `${baseUrl}/api/app-base/vdms-tracking/push`,
        locationTemplate: '{"timestamp": "<%= timestamp %>","lat":<%= latitude %>,"lng":<%= longitude %>, "heading": <%= heading %>, "speed": <%= speed %>, "motionActivity": "<%= activity.type %>", ' +
            `"meta": "{ \\"appVersion\\": \\"1.26.0\\", \\"model\\": \\"${deviceInfoModule.getModel()}\\", \\"os\\": \\"iOS\\", \\"osVersion\\": \\"${deviceInfoModule.getSystemVersion()}\\", \\"accuracy\\": <%= accuracy %>, \\"altitude\\": <%= altitude %>, \\"altitude_accuracy\\": <%= altitude_accuracy %>, \\"battery\\": \\"<%= battery.level %>\\", \\"isCharging\\": <%= battery.is_charging %>, \\"mock\\": <%= mock %>, \\"is_moving\\": <%= is_moving %> }", ` +
            `"sourceType": "transistor-sdk", "trackerId": "${trackerId}", "driver": "${userName}", "jobStatus": 1, "session": ${dutySession} }`,
    }

Expected Behavior

Should not crash.

Actual Behavior

there were 4 users facing crash issue from firebase console.
Device states: 100% background

Fatal Exception: java.lang.IllegalStateException: Couldn't read row 1015, col 4 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
       at android.database.CursorWindow.nativeGetBlob(CursorWindow.java)
       at android.database.CursorWindow.getBlob(CursorWindow.java:430)
       at android.database.AbstractWindowedCursor.getBlob(AbstractWindowedCursor.java:48)
       at com.transistorsoft.locationmanager.data.sqlite.SQLiteLocationDAO.a(SourceFile:5)
       at com.transistorsoft.locationmanager.data.sqlite.SQLiteLocationDAO.all(:59)
       at com.transistorsoft.locationmanager.adapter.BackgroundGeolocation$v0.run(:10)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
       at java.lang.Thread.run(Thread.java:1012)
========================
 Fatal Exception: java.lang.IllegalStateException: Couldn't read row 1059, col 4 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
       at android.database.CursorWindow.nativeGetBlob(CursorWindow.java)
       at android.database.CursorWindow.getBlob(CursorWindow.java:434)
       at android.database.AbstractWindowedCursor.getBlob(AbstractWindowedCursor.java:47)
       at com.transistorsoft.locationmanager.data.sqlite.SQLiteLocationDAO.a(SourceFile:5)
       at com.transistorsoft.locationmanager.data.sqlite.SQLiteLocationDAO.all(:59)
       at com.transistorsoft.locationmanager.adapter.BackgroundGeolocation$v0.run(:10)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:923)
========================
Fatal Exception: java.lang.IllegalStateException: Couldn't read row 1012, col 4 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
       at android.database.CursorWindow.nativeGetBlob(CursorWindow.java)
       at android.database.CursorWindow.getBlob(CursorWindow.java:427)
       at android.database.AbstractWindowedCursor.getBlob(AbstractWindowedCursor.java:48)
       at com.transistorsoft.locationmanager.data.sqlite.SQLiteLocationDAO.a(SourceFile:5)
       at com.transistorsoft.locationmanager.data.sqlite.SQLiteLocationDAO.all(:59)
       at com.transistorsoft.locationmanager.adapter.BackgroundGeolocation$v0.run(:10)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
       at java.lang.Thread.run(Thread.java:1012)
========================
Fatal Exception: java.lang.IllegalStateException: Couldn't read row 1011, col 4 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
       at android.database.CursorWindow.nativeGetBlob(CursorWindow.java)
       at android.database.CursorWindow.getBlob(CursorWindow.java:427)
       at android.database.AbstractWindowedCursor.getBlob(AbstractWindowedCursor.java:48)
       at com.transistorsoft.locationmanager.data.sqlite.SQLiteLocationDAO.a(SourceFile:5)
       at com.transistorsoft.locationmanager.data.sqlite.SQLiteLocationDAO.all(:59)
       at com.transistorsoft.locationmanager.adapter.BackgroundGeolocation$v0.run(:10)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
       at java.lang.Thread.run(Thread.java:1012)

Steps to Reproduce

Since the crashes were reported from firebase console, there are no reporduce step.

Context

User using the app.

Debug logs

Logs
PASTE_YOUR_LOGS_HERE
@batchuramesh batchuramesh changed the title Crash issue observed in firebase logs Crash observed in firebase logs Jan 16, 2025
@christocracy
Copy link
Member

I will add an exception handler to catch this case.

@batchuramesh
Copy link
Author

Thanks, @christocracy, kindly let us know if it is done. We will pull the latest SDK

@Suryamadhu9346
Copy link

Hi @christocracy any update on this crashes , number of crashes spiked and it is impacting on our user base. Please fix this crashes and let us know so that we can updated our transistor sdk

@Suryamadhu9346
Copy link

Hi @christocracy Could you please help us on this issues, the number of crashes are rapidly growing and its impacting on our app functionality. please provide fix for this crashes.

@batchuramesh
Copy link
Author

Hi @christocracy, This issue was reported 3 weeks ago, and we still don't have a fix yet. I would appreciate any updates on this issue, as the number of crashes in Firebase is increasing day by day.

@christocracy
Copy link
Member

Released to 4.18.4

@batchuramesh
Copy link
Author

Hi @christocracy,

build failed with new version of transistor sdk "react-native-background-geolocation": "4.18.4"

HeadlessTaskManager.java:12: error: cannot find symbol
import com.facebook.react.ReactInstanceEventListener;
com.facebook.react.ReactInstanceEventListener is not available on current reactnative version 0.65.5. It's from version 0.68.2.

Previously we were using the version 4.17.6 and didn’t face this issue before. // @Suryamadhu9346

@christocracy
Copy link
Member

It’s time for you to upgrade your react native version. You’re far behind.

@batchuramesh
Copy link
Author

Understood. However, the react native version upgrade is a significant task, as other dependency packages will also need to be upgraded. Any alternative suggestions would be appreciated.

@christocracy
Copy link
Member

There are no alternative. It’s time to pay up on your technical debt.

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

3 participants