-
Notifications
You must be signed in to change notification settings - Fork 549
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
AmazonClientException crashes app on bad network #556
Comments
@NightOwlCoder Sorry for the inconvenience caused. Can you check if the emulator when you were running your app/tests switched from one network to the other? I have encountered this issue when my emulator switches from one network to the other. If I restart the emulator and connect to the new network again, the app/tests work fine. If I understand correctly, you are invoking |
Hey @kvasukib , yes I do have a callback which is never called. The code you pointed to catches |
Got it. AmazonClientException is a runtime exception. The SDK throws this exception when the SDK cannot handle an error scenario at runtime. You can catch this exception in your app and take corresponding action. Nonetheless, we will add more error handling mechanisms in the AWSIotMqttManager. |
I can't catch that, as it is under a thread you guys create. |
@NightOwlCoder Apologies for the confusion. We will address this by catching the AmazonClientException and invoking the StatusCallback passed into the connect method. |
Hey there, any way for me getting an early release to test this? My app keeps crashing, and I would like to help to get a faster fix. |
Hey @kvasukib, any feedback on this? My app keeps crashing and I really need at least a workaround... Looks like every time there is a network hiccup it can't survive. |
@NightOwlCoder Sorry for the delay. I have added exception handling and passing it back to the client status callback. This change will be released in the next revision of the SDK. |
@NightOwlCoder This has been fixed in UPDATE: The maven artifact is available now. |
Hey there @kvasukib , I have installed this on 3 of our devices in QA and will report back once 24h has passed. Thanks for the quick turn around. |
I have been having this problem for a year, thank you, and finally solved it. |
Thank you @zhouxuemeng1988 for the feedback. Apologies for our delay in fixing it. Please let us know how your app testing goes and we welcome your feedback. |
Response migrated to #567 |
@zhouxuemeng1988 The issue you raised is different from the original issue. This happens when the network is not reachable. You can add a check for network reachability in your app before making a network call. Can you open a new issue for this and we can discuss there? |
|
I'm still having that issue on 2.7.7 SDK. Crash log:
|
It doesn't look like #567 as it mentions Read timeout in exception, and mine as well this one ( #556 ) mentions: |
@kvasukib hey there, is there a way for me to increase log level? |
Response migrated to #588 |
Hi @GiovanniVisentini , Can you open a different issue? You do have a similar stacktrace, but since you are using Pinpoint the fix will be else where in the code. This thread is getting crowded by different code fixes. Thanks |
@NightOwlCoder SDK uses Apache Commons Logging library(JCL) if it is present in the classpath else it uses android.util.Log. Add logging.properties file to res/raw and add following to onCreate of the MainActivity logger = Logger.getLogger(PubSubActivity.class.getName());
InputStream raw = getResources().openRawResource(R.raw.logging);
LogManager lManager = LogManager.getLogManager();
lManager.readConfiguration(raw); Using Android Log : There is no way to change log level for entire SDK in this case. However as a workaround to change log levels for debugging purposes you can change it for a specific tag with the following command: |
Hi, We are closing this issue because the original issue was resolved. Please feel free to open a new issue if the problem persists. We ask this because closed issues are not actively monitored. Thanks |
Hey there,
using com.amazonaws:aws-android-sdk-iot:2.7.6 to connect to my service, is crashing my app.
Full stack is below, but basically I see that this call:
https://github.com/aws/aws-sdk-android/blob/master/aws-android-sdk-iot/src/main/java/com/amazonaws/mobileconnectors/iot/AWSIotMqttManager.java#L720
running in an anonymous thread will not catch AmazonClientException.
Off course, no matter how I call it, this will always crash.
Above method is called under a try/catch, not depicted above.
Can we fix this?
Full stack follow:
The text was updated successfully, but these errors were encountered: