Jump to content
KMarb

delphi 11 android app error "Application does not support this device"

Recommended Posts

I had been testing my app on a samsung tablet and a ulefone Armor X9 and had it all working, i thought. Now I'm trying to deploy to some other ulefone models (armor x3 and x5) and I'm able to install, but when i launch the app i get error "Application does not support this device" or the app immediately closes. Any thoughts on how to fix? Using deviceLens here is some of the logging

 

12-05 16:52:39.495    I    com.zunna.JCMPhotos    20787    20787    zunna.JCMPhoto    Late-enabling -Xcheck:jni
12-05 16:52:39.592    W    com.zunna.JCMPhotos    20787    20787    re-initialized>    type=1400 audit(0.0:1727): avc: denied { read } for name="u:object_r:mtk_amslog_prop:s0" dev="tmpfs" ino=3397 scontext=u:r:untrusted_app:s0:c109,c256,c512,c768 tcontext=u:object_r:mtk_amslog_prop:s0 tclass=file permissive=0
12-05 16:52:39.596    E    com.zunna.JCMPhotos    20787    20787    libc    Access denied finding property "persist.vendor.sys.activitylog"
12-05 16:52:40.054    D    com.zunna.JCMPhotos    20787    20787    AndroidRuntime    Shutting down VM
12-05 16:52:40.064    E    com.zunna.JCMPhotos    20787    20787    AndroidRuntime    FATAL EXCEPTION: main
12-05 16:52:40.064    E    com.zunna.JCMPhotos    20787    20787    AndroidRuntime    Process: com.zunna.JCMPhotos, PID: 20787
12-05 16:52:40.064    E    com.zunna.JCMPhotos    20787    20787    AndroidRuntime    java.lang.RuntimeException: Unable to get provider androidx.core.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "androidx.core.content.FileProvider" on path: DexPathList[[zip file "/data/app/com.zunna.JCMPhotos-pBkN5adkbbYEbIb8Jtd9VQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.zunna.JCMPhotos-pBkN5adkbbYEbIb8Jtd9VQ==/lib/arm, /data/app/com.zunna.JCMPhotos-pBkN5adkbbYEbIb8Jtd9VQ==/base.apk!/lib/armeabi-v7a, /system/lib]]
12-05 16:52:40.064    E    com.zunna.JCMPhotos    20787    20787    AndroidRuntime    at android.app.ActivityThread.installProvider(ActivityThread.java:6427)
 

Share this post


Link to post

Related to tog message, java.lang.RuntimeException: Unable to get provider androidx.core.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "androidx.core.content.FileProvider"

 

Here is entry in androidmanifest.xml:

        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="com.zunna.JCMPhotos.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths" />
        </provider>

 

and here is the provider_paths.xml file:

 

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <files-path name="internal_private_files" path="." />
    <cache-path name="internal_cache_files" path="." />
    <external-path name="external_public_files" path="." />
    <external-files-path name="external_private_files" path="." />
    <external-cache-path name="external_cache_files" path="." />
    <external-media-path name="external_media_files" path="." />
</paths>
 

Do those entries make sense?

Share this post


Link to post
1 hour ago, KMarb said:

 java.lang.RuntimeException: Unable to get provider androidx.core.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "androidx.core.content.FileProvider"

It's odd that you would receive that error on one device and not another. Regardless, please see this: https://github.com/DelphiWorlds/HowTo/tree/main/Solutions/AndroidLibraries

Share this post


Link to post

Really glad to have your feedback. I had already tried that and it did not help. Here is a bit of an odd thing I don't understand yet... I have 2 apps that use a lot of the same code, identical manifests and associated xml files. One works and one doesn't. I compared the deployment lists and they seem identical. The Armor X3 is a 32-bit device, so I'm running release version of 32-bit app. Here is the start of the android log for the WORKING app (non-working app log is above). I can send more of either log if that would help identify what is different. In the working app log, there is no mention of "fileprovider", but the same entries are in manifest.

 

12-06 15:23:09.444    I    com.zunna.JCMTime    26899    26899    m.zunna.JCMTim    Late-enabling -Xcheck:jni
12-06 15:23:09.593    W    com.zunna.JCMTime    26899    26899    re-initialized>    type=1400 audit(0.0:5735): avc: denied { read } for name="u:object_r:mtk_amslog_prop:s0" dev="tmpfs" ino=3397 scontext=u:r:untrusted_app:s0:c106,c256,c512,c768 tcontext=u:object_r:mtk_amslog_prop:s0 tclass=file permissive=0
12-06 15:23:09.598    E    com.zunna.JCMTime    26899    26899    libc    Access denied finding property "persist.vendor.sys.activitylog"
12-06 15:23:12.404    D    com.zunna.JCMTime    26899    26899    OpenGLRenderer    Skia GL Pipeline
12-06 15:23:12.406    I    com.zunna.JCMTime    26899    26899    SurfaceFactory    [static] sSurfaceFactory = com.mediatek.view.impl.SurfaceFactoryImpl@9eeb266
12-06 15:23:12.695    E    com.zunna.JCMTime    26899    26899        appName=com.zunna.JCMTime, acAppName=/system/bin/surfaceflinger
12-06 15:23:12.696    E    com.zunna.JCMTime    26899    26899        0
12-06 15:23:12.700    I    com.zunna.JCMTime    26899    26899    ConfigStore    android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
12-06 15:23:12.701    I    com.zunna.JCMTime    26899    26899    ConfigStore    android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
12-06 15:23:12.703    I    com.zunna.JCMTime    26899    26899    BufferQueue    [unnamed-26899-0](this:0x8f58e000,id:0,api:0,p:-1,c:-1) BufferQueue core=(26899:com.zunna.JCMTime)
12-06 15:23:12.706    W    com.zunna.JCMTime    26899    26899    m.zunna.JCMTime    type=1400 audit(0.0:5736): avc: denied { read } for name="u:object_r:graphics_debug_prop:s0" dev="tmpfs" ino=3373 scontext=u:r:untrusted_app:s0:c106,c256,c512,c768 tcontext=u:object_r:graphics_debug_prop:s0 tclass=file permissive=0
12-06 15:23:12.713    E    com.zunna.JCMTime    26899    26899    libc    Access denied finding property "vendor.debug.sf.stc_interval"
12-06 15:23:12.714    E    com.zunna.JCMTime    26899    26899    libc    Access denied finding property "vendor.debug.bq.dump"
12-06 15:23:12.710    W    com.zunna.JCMTime    26899    26899    m.zunna.JCMTime    type=1400 audit(0.0:5737): avc: denied { read } for name="u:object_r:debug_bq_dump_prop:s0" dev="tmpfs" ino=3334 scontext=u:r:untrusted_app:s0:c106,c256,c512,c768 tcontext=u:object_r:debug_bq_dump_prop:s0 tclass=file permissive=0
12-06 15:23:12.723    I    com.zunna.JCMTime    26899    26899    BufferQueueConsumer    [unnamed-26899-0](this:0x8f58e000,id:0,api:0,p:-1,c:26899) connect(C): consumer=(26899:com.zunna.JCMTime) controlledByApp=true
12-06 15:23:12.724    E    com.zunna.JCMTime    26899    26899    libc    Access denied finding property "vendor.debug.bq.dump"
12-06 15:23:12.720    W    com.zunna.JCMTime    26899    26899    m.zunna.JCMTime    type=1400 audit(0.0:5738): avc: denied { read } for name="u:object_r:debug_bq_dump_prop:s0" dev="tmpfs" ino=3334 scontext=u:r:untrusted_app:s0:c106,c256,c512,c768 tcontext=u:object_r:debug_bq_dump_prop:s0 tclass=file permissive=0
12-06 15:23:12.724    E    com.zunna.JCMTime    26899    26899    libc    Access denied finding property "vendor.debug.bq.line"
12-06 15:23:12.720    W    com.zunna.JCMTime    26899    26899    m.zunna.JCMTime    type=1400 audit(0.0:5739): avc: denied { read } for name="u:object_r:graphics_debug_prop:s0" dev="tmpfs" ino=3373 scontext=u:r:untrusted_app:s0:c106,c256,c512,c768 tcontext=u:object_r:graphics_debug_prop:s0 tclass=file permissive=0
12-06 15:23:12.724    E    com.zunna.JCMTime    26899    26899    libc    Access denied finding property "vendor.debug.bq.dump"
12-06 15:23:12.720    W    com.zunna.JCMTime    26899    26899    m.zunna.JCMTime    type=1400 audit(0.0:5740): avc: denied { read } for name="u:object_r:debug_bq_dump_prop:s0" dev="tmpfs" ino=3334 scontext=u:r:untrusted_app:s0:c106,c256,c512,c768 tcontext=u:object_r:debug_bq_dump_prop:s0 tclass=file permissive=0

Share this post


Link to post

The app is not giving me the error message anymore. When I launch it, I see splash screen, and then message "<MyAppName> has stopped, App info, close app".

 

I added a log.d call in the project file before Application.Initialize; That log call does not show up in android log file.

 

Here is the full android log. I bolded a line that seems really odd to meq:

 

12-06 15:50:15.015    I    com.zunna.JCMPhotos    29570    29570    zunna.JCMPhoto    Late-enabling -Xcheck:jni
12-06 15:50:15.249    E    com.zunna.JCMPhotos    29570    29570    libc    Access denied finding property "persist.vendor.sys.activitylog"
12-06 15:50:18.107    D    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    Shutting down VM
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    FATAL EXCEPTION: main
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    Process: com.zunna.JCMPhotos, PID: 29570
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    java.lang.RuntimeException: Unable to get provider androidx.core.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "androidx.core.content.FileProvider" on path: DexPathList[[zip file "/data/app/com.zunna.JCMPhotos-YQiq9zZupR4iE_EdtFvljA==/base.apk"],nativeLibraryDirectories=[/data/app/com.zunna.JCMPhotos-YQiq9zZupR4iE_EdtFvljA==/lib/arm, /data/app/com.zunna.JCMPhotos-YQiq9zZupR4iE_EdtFvljA==/base.apk!/lib/armeabi-v7a, /system/lib]]
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at android.app.ActivityThread.installProvider(ActivityThread.java:6427)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at android.app.ActivityThread.installContentProviders(ActivityThread.java:5969)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5884)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at android.app.ActivityThread.access$1200(ActivityThread.java:206)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1678)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at android.os.Handler.dispatchMessage(Handler.java:106)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at android.os.Looper.loop(Looper.java:193)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at android.app.ActivityThread.main(ActivityThread.java:6702)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at java.lang.reflect.Method.invoke(Native Method)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.core.content.FileProvider" on path: DexPathList[[zip file "/data/app/com.zunna.JCMPhotos-YQiq9zZupR4iE_EdtFvljA==/base.apk"],nativeLibraryDirectories=[/data/app/com.zunna.JCMPhotos-YQiq9zZupR4iE_EdtFvljA==/lib/arm, /data/app/com.zunna.JCMPhotos-YQiq9zZupR4iE_EdtFvljA==/base.apk!/lib/armeabi-v7a, /system/lib]]
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at android.app.AppComponentFactory.instantiateProvider(AppComponentFactory.java:121)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    at android.app.ActivityThread.installProvider(ActivityThread.java:6411)
12-06 15:50:18.117    E    com.zunna.JCMPhotos    29570    29570    AndroidRuntime    ... 10 more

Share this post


Link to post

 

The error message:

 java.lang.ClassNotFoundException: Didn't find class "androidx.core.content.FileProvider"

Usually means that the jar that contains the class androidx.core.content.FileProvider was not included in your app. This class is in core-1.5.0-rc02.dex.jar, and should appear in the Libraries node, as per the instructions in my earlier reply. This is an example of what it should look like:

 

image.png.61283d7e83365d5d53f6b1620189cf90.png

 

i.e. the package in question does not have a red "x" in the icon

Share this post


Link to post

Not sure if there is a good way to compare list of jar files between two apps, but here is the top of list for both the working app and the non-working app. I did the "revert system files" click on both of these, several times on the one that is not working. I hate to do it, but at this point I think I need to start chopping out functionality until I get the non-working app to work again, and then work forward until I find what is causing the problem. In term of function, the one that is not working allows submission of photos to our server, so it wants to access gallery... the other working app does not try to access the gallery, so that is where I will start. I will report back with questions and progress. Thanks very much.

 

Working app:

image.png.d9df96e7c05993722a0f0997272e3bc6.png

 

NON-working app:

image.png.371897a0583544f5e9d8cbe297303990.png

 

 

 

image.png

Edited by KMarb

Share this post


Link to post

It may help to delete everything in the output folder(s) in question - by default they're Android/Debug (or Release) and Android64/Debug (or Release), then rebuild

Share this post


Link to post

I'm sure this is not appropriate forum behavior, but I want to say that I love you. Maybe I should say I'm feeling a lot of love for you. Online correctness is not my thing.

 

I did as you suggested (deleted the output folders), then I built and installed again and now it is working. You saved me an unknown amount of time. I am truly grateful to you.

  • Like 1

Share this post


Link to post

Bom dia !!

gentileza alguém puder me ajudar, estou com a situação parecida descrita acima , mas não consegui resolver

meu aplicativo estava funcionando a abertura de arquivo pdf no delphi 10.4 , porem ao migrar para o delphi 11 

o mesmo da a seguinte mensagem : Java Type JFileProvider could not be found...

Certo da atenção de vcs eu agradeço... 

Share this post


Link to post
20 minutes ago, Cesar Barbuda said:

Bom dia !!

gentileza alguém puder me ajudar, estou com a situação parecida descrita acima , mas não consegui resolver

meu aplicativo estava funcionando a abertura de arquivo pdf no delphi 10.4 , porem ao migrar para o delphi 11 

o mesmo da a seguinte mensagem : Java Type JFileProvider could not be found...

Certo da atenção de vcs eu agradeço... 

Cesar em inglês por favor:

Good Morning !! Please can someone help me, I have a similar situation described above, but I couldn't solve it, my application was working opening a pdf file in Delphi 10.4, but when migrating to Delphi 11 the following message appears: Java Type JFileProvider could not be found... Thank you for your attention...

 

try:

  • on Project Manager:
    • right-click on "Target Platform"-Configuration-Library"  and "Rever system File to default"

try compile it

Share this post


Link to post
35 minutes ago, programmerdelphi2k said:

Cesar em inglês por favor:

Bom Dia !! Por favor alguém pode me ajudar, estou com uma situação parecida com a descrita acima, porém não consegui resolver, minha aplicação estava funcionando abrindo um arquivo pdf no Delphi 10.4, porém ao migrar para o Delphi 11 aparece a seguinte mensagem: Java Type JFileProvider não pôde ser encontrado... Obrigado pela atenção...

 

tentar:

  • no Gerente de Projetos:
    • clique com o botão direito do mouse em "Target Platform"-Configuration-Library" e "Reverter arquivo do sistema para o padrão"

tente compilar

med the procedure mentioned above, but it continues to show the same message - Java Type JFileProvider could not be found..

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×