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.

BoxStore.isObjectBrowserAvailable()

See original GitHub issue

Issue Basics

  • ObjectBox version (are using the latest version?): 1.3.4
  • Reproducibility: always in our project

Reproducing the bug

Description

We are migrating from ObjectBox 0.9.15 to 1.3.4.

After updating classes (removing @Relation, etc) we added dependency for ObjectBox Browser but it does not start. BoxStore.isObjectBrowserAvailable() returns false. Downgrading version to 1.2.1 helped.

Code

build.gradle looks well:

buildscript {
    repositories {
        jcenter()
        maven { url "http://objectbox.net/beta-repo/" }
    }

    dependencies {
        classpath 'io.objectbox:objectbox-gradle-plugin:1.3.4'
    }
}

apply plugin: 'com.android.application'
dependencies {
    debugCompile "io.objectbox:objectbox-android-objectbrowser:1.3.4"
    releaseCompile "io.objectbox:objectbox-android:1.3.4"
}
apply plugin: 'io.objectbox'

Here is part of Application.onCreate()

 @Inject
 BoxStore boxStore;

public void onCreate() { 
// ...
getComponentManager()
        .plusAppComponent(this)
        .inject(this);

    if (BuildConfig.DEBUG) {
      boolean start = new AndroidObjectBrowser(boxStore).start(this);
      Timber.d("Browser started: %s", start);
    }
}

Logs & stackstraces

There are no logs related to issue

Misc

Downgrade to versions 1.1.0 or 1.2.1 helps - browser starts.

Our app contains Library module and Application module, ObjectBox used in the latter.

Initially, my custom log that you see above said “D/VyngApplication: Browser started: false”. After the downgrade, I returned it back to 1.3.4… And now logs are another:

01-06 01:31:19.100 I/ObjectBrowser: ObjectBrowser started: http://localhost:8090/index.html
01-06 01:31:19.101 I/ObjectBrowser: Command to forward ObjectBrowser to connected host: adb forward tcp:8090 tcp:8090
01-06 01:31:19.103 D/VyngApplication: Browser started: true

But it looks like it it stops right after these messages, because there is no notification in notification bar. The only Error-level logs that I see are:

01-06 01:31:19.250 E/FA: Discarding data. Failed to send app launch
01-06 01:31:19.250 E/FA: Failed to get app instance id
01-06 01:31:19.250 E/FA: Discarding data. Failed to send event to service
01-06 01:31:19.250 E/FA: Discarding data. Failed to send event to service
01-06 01:31:19.250 E/FA: Failed to send current screen to service
01-06 01:31:19.251 E/FA: Discarding data. Failed to send event to service

Tested both on emulator and a real device, API 23 and API 26

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
mitjakorencommented, Jan 22, 2018

@greenrobot-team Yes, I use Gradle plugin version 3.0.1. Downgrading the version to 1.2.1. did not help. I do not use @Gaket but there are some plugins applied. apply plugin: ‘com.android.application’ apply plugin: ‘io.fabric’ apply plugin: ‘kotlin-android’ apply plugin: ‘kotlin-kapt’ apply plugin: ‘io.objectbox’

1reaction
Gaketcommented, Jan 22, 2018

We have an additional dependencies section in our project but it doesn’t have ObjectBox declarations there, checked it using global search:

2018-01-17 17 23 29

For ObjectBox 1.2.1, Gradle shows needed dependencies:

+--- io.objectbox:objectbox-android-objectbrowser:1.2.1@aar
|    \--- io.objectbox:objectbox-java:1.2.1@jar
|         +--- io.objectbox:objectbox-java-api:1.2.1@jar
|         +--- org.greenrobot:essentials:3.0.0-RC1@jar
|         +--- com.google.flatbuffers:flatbuffers-java:1.7.2@jar
|         \--- com.google.code.findbugs:jsr305:3.0.2@jar

The same is for version 1.3.4

+--- io.objectbox:objectbox-android-objectbrowser:1.3.4@aar
|    \--- io.objectbox:objectbox-java:1.3.4@jar
|         +--- io.objectbox:objectbox-java-api:1.3.4@jar
|         +--- org.greenrobot:essentials:3.0.0-RC1@jar
|         +--- com.google.flatbuffers:flatbuffers-java:1.7.2@jar
|         \--- com.google.code.findbugs:jsr305:3.0.2@jar
Read more comments on GitHub >

github_iconTop Results From Across the Web

BoxStore ( ObjectBox Java 1.4.4 API) - javadoc.io
Method Summary ; boolean, isDebugRelations() ; static boolean, isObjectBrowserAvailable() ; void, runInReadTx(java.lang.Runnable runnable). Runs the given runnable ...
Read more >
BoxStore (ObjectBox Java 3.5.0 API)
@ThreadSafe public class BoxStore extends java.lang.Object implements java.io.Closeable ... public static boolean isObjectBrowserAvailable() ...
Read more >
ObjectBox browser is not available - Stack Overflow
BoxStore.isObjectBrowserAvailable() returns false. Unfortunately, it is a native method public static native boolean ...
Read more >
io.objectbox.internal java code examples | Tabnine
public static boolean isObjectBrowserAvailable() { NativeLibraryLoader. ... public ObjectBoxThreadPool(BoxStore boxStore) { super(0, Integer.
Read more >
腾讯云开发者社区-腾讯云
BoxStore.isObjectBrowserAvailable() 返回false。不幸的是,它是一个本机方法 public static native boolean isObjectBrowserAvailable() ,所以我不知道下一步能做 ...
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