Hi everyone!
We have a problem with app update.
if app have some native plugins changed, it will crash on a first run.
problem solving by cache clearing while update.
but how can i clear it by my app?
trying some native Java methods …
File dir = context.getCacheDir();
deleteDir(dir);
but it does not work
this solve problem, but clearing also all user data
/**
* Attempts to delete the cache files associated with an application.
* Since this may take a little while, the result will
* be posted back to the given observer. A deletion will fail if the calling context
* lacks the {@link android.Manifest.permission#DELETE_CACHE_FILES} permission, if the
* named package cannot be found, or if the named package is a "system package".
*
* @param packageName The name of the package to delete
* @param observer An observer callback to get notified when the cache file deletion
* is complete.
* {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)}
* will be called when that happens. observer may be null to indicate that
* no callback is desired.
*
* @hide
*/
@UnsupportedAppUsage
public abstract void deleteApplicationCacheFiles(@NonNull String packageName,
@Nullable IPackageDataObserver observer);
Having same crash.
Some additional information, for me the Crash happens once I call Application.Quit through the APP and try to open it again from the drawer that opens of the apps in memory.