BoxStore.isObjectBrowserAvailable()
See original GitHub issueIssue 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:
- Created 6 years ago
- Comments:18 (10 by maintainers)
@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’
We have an additional dependencies section in our project but it doesn’t have ObjectBox declarations there, checked it using global search:
For ObjectBox 1.2.1, Gradle shows needed dependencies:
The same is for version 1.3.4