Comments (7)
Hey @Karambar, thanks for reporting this.
We're currently looking into it, can you please provide me with more details (if any). Like, is it something consistent, is the maps activity the last activity in your stack or are you using the home button and removing it from recents, etc...
from instabug-android.
Hi @mSobhy90 , thanks for your answer.
I did some tests and I have found which use of the SDK was generating this bug. I initialise the Instabug SDK from my custom Application class and I immediately disable it using the method Instabug.disable().
Indeed, I want to make this feature only available for some clients so I disable it by default and only enable it according to a list of beta testers. However, call the method Instabug.disable() just after the SDK initialisation cause a crash when I leave the app. If I don't disable the SDK, everything is fine and the app is not crashing anymore.
Do you have a tips for me to only enable Instabug for some clients ? I could build the SDK after the login process but I find this usage dangerous.
Otherwise, to answer your questions, this crash is consistent and appears on every devices I have. Moreover, I'm not using the home button, I press the back button which makes me leave the app because the maps activity is the last activity in my stack.
from instabug-android.
Hi @Karambar, thanks for the detailed report.
As for the use-case you mentioned, I've checked it out and was able to re-produce the bug as follows:
- Disable Instabug after building it
- Enable it on an activity button click
- Close the application
- Kaboom
And I'll work on a fix right away.
As for enabling Instabug to certain users, we had that case in mind when designing the builder.
You can build Instabug in the Application class as normal with 1 difference, the build()
function has an overload which takes state build(Feature.State instabugInitialState)
. So in that scenario you'll have something following this pattern.
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
new Instabug.Builder(this, "<TOKEN>")
.build(Feature.State.DISABLED);
}
}
And then when user clicks some button in the settings screen (or wherever):
if (Instabug.isEnabled()) {
Instabug.disable();
} else {
Instabug.enable();
}
That should achieve your scenario. Can you please confirm?
from instabug-android.
Thanks @mSobhy90 for your detailed answer !
We integrated your modifications and the behaviours is much more better, however we noticed a new issue in a very specific use-case.
You can reproduce this bug following these steps:
- Build Instabug with
build(Feature.State.DISABLED)
- Enable it on activity button click (log in button in our app)
- Disable it programmatically when the user click on a button (logout button for us)
- Kill the app
- Relaunch the app (It will build Instabug as in the first step)
- Enable Instabug on activity button click (same as the second step)
- Close the app
- Kaboom !
And it generates the following stack trace :
INSTABUG - Instabug: Instabug Caught an Unhandled Exception: java.lang.RuntimeException java.lang.RuntimeException: Unable to stop activity {fr.chauffeurprive.preprod/fr.chauffeurprive.presentation.order.view.OrderActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.instabug.library.internal.e.a.d.b()' on a null object reference at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3500) at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3550) at android.app.ActivityThread.-wrap20(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.instabug.library.internal.e.a.d.b()' on a null object reference at com.instabug.library.internal.e.a.o.c(ReadQueueCacheManager.java:60) at com.instabug.library.k.b(SessionManager.java:59) at com.instabug.library.ab.d(InstabugDelegate.java:283) at com.instabug.library.Instabug.notifyDelegateActivityStopped(Instabug.java:142) at com.instabug.library.v.onActivityStopped(InstabugActivityLifecycleListener.java:41) at android.app.Application.dispatchActivityStopped(Application.java:232) at android.app.Activity.onStop(Activity.java:1620) at android.support.v4.app.FragmentActivity.onStop(FragmentActivity.java:562) at fr.chauffeurprive.presentation.order.view.OrderActivity.onStop(OrderActivity.java:415) at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1278) at android.app.Activity.performStop(Activity.java:6395) at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3497) at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3550) at android.app.ActivityThread.-wrap20(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
The crash seems to be the same, please let me know if you need more details or if you want me to do a new issue for this bug.
from instabug-android.
Hi @Karambar, sorry for my late response, and thanks again for your detailed reports it's deeply appreciated.
I've been able to reproduce the issue, and I've worked out a fix for both cases. It'll be rolling out by end of today.
Thanks a lot @Karambar for helping us make Instabug better. 🍻
from instabug-android.
Closing this since v2.2 was released containing this fix
from instabug-android.
Thank you very much @mSobhy90 for your reactivity !
We integrated your new release and everything seems to be OK . 🚀
from instabug-android.
Related Issues (20)
- Memory leaking in Instabug library class HOT 3
- NoClassDefFoundError: InstabugAPMOkhttpInterceptor doesn't exist. HOT 2
- Hide private views in Jetpack compose , although inside fragments HOT 1
- NPE in call to getWifiSSID() in com.instabug.library.util.DeviceStateProvider.getWifiSSID (DeviceStateProvider.java:5) HOT 1
- Instabug spawns and keeps threads even when not initialized or disabled HOT 2
- Crash when trying to record a video twice in one session on API 34 HOT 1
- Task minifyReleaseWithR8 failing on 12.3.0 HOT 1
- Duplicate classes since version 12 (12.2 and (12.3.1) in okhttp-interceptor, probable proguard issue HOT 1
- The response body is not full HOT 1
- Instabug not working in react native
- ClassCastException: Activity cannot be cast to androidx.appcompat.app.AppCompatActivity HOT 3
- crash on screenshoot in Android 14
- Lint warnings in AGP 8.3.0 HOT 3
- Kotlin Multiplatform support HOT 2
- Instabug is not responding to BugReporting.show() or Shake event HOT 3
- video recorder button hidden while recording video & open bottom sheet HOT 1
- addPrivateViews does not mask UI in screen recordings HOT 2
- FOREGROUND_SERVICE_MEDIA_PROJECTION permission on SDK 34 HOT 4
- Lint error for SDK 34 with `SelectedPhotoAccess` HOT 2
- AttendanceCollectionActivity.VerifyThumb java.lang.IllegalArgumentException - bad base-64 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instabug-android.