Realm-java: Realm not playing nice with google VR library for android

Created on 15 Sep 2016  路  11Comments  路  Source: realm/realm-java

I was getting a android.view.InflateException: Binary XML file line #18: Binary XML file line #18: Error inflating class com.google.vr.sdk.widgets.pano.VrPanoramaView

and java.lang.UnsatisfiedLinkError with realm annotations or something mentioned,so I deleted the plugin and it works but my whole storage implementation is based on realm,please guys come up with a fix for this or else more than 70% of my work would go undone,I've also raised the issue with the Google guys

T-Help

Most helpful comment

I have tried to create a minimal app with Google VR SDK and Realm 2.0.0. My main activity is:

public class MainActivity extends GvrActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Realm.init(this);
    }

and my app's build.gradle contains

dependencies {
    # ...
    compile(name:'common', ext:'aar')
    compile(name:'base', ext:'aar')
}

repositories{
    flatDir{
        dirs 'libs'
    }
}

I see no crashes on my x86 emulator and OPO device.

All 11 comments

I have this wild guess that it's related to this: https://realm.io/docs/java/latest/#couldnt-load-librealm-jniso

I experienced the same error and the reason is the google VR library does not provide arm64-v8a binary.
To solve this, I exclude all arm64-v8a binary from the apk at that time.

https://realm.io/docs/java/latest/#couldnt-load-librealm-jniso

I added this to my app gradle build file:

First this,ndk { abiFilters "armeabi-v7a" } and the app started running on my device which is a one plus 2 but still refused to run on my other test device,which is a Sony M4 pro Aqua.

So,then I added packagingOptions { exclude "lib/arm64-v8a/librealm-jni.so" }

to my build.gradle file,the app still runs fine on my phone but on the other device it gives weird erros like unable to locate the global application code file and what not.

Now,the one plus 2 has a combination of A57 and A53 cores whereas the other uses 4 A53 cores, but both use the same armv8 instruction set,so I am confused now what's causing it to run on some devices and not on others

What does the global application code file mean?

this file:public class globalCon extends Application {

The issue at Google VR SDK is https://github.com/googlevr/gvr-android-sdk/issues/238.

Did you try to remove the Google VR SDK to see if your app is working with Realm?

Yes,my app works perfectly with realm,without any hiccups!!

I have tried to create a minimal app with Google VR SDK and Realm 2.0.0. My main activity is:

public class MainActivity extends GvrActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Realm.init(this);
    }

and my app's build.gradle contains

dependencies {
    # ...
    compile(name:'common', ext:'aar')
    compile(name:'base', ext:'aar')
}

repositories{
    flatDir{
        dirs 'libs'
    }
}

I see no crashes on my x86 emulator and OPO device.

Google just came out with a new version of their sdk(1.0.0),I'll give it a shot and let you know

Please report back when you have tried it.

I am closing the issue. If the issue persists, please reopen or create new.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wezley98 picture wezley98  路  3Comments

David-Kuper picture David-Kuper  路  3Comments

Frasprite picture Frasprite  路  3Comments

mithrann picture mithrann  路  3Comments

Merlin1993 picture Merlin1993  路  3Comments