Моя платформа — Android 12. Я установил APK-файл на USB-накопитель через файловый менеджер и обнаружил ошибку. Нужна помощь в анализе причин этой проблемы?
Следующее это сообщение об ошибке при нажатии на установку APK
E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.packageinstaller/com.android.packageinstaller.InstallStart}: java.lang.SecurityException: UID 10027 does not have permission to content://com.huanglong.explorer.fileprovider/root/netflix-mobile.apk
BaseFileActivity.java
private void openOthers(FileInfo fileInfo) {
Intent intent = new Intent();
String type = fileInfo.getMimeTypes();
if (TextUtils.equals(type, APK_MIMETYPE)) {
intent.setAction(INTENT_ACTION_PACKAGE);
intent.putExtra(EXTRA_CALLING_PACKAGE_KEY, EXTRA_CALLING_PACKAGE_VALUE);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
intent.setDataAndType(
FileProvider.getUriForFile(this, AUTHORITY_APK,
new File(fileInfo.getPath())), APK_MIMETYPE);
openIntent(intent);
} else if (fileInfo.getPath().toLowerCase(Locale.ENGLISH).contains(".bdmv")) {
if (mIsSupportBD) {
launchBDPlayer(fileInfo.getPath());
}
} else {
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(INTENT_TAG_SORT_COUNT, Config.getInstance().getFileSortType());
intent.setDataAndType(transformUri(fileInfo.getPath()), type);
openIntent(intent);
}
}
private void openIntent(Intent intent) {
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
Toast.makeText(BaseFileActivity.this, getString(R.string.no_file_support), Toast.LENGTH_SHORT).show();
LogTool.singleton().debug("not find activity to open this type : " + intent.getType());
}
}
AndroidManifest.xml
android:name="android.support.v4.content.FileProvider"
android:authorities="com.huanglong.explorer.fileprovider"
android:grantUriPermissions="true"
android:exported="false"
>
file_paths.xml
Подробнее здесь: https://stackoverflow.com/questions/791 ... ption-unab
Установлен APK Android 12, покажите: E AndroidRuntime: java.lang.RuntimeException: невозможно начать действие ComponentI ⇐ Android
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение