Android Question [SOLVED]Incompatible app

incendio

Well-Known Member
Licensed User
Longtime User
Hi guys,

I have android app (build with B4A 12.20) that runs fine on all other phones except on Samsung A55 (Android 14).

On this phone, app couldn't be installed, the error message is something like Incompatible App.

On others Android 14 phones, app runs fine.

Problem is, don't have that phone, phone is in user.

Here are the manifest file
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
AddManifestText(<uses-feature android:name="android.hardware.telephony" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera.flash" android:required="false" />)
AddPermission("android.permission.CAMERA")
AddPermission("android.permission.FLASHLIGHT")  
AddPermission(android.permission.USE_FINGERPRINT)  
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, "@style/br")

SetApplicationAttribute(android:usesCleartextTraffic, "true")

AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
   <files-path name="name" path="shared" />
)

AddPermission(android.permission.REQUEST_INSTALL_PACKAGES)
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)

Conditional symbols (on build configuration) = KVS_ENCRYPTION

Could you give me a hints where might be the problems?
 
Last edited:

virpalacios

Active Member
Licensed User
Longtime User
Hi, I had the A55 Phone Android 14, I already ported some of my android 13 App to Android 14, here is the Manifest from one of my apps. I advice you to create a Simple Hello World program with the Api level indicated in code to check if it working.

Manifest from Android 14 App - A55 Phone:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:allowBackup, "false")
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Core.NetworkClearText)   
'End of default text.
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
I add/edit manifest file with these 2 lines
B4X:
uses-sdk android:minSdkVersion="4" android:targetSdkVersion="29"/>
CreateResourceFromFile(Macro, Core.NetworkClearText)

A simple Hello Word runs fine, but on real app, still got same error.
 
Upvote 0

virpalacios

Active Member
Licensed User
Longtime User
Hi, In the past I have an issue using api 30 and api 33, My app has to be in Api 33, My Manifest works fine in API 30 but not in API 33, It gave me a similar error like your.
Erel ask me to delete all entries in manifest and start adding just the information need. From the past My manifest grow up adding lines that really I don't need anymore. Erel's advice solve my problem and my app run form android 12, 13 and 14 without any change. I think it was a conflictive line in manifest. I could't find Eres anwer now, but as soon I get I going to post the link here.

Best Regard
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Found the problem.

I have to build app from a scratch, add modules one by one until found the problem.

Problem is in library ZBarBarcodeScanner. For unknown reason, with this library, app can't be installed on Samsung A55.

Don't know if this is general issue on Samsung A55 or only affect that user.
 
Upvote 0

BlueVision

Active Member
Licensed User
Longtime User
I'm sorry for posting this in an already closed thread. But the problem seems to be specific to the Samsung A55. I had exactly the same problem with my Samsung A55 running Android 14.
It seems that this scanner library is not compatible with the internal architecture of the A55.

Many thanks to Johan Schoeman, who supported me intensively in solving my problem:

Replace the ZBarBarcodeScanner library with the ZxingBarcodeScanner library. In this case, you don't have to equip your entire app with a new scanner:

- exchange the libraries
- replace the scanner objects in the Designer
- change the definition of the scanner under GLOBALS
- change the programme parts that are responsible for controlling the scanner in the programme itself (scanner on, scanner off, torch)

I was delighted with the quality and functionality of this library. It looks in the programme as if it were the old library. It delivers better ‘positive matches’ almost immediately (which may also have something to do with the camera optics of the A55) and can even switch on the torch automatically.

I'll attach the libraries and the sample programme to this post, Johan certainly won't mind. I'm sure he'll also be pleased to receive a thank you. I'll do the same again at this point. Great job Johan!

The library and the small sample program made by Johan is attached.
 

Attachments

  • ZxingBarcodeScanner.xml
    13.7 KB · Views: 39
  • ZxingBarcodeScanner.jar
    31.8 KB · Views: 44
  • ZxingBCScanner.zip
    5.9 KB · Views: 39
Last edited:
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Thanks for the info. What version of this ZxingBarcodeScanner ? Couldn't see version number in B4A ver 12.2.

I have this library long time ago, don't know if your version is the new one.

At first I use this library, then replaced it with ZBarBarcodeScanner because found out, in my case, ZBarBarcodeScanner scans more quickly and accurate than ZxingBarcodeScanner. Perhaps type of barcode is also a factor that caused that.

And looking for the file size, ZBarBarcodeScanner is about 2,950KB while ZxingBarcodeScanner is only 32KB.
 
Upvote 0

BlueVision

Active Member
Licensed User
Longtime User
Zxing Library version I tested with is 1.03 (attached above)

For my app, I took a lot of code from Johan's example programme and modified it a little. My programme is mainly about scanning Code39, QR and Datamatrix. The good performance of the library in my program is due to optimised settings and less to the library itself, but above all to the camera optics of the A55, which are a class above those of my old smartphone.
The hit rate can be significantly improved by automatically switching on the lamp in the recording programme.
I have not noticed any advantages or disadvantages in terms of speed. But here too I would favour Zxing, simply because the library runs under SDK 34 and can replace ZBar with only minimal changes. There may be slight advantages in focussing with ZBar. But these can be easily cancelled out. As I always have to scan the same type of labels with the app, I have already programmed the scanner accordingly at the start with regard to the zoom, which significantly shortens the focussing phase of the optics. You have to try a little to find the optimum. The reward is an immediate positive match when a code appears in the window.
I have written this little routine for this purpose, as the starting value for focussing cannot be set directly:
Define Zoom-Start:
    'Adjust Zoom to 25:
    If ScanStarted = True Then
        Dim Autozoom = ZXScanPart.CurrentZoomValue As Int
        If Autozoom < 25 Then
            Do While Autozoom <> 25
                ZXScanPart.zoomIn(1)
                Autozoom = ZXScanPart.CurrentZoomValue
            Loop
        End If
        If Autozoom > 25 Then
            Do While Autozoom <> 25
                ZXScanPart.zoomIn(-1)
                Autozoom = ZXScanPart.CurrentZoomValue
            Loop
        End If
    End If
Thanks for all the feedback in this old thread. I was very pleased to receive it. And as I said, the credit in this case goes to my friend Johan and not to me.

PS:
If you scan QR codes and have somehow preselected this option in the barcode types:
For ZBar this is the code type QRCode
For Zxing it is the code type QR_Code .
(I was wondering why the library does not scan QR... )
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…