Get the Reddit app
Log In
Log in to Reddit
Open settings menu
-
Log In / Sign Up
-
Advertise on Reddit
Describe the bug
Unable to install latest Android APK on Android 12
To Reproduce
Download APK
Install APK
Expected behavior
App to be installed
Screenshots
Environment (please complete the following information):
- OS: Android 12
- Version: V1.0.10-beta0
Additional context
Logs
Rooted installer error:
Device: google Pixel 6 | Not MIUI | Android 12 | Using FilterApkSource ApkSource implementation | SAI 4.5
com.aefyr.sai.model.filedescriptor.ContentUriFileDescriptor$BadContentProviderException: DISPLAY_NAME column is null
at com.aefyr.sai.model.filedescriptor.ContentUriFileDescriptor.name(ContentUriFileDescriptor.java:30)
at com.aefyr.sai.model.apksource.DefaultApkSource.getApkName(DefaultApkSource.java:42)
at com.aefyr.sai.model.apksource.SignerApkSource.getApkName(SignerApkSource.java:64)
at com.aefyr.sai.model.apksource.SignerApkSource.nextApk(SignerApkSource.java:46)
at com.aefyr.sai.model.apksource.FilterApkSource.nextApk(FilterApkSource.java:25)
at com.aefyr.sai.installer2.impl.shell.ShellSaiPackageInstaller.install(ShellSaiPackageInstaller.java:112)
at com.aefyr.sai.installer2.impl.shell.ShellSaiPackageInstaller.lambda$enqueueSession$0$ShellSaiPackageInstaller(ShellSaiPackageInstaller.java:93)
at com.aefyr.sai.installer2.impl.shell.-$$Lambda$ShellSaiPackageInstaller$VdI3y9AkULdYCG2o9afJnUCfQnA.run(Unknown Source:6)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)
Checklist
- I have read the Contribution Guidelines.
Я создал приложение и попытался установить его на физическое устройство. Устройство сразу вылетает, когда я пытаюсь его запустить. Приложение отлично работает в эмуляторе. Мой телефон Samsung Galaxy A30 (Android 11). minSdkVersion
приложения равно 23, а targetSdkVersion
равно 31. Мое приложение позволяет пользователю создавать список своих предметов, оценок и создавать будильник для своего класса.
Полная ошибка, которую я получил с моего телефона:
com.aefyr.sai.model.filedescriptor.ContentUriFileDescriptor$BadContentProviderException: DISPLAY_NAME column is null
at com.aefyr.sai.model.filedescriptor.ContentUriFileDescriptor.name(ContentUriFileDescriptor.java:30)
at com.aefyr.sai.model.apksource.DefaultApkSource.getApkLocalPath(DefaultApkSource.java:47)
at com.aefyr.sai.model.apksource.FilterApkSource.getApkLocalPath(FilterApkSource.java:60)
at com.aefyr.sai.model.apksource.FilterApkSource.nextApk(FilterApkSource.java:28)
at com.aefyr.sai.installer2.impl.rootless.RootlessSaiPackageInstaller.install(RootlessSaiPackageInstaller.java:93)
at com.aefyr.sai.installer2.impl.rootless.RootlessSaiPackageInstaller.lambda$enqueueSession$0$RootlessSaiPackageInstaller(RootlessSaiPackageInstaller.java:70)
at com.aefyr.sai.installer2.impl.rootless.-$$Lambda$RootlessSaiPackageInstaller$ivyAcunEgIkYlu_dB2vN6MOWZPU.run(Unknown Source:6)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
1 ответ
Думаю причина в провайдере. Вы больше не можете использовать некоторые пути к файлам, как обычно в Android 11. Создайте файл provider.xml с чем-то вроде
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path
name="external_files"
path="." />
</paths>
Добавьте необходимые пути (Читайте о Контент-провайдере). После этого используйте Uri, например:
Uri fileUri = FileProvider.getUriForFile(
requireContext(),
BuildConfig.APPLICATION_ID + ".provider",
file);
Добавить в манифест:
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider" />
</provider>
Можете ли вы предоставить код, где появляется эта ошибка?
0
Marina
19 Янв 2022 в 18:59
I created an app and tried to install it on a physical device. The device immediately crash when I tried to run it. The app works fine in the emulator. My phone is Samsung Galaxy A30 (Android 11). The app’s minSdkVersion
is 23 and targetSdkVersion
is 31. My app lets user to create list of their subjects, grades and create alarm for their class.
Full error I got from my phone:
com.aefyr.sai.model.filedescriptor.ContentUriFileDescriptor$BadContentProviderException: DISPLAY_NAME column is null
at com.aefyr.sai.model.filedescriptor.ContentUriFileDescriptor.name(ContentUriFileDescriptor.java:30)
at com.aefyr.sai.model.apksource.DefaultApkSource.getApkLocalPath(DefaultApkSource.java:47)
at com.aefyr.sai.model.apksource.FilterApkSource.getApkLocalPath(FilterApkSource.java:60)
at com.aefyr.sai.model.apksource.FilterApkSource.nextApk(FilterApkSource.java:28)
at com.aefyr.sai.installer2.impl.rootless.RootlessSaiPackageInstaller.install(RootlessSaiPackageInstaller.java:93)
at com.aefyr.sai.installer2.impl.rootless.RootlessSaiPackageInstaller.lambda$enqueueSession$0$RootlessSaiPackageInstaller(RootlessSaiPackageInstaller.java:70)
at com.aefyr.sai.installer2.impl.rootless.-$$Lambda$RootlessSaiPackageInstaller$ivyAcunEgIkYlu_dB2vN6MOWZPU.run(Unknown Source:6)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
3App crash when installed on a physical device Error: DISPLAY_NAME column is nullApp crash when installed on a physical device Error: DISPLAY_NAME column is null
0
3 answers
I think the reason is in Provider.
You cannot use some paths to files normally in Android 11 anymore.
Create a file provider.xml with something like
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path
name="external_files"
path="." />
</paths>
Add necessary paths (Read about Content provider).
After this use Uri like:
Uri fileUri = FileProvider.getUriForFile(
requireContext(),
BuildConfig.APPLICATION_ID + ".provider",
file);
Add to Manifest:
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider" />
</provider>
May you provide the code where this error appears?
ProgrammerAnswered 1 years ago
0
ProgrammerAnswered 1 years ago
0