Description:
I am using the flutter_gemma package in my Flutter application, and I've encountered a challenge when trying to use the library on devices running Android 14. The library currently requires the model to be located in /data/local/tmp/, but due to enhanced security restrictions in Android 14, writing to this path is no longer permitted for non-system apps, resulting in a Permission denied error.
Steps to Reproduce:
Use the flutter_gemma package in a Flutter application targeting Android 14.
Attempt to copy a model file to /data/local/tmp/ as required by the package.
Observe the error: PathAccessException: Cannot copy file to '/data/local/tmp/', (OS Error: Permission denied, errno = 13).
Expected Behavior:
The application should be able to load the model from a path that is accessible without elevated permissions on Android 14, such as app-specific storage (/data/user/0/<package_name>/files/).
Proposed Solution:
Allow the model path to be configurable so that it can point to a directory accessible by the app on Android 14 and above.
Update the documentation to reflect any new path requirements or configuration options for the package.
Description: I am using the
flutter_gemma
package in my Flutter application, and I've encountered a challenge when trying to use the library on devices running Android 14. The library currently requires the model to be located in/data/local/tmp/
, but due to enhanced security restrictions in Android 14, writing to this path is no longer permitted for non-system apps, resulting in aPermission denied
error.Steps to Reproduce:
flutter_gemma
package in a Flutter application targeting Android 14./data/local/tmp/
as required by the package.PathAccessException: Cannot copy file to '/data/local/tmp/', (OS Error: Permission denied, errno = 13)
.Expected Behavior: The application should be able to load the model from a path that is accessible without elevated permissions on Android 14, such as app-specific storage (
/data/user/0/<package_name>/files/
).Proposed Solution: