question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.IllegalStateException: Illegal State: Row/Object is no longer valid to operate on. Was it deleted?

See original GitHub issue

Hello,

I`m getting java.lang.IllegalStateException: Illegal State: Row/Object is no longer valid to operate on. Was it deleted?

Info From Crashlytics Samsung-SM-G850A Android 5.0.2

HTC ONE X+ Android 4.2.2

I`m using buzzboxSDK-0.6.5.jar

Raw error:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cashdivider.app/com.cashdivider.app.gui.SettingsActivity}: java.lang.IllegalStateException: Illegal State: Row/Object is no longer valid to operate on. Was it deleted? at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2790) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2855) at android.app.ActivityThread.access$900(ActivityThread.java:181) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1474) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6117) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194) Caused by: java.lang.IllegalStateException: Illegal State: Row/Object is no longer valid to operate on. Was it deleted? at io.realm.internal.Row.nativeIsNullLink(Row.java) at io.realm.internal.Row.isNullLink(Row.java:156) at io.realm.BackendRealmProxy.getCurrency(BackendRealmProxy.java:81) at com.cashdivider.app.gui.fragment.SettingsFragment.init(SettingsFragment.java:249) at com.cashdivider.app.gui.fragment.SettingsFragment.onCreate(SettingsFragment.java:74) at android.support.v4.app.Fragment.performCreate(Fragment.java:1766) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:917) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1120) at android.support.v4.app.FragmentManagerImpl.dispatchCreate(FragmentManager.java:1924) at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:268) at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:58) at com.cashdivider.app.gui.BaseActivity.onCreate(BaseActivity.java:90) at com.cashdivider.app.gui.SettingsActivity.onCreate(SettingsActivity.java:22) at android.app.Activity.performCreate(Activity.java:6374) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2743) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2855) at android.app.ActivityThread.access$900(ActivityThread.java:181) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1474) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6117) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
rchinchocommented, Apr 26, 2016

It happens once in a while. No threads involved. Tough to reproduce as it does not happen in second trial.

java.lang.IllegalStateException: Illegal State: Object is no longer valid to operate on. Was it deleted by another thread? at io.realm.internal.UncheckedRow.nativeGetLong(UncheckedRow.java) at io.realm.internal.UncheckedRow.getLong(UncheckedRow.java:129) at io.realm.EstimateRealmProxy.realmGet$id(EstimateRealmProxy.java:107) at co.desque.app.workm.model.Estimate.getId(Estimate.java:36) at co.desque.app.workm.estimates.EstimationDetailFragment.makeInvoice(EstimationDetailFragment.java:423) at co.desque.app.workm.estimates.EstimationDetailFragment.onOptionsItemSelected(EstimationDetailFragment.java:196)

4reactions
cmelchiorcommented, Jun 11, 2015

Hi @rilley The most likely reason is as the exception says. That you are holding on to a reference that some other threads deleted. Note that Realm is zero-copy. This means that if you query for the same object on two different threads you are actually holding a reference to the same data. Each RealmObject has a .isValid() method you can use if you want to verify that an object is still usable before accessing it.

If this is not the case. Can you provide some sample code that provoke this error?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android realm.io: Row/Object is no longer valid - Stack Overflow
java.lang.IllegalStateException: Illegal State: Row/Object is no longer valid to operate on. Was it deleted? How can I fix this?
Read more >
How to Fix The IllegalStateException in Java - Rollbar
The IllegalStateException is thrown when the Java environment or application is not in an appropriate state for the requested operation.
Read more >
IllegalStateException (Java Platform SE 7 ) - Oracle Help Center
public class IllegalStateException extends RuntimeException. Signals that a method has been invoked at an illegal or inappropriate time.
Read more >
"java.lang.IllegalStateException: This ticket is no longer valid ...
ERROR: "java.lang.IllegalStateException: This ticket is no longer valid" occurs while running pushdown mappings in Hortonworks cluster using Informatica DEI ...
Read more >
[Solved] java.lang.IllegalStateException in Java with Examples
In simple words, the Java application or Java environment is not in an appropriate state for the requested operation. IllegalStateException is an unchecked ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found