Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashing with “Stub!” error #61

Open
SFenton opened this issue Oct 14, 2020 · 4 comments
Open

App crashing with “Stub!” error #61

SFenton opened this issue Oct 14, 2020 · 4 comments
Labels
bug Something isn't working Platform: Android

Comments

@SFenton
Copy link

SFenton commented Oct 14, 2020

I'm playing around with trying to add the react-native-dualscreeninfo to my existing React Native project. However, when adding the gradle requirements to get it running (just the Kotlin version, and I've also added the maven for the SDK feed), I annoyingly just get a crash that says "Stub!". I can't screenshot it in the app- it just crashes- but here's a stack from Android Studio:

image

Frustratingly, I can get the example projects to build and run, so I think it's something in my proj
ect setup, and not the emulator.

Has anyone run into this and been able to get around it? Very excited to start developing, but this roadblock is a big one.

@ghost ghost added the Needs: triage 🔍 label Oct 14, 2020
@conceptdev
Copy link
Member

I noticed a similar post on Stack Overflow (crosspost?), transferring the answer here for reference: similar issue was tracked down to Proguard/R8 in release builds where minification was enabled. Added

-keep class com.microsoft.device.display.** { *; }

to fix the problem. Thanks Sapph for the answer.

@chrisglein
Copy link
Member

@conceptdev Thanks for the link and the fix information! Is there something that needs to change in the config for react-native-dualscreen or is this something for the general app config?

@ghost
Copy link

ghost commented Apr 5, 2021

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@conceptdev
Copy link
Member

The "Stub" error is an indicator that the project isn't including the DisplayMask library, so compare your Android project's gradle files against the samples... you'll need the following in build.gradle lines 42-44

        maven {
            url 'https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1'
        }

and line 52

implementation "com.microsoft.device.display:display-mask:0.3.0"

(in the correct locations). That should get things working, if the samples are already working for you.

If you already have that set in your Android project folder and still get the error, then it could be release proguard configuration. The Android Studio docs have some info. This wouldn't typically be set-up by default, so you shouldn't need to venture down this path unless it's something that's been added to your project...

Check if you have a proguardFiles entry in your gradle files - if you do and it's pointing to a proguard-rules.pro file, that's where you can enter the hint to keep the lib:

-keep class com.microsoft.device.display.** { *; }

Here's a random example of that file from the MSAL library which also uses DisplayMask. Note that the filename is different - that's something that can be changed in the gradle references.

@chrisglein chrisglein added bug Something isn't working and removed Needs: author feedback labels Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Platform: Android
Projects
None yet
Development

No branches or pull requests

3 participants