Leia Android Media SDK

I am able to build and run samples from Github for Leia Android Media SDK,

but with my own app I get this runtime error:

I/LeiaSDK: Display SDK 7.0.20
V6 platform APIs not available.
I/LeiaSDK: V6 platform APIs not available.
V5 platform APIs not available.
V4 platform APIs not available.
V3 platform APIs not available.
V2 platform APIs not available.
We were unable to load the Leia Platform. This error is normally caused by running on a non-Leia device, or running with old (EVT0) firmware. If you feel this message is in error, please contact Leia for support

I am running on Lume-Pad so the firmware should be good.
Is there a build error? My code is all Java, no Kotlin.

@Override
protected void onResume() {
super.onResume();
if (DEBUG) Log.d(TAG, “onResume”);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
invalidateOptionsMenu();
LeiaDisplayManager displayManager = LeiaSDK.getDisplayManager(getApplicationContext());
displayManager.requestBacklightMode(LeiaDisplayManager.BacklightMode.MODE_3D);
}

All my code does is try to load the display Manager and null is returned, because the SDK is not available.

Any ideas to fix?

Thanks for reaching out @javamind. Considering that you’re able to run the sample apps, its not an issue with your device. In order to debug, I’d like to get some more information about your Android app.

  1. Are you using Proguard for code obfuscation? If yes, please send me your proguard-rules.pro file.

  2. What’s the minimum SDK version and target SDK version for your app?

Hi Pinto,
My proguard-rules.pro file has only comments.

minSdkVersion 28
targetSdkVersion 29

I'm using Android Studio 4.1.1 with android gradle plugin version 4.0.2 and gradle version 4.6.1
These versions work with sample code too.
I have not been able to use plugin 4.1.1 and 6.5 respectively because it fails to build with navigation.json merge error for both samples and my code.
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  LeiaDisplayManager displayManager = LeiaSDK.getDisplayManager(getApplicationContext());
  displayManager.requestBacklightMode(LeiaDisplayManager.BacklightMode.MODE_2D);

displayManager is null.
2020-11-28 08:48:03.996 4704-4704/? I/dymodla.r3dree: Late-enabling -Xcheck:jni
2020-11-28 08:48:04.011 4704-4704/? E/dymodla.r3dree: Unknown bits set in runtime_flags: 0x8000
2020-11-28 08:48:04.345 4704-4704/com.andymodla.r3dreel I/Perf: Connecting to perf service.
2020-11-28 08:48:04.395 4704-4704/com.andymodla.r3dreel I/LeiaSDK: Display SDK 7.0.20
2020-11-28 08:48:04.395 4704-4704/com.andymodla.r3dreel I/LeiaSDK: V6 platform APIs not available.
2020-11-28 08:48:04.395 4704-4704/com.andymodla.r3dreel I/LeiaSDK: V6 platform APIs not available.
2020-11-28 08:48:04.395 4704-4704/com.andymodla.r3dreel I/LeiaSDK: V5 platform APIs not available.
2020-11-28 08:48:04.396 4704-4704/com.andymodla.r3dreel I/LeiaSDK: V4 platform APIs not available.
2020-11-28 08:48:04.396 4704-4704/com.andymodla.r3dreel I/LeiaSDK: V3 platform APIs not available.
2020-11-28 08:48:04.396 4704-4704/com.andymodla.r3dreel I/LeiaSDK:  V2 platform APIs not available.
2020-11-28 08:48:04.396 4704-4704/com.andymodla.r3dreel I/LeiaSDK: We were unable to load the Leia Platform. This error is normally caused by running on a non-Leia device, or running with old (EVT0) firmware. If you feel this message is in error, please contact Leia for support
2020-11-28 08:48:04.396 4704-4704/com.andymodla.r3dreel D/AndroidRuntime: Shutting down VM
2020-11-28 08:48:04.397 4704-4704/com.andymodla.r3dreel E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.andymodla.r3dreel, PID: 4704
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.andymodla.r3dreel/com.andymodla.r3dreel.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void com.leiainc.androidsdk.display.LeiaDisplayManager.requestBacklightMode(com.leiainc.androidsdk.display.LeiaDisplayManager$BacklightMode)' on a null object reference

My code only runs when I comment out these last two lines in onCreate, of course it does not try to use Leia Media SDK then.
Do I need any developer out of ordinary USB debugging settings?

Hi @javamind! I agree with @clintonpinto that this sounds likely to be a proguard issue. Would it be possible to share your APK? (We can decompile it and confirm whether or not the issue is proguard). Would it be possible to see your build.gradle? (or at least the proguard configuration part?)

1 Like

Turns out it was not a proguard issue (the file had only comments).
After trying different changes I found the app worked as coded when I changed:

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    tools:node="replace" android:label="3D 4V Reel"

TO
1 Like

Glad it’s working!

It looks like your comment didn’t get formatted correctly; mind editing it? (Would like to know what went wrong, in case it can be helpful to others)

1 Like

Turns out it was not a proguard issue (the file had only comments).
After trying different changes I found the app worked as coded when I changed my AndroidManifest.xml file from:

<application
android:allowBackup=“true”
android:icon="@mipmap/ic_launcher"
tools:node=“replace” android:label=“3D 4V Reel”

to

<application
android:allowBackup=“true”
android:icon="@mipmap/ic_launcher"
android:label=“3D 4V Reel”

Don’t know why the replace in the manifest upset run time library. It turns out, I did not need a replace node after all because only one app flavor existed after revising my code to use Android Media SDK.
Thanks for your help with this, problem resolved.

Note: Replying by email to the Forum is at risk for losing content.

Another issue with the Forum is that postings cannot be edited!

2 Likes

Ah, this makes sense. tools:node="replace" is probably removing the manifest tag that our SDK uses to identify your app as Leia-compatible. Thank you for your feedback!

My old days as visual basic .net programmer are far, far away. I can’t even run a simple Hello World with Kotlin/IntelliJs. Seems I need to select a module for run as Android App, but the dropdown box is empty.
Also I don’t know how to incorporate Leia Android Media SDK to the code.

I only wanted to do a simple 3D YouTube App for playing SBS videos.

If there’s anyone experimenting with Leia Media SDK I think the most important App can do is this: Please somebody use this code to make 3D YouTube
(I will pay for the App or even a subscription for more features)

1 Like