-
Notifications
You must be signed in to change notification settings - Fork 258
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
AAssetManager_open freezing #790
Comments
We also hit this bug a couple of months ago. So we are not using AAssetManager anymore, instead all assets are extracted to the internal memory (one the app starts) and native code access them as regular files. |
Looks like this is a duplicate of android/ndk-samples#571, which is closed now. |
@rprichard while this might be a duplicate, is it a bug in the NDK? Using this code worked fine for many years:
If it is how it should be then shouldn't it be made to always fail, or at least have a better error message when it does fail? It just froze up our app for like 1 minute + then crashed. |
I think the sample needed to register a global reference to keep the I'm not sure what the NDK can do about this. We do have a warning on the
|
This happened to me before, cause was calling it on a non UI thread. |
"We do have a warning on the AAssetManager_fromJava docs" |
I’m using this c file to read files on the native side:
https://github.com/googlesamples/android-ndk/blob/master/native-media/app/src/main/cpp/android_fopen.c
Now we are getting plenty of ANRs in our app from this code - ~1700 ANRs a month.
Looks like the trouble is in “AAssetManager_open”.
This is the stack trace:
Using NDK r17c and Clang.
Does anyone know any possible fixes or other things I could try to narrow the problem down?
The text was updated successfully, but these errors were encountered: