aws-amplify / aws-sdk-android

AWS SDK for Android. For more information, see our web site:
https://docs.amplify.aws
Other
1.02k stars 548 forks source link

Analytics SDK - Android - InitializationException in amazonmobileanalytics. Encountered an error accessing the file system #3516

Closed ramprasad-vuclip closed 1 month ago

ramprasad-vuclip commented 5 months ago

Describe the bug A clear and concise description of what the bug is. Crash is observed in craslytics as 'Caused by com.amazonaws.mobileconnectors.amazonmobileanalytics.InitializationException' Encountered an error accessing the file system

To Reproduce A code sample or steps:

Couldn't reproduce this bug and it is observed in crashlytics.

Caused by com.amazonaws.mobileconnectors.amazonmobileanalytics.InitializationException
Encountered an error accessing the file system
com.amazonaws.mobileconnectors.amazonmobileanalytics.MobileAnalyticsManager.<init> (MobileAnalyticsManager.java:137)
com.amazonaws.mobileconnectors.amazonmobileanalytics.MobileAnalyticsManager.getOrCreateInstance (MobileAnalyticsManager.java:308)
com.amazonaws.mobileconnectors.amazonmobileanalytics.MobileAnalyticsManager.getOrCreateInstance (MobileAnalyticsManager.java:267)

We are calling above code during app initialisation. 
In turn in SDK, 
1. MobileAnalyticsManager's constructor calls validate(context) 
2. In FileManagerValidator cass, validate method creates file using "validatorFile = fileManager.createFile(new File(fileManager.getDirectory(""),
                    "validatorFile"));" 
3. Here the exception is thrown
Please support for any resolution

Which AWS service(s) are affected? Amazon Analytics and app crashes due to this

Expected behavior After successful initialisation of Amazon sdk, app can send events.

Screenshots Not available

Environment Information (please complete the following information):

mattcreaser commented 5 months ago

Thanks for the report @ramprasad-vuclip, someone from our team will have a look.

tylerjroach commented 4 months ago

@ramprasad-vuclip v2.2.4 is more than 3 years old and includes a large number of bug fixes in that timeframe. Can you upgrade to 2.75.0 and report back if you are still seeing the issue?