flutter_downloader icon indicating copy to clipboard operation
flutter_downloader copied to clipboard

having issue while uploading apk to playstore(due to Android 12 )

Open shabeerseeroo1 opened this issue 3 years ago • 1 comments

facing an issue while uploading the app to the play store, this issue will get on while giving exported as false as per the documentation, and the new rule of android the exported should be true in order to work in android 12 and greater devices and if set exported as true in provider the application will be crashed image

shabeerseeroo1 avatar Jun 21 '22 12:06 shabeerseeroo1

You should provide the stacktrace instead of a non helpful screenshot of your manifest

rekire avatar Sep 10 '22 15:09 rekire

i have same issue : if android:exported="true" app will crash

                   ^

✓ Built build/app/outputs/flutter-apk/app-debug.apk. Installing build/app/outputs/flutter-apk/app.apk... E/AndroidRuntime(28735): FATAL EXCEPTION: main E/AndroidRuntime(28735): Process: portal.tanahdatar.egov, PID: 28735 E/AndroidRuntime(28735): java.lang.RuntimeException: Unable to get provider vn.hunghd.flutterdownloader.DownloadedFileProvider: java.lang.SecurityException: Provider must not be exported E/AndroidRuntime(28735): at android.app.ActivityThread.installProvider(ActivityThread.java:8215) E/AndroidRuntime(28735): at android.app.ActivityThread.installContentProviders(ActivityThread.java:7746) E/AndroidRuntime(28735): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7566) E/AndroidRuntime(28735): at android.app.ActivityThread.access$1500(ActivityThread.java:301) E/AndroidRuntime(28735): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2177) E/AndroidRuntime(28735): at android.os.Handler.dispatchMessage(Handler.java:106) E/AndroidRuntime(28735): at android.os.Looper.loop(Looper.java:246) E/AndroidRuntime(28735): at android.app.ActivityThread.main(ActivityThread.java:8653) E/AndroidRuntime(28735): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(28735): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) E/AndroidRuntime(28735): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130) E/AndroidRuntime(28735): Caused by: java.lang.SecurityException: Provider must not be exported E/AndroidRuntime(28735): at androidx.core.content.FileProvider.attachInfo(FileProvider.java:410) E/AndroidRuntime(28735): at android.app.ActivityThread.installProvider(ActivityThread.java:8210) E/AndroidRuntime(28735): ... 10 more

RobbyOkta19 avatar Nov 24 '22 03:11 RobbyOkta19

I'm getting the same issue, unable to run or publish the app when exported is set to true, did you guys find the solution ?

Kishan-Somaiya avatar Nov 24 '22 11:11 Kishan-Somaiya

@rekire @bartekpacia guys can you help us with this?

Kishan-Somaiya avatar Nov 24 '22 11:11 Kishan-Somaiya

Did you add it as mentioned in the readme file? it must be android:exported="false"

rekire avatar Nov 24 '22 11:11 rekire

if you add android:exported="false" play store won't accept your build for android 12 or higher. @rekire

Kishan-Somaiya avatar Nov 24 '22 12:11 Kishan-Somaiya

I'm not using that file provider in production so I never faced this issue. However I cannot find any references that they must be exported. That android:exported="true" requirement just applies for activities, services, or broadcast receivers that use intent filters. Instead I found a reference which recommend to set it to false for providers.

Could you guys please show the error message of the PlayStore itself? I would expect that there is a link to a documentation, that would help me to understand the issue.

To be honest this provider is my mind that is some kind of legacy code, but I had no time for a bigger refactoring which I which I would like make that provider not necessary. However that will take based on my limited times realistic a couple of month.

rekire avatar Nov 27 '22 19:11 rekire