Android Question App not installed as App isn't compatible with your phone on Pixel 7

GeoffT660

Active Member
Licensed User
Longtime User
I have my app installed on many different devices but receive the message "App not installed as App isn't compatible with your phone" when I try to install on a Pixel 7. This happens whether I am using B4a Bridge or installing from the APK. Any thoughts would be greatly appreciated.
 

JohnC

Expert
Licensed User
Longtime User
Please post the contents of the manifest file for your app.
 
Upvote 0

GeoffT660

Active Member
Licensed User
Longtime User
Hi John!

AddApplicationText(
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="Removed API Key for post"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@Integer/google_play_services_version"/>
)
AddManifestText(
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="31"/>
<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" />)
AddManifestText(<uses-feature android:name="android.hardware.location.gps"/>)
'AddPermission("android.permission.ACCESS_COARSE_LOCATION")
AddPermission("android.permission.INTERNET")
AddPermission("android.permission.ACCESS_FINE_LOCATION")
AddPermission(android.permission.RECORD_AUDIO)
AddPermission("android.permission.WAKE_LOCK")
AddPermission("android.permission.DEVICE_POWER")
'AddPermission("android.permission.ACCESS_COARSE_UPDATES")
AddPermission("android.permission.READ_PHONE_STATE")
AddPermission("android.permission.VIBRATE")
AddPermission(android.permission.USE_FINGERPRINT)
AddPermission(android.permission.SEND_SMS)
AddPermission(android.permission.PROCESS_OUTGOING_CALLS)
'AddPermission(android.permission.READ_EXTERNAL_STORAGE)
'AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
'AddPermission("android.permission.CAMERA")
'AddPermission("android.permission.FLASHLIGHT")
'AddPermission("android.hardware.camera")

SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:largeHeap, "true")

'End of default text.
''android:name="com.google.android.geo.API_KEY"
''android:name="com.google.android.geo.API_KEY"
SetApplicationAttribute(android:usesCleartextTraffic, "true")
AddManifestText(<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="31" />
)

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)

CreateResourceFromFile(Macro, JhsIceZxing1.CaturePortrait)
'************ Google Play Services Base ************
AddApplicationText(
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:exported="false"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@Integer/google_play_services_version" />
)
SetActivityAttribute(frmVideo, android:screenOrientation, "unspecified")
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Some questions:
1) When you get the error, is it when you "first" try to install the APK on the device or doing an upgrade?
2) What is the SDK level of the Pixel 7
3) These parts of the manifest seem a little weird to me:

AddManifestText(<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="31" />
)
(the maxSdkVersion=31 seems odd - I thought the max was like 18)
--------------------------------------
AddPermission(android.permission.REQUEST_INSTALL_PACKAGES)
(This post has a note about GetInstalledPackages: https://www.b4x.com/android/forum/threads/android-jar-targetsdkversion-minsdkversion.87610/
- 31 - PackageManager.GetInstalledPackages no longer works without specific declarations in the manifest editor: https://stackoverflow.com/questions/67189934/how-to-get-a-list-of-installed-apps-in-android-11)
--------------------------------------
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" />)
AddManifestText(<uses-feature android:name="android.hardware.location.gps"/>)
-------------------------------------
AddManifestText(
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="31"/>
<supports-screens android:largeScreens="true"
(having the Write_External_storage in there seems odd)

So, try removing the sections of the manifest that seem odd to me and see if at least the orginal error goes away - you might get a new error, but at least it might help narrow down where the original error is coming from.
 
Upvote 0

GeoffT660

Active Member
Licensed User
Longtime User
1) Yes. I get the message when I try to install from APK or use b4a bridge to install.
2) It's Android version 13 but where would I find the SDK Level?
3) I did start out with but was messing around

<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="26"/>
and
AddManifestText(<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
)

My Manifest now looks like this but I still get the error.

AddApplicationText(
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="Replaced Value"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@Integer/google_play_services_version"/>
)
AddManifestText(
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)

'AddPermission("android.permission.ACCESS_COARSE_LOCATION")
AddPermission("android.permission.INTERNET")
AddPermission("android.permission.ACCESS_FINE_LOCATION")
AddPermission(android.permission.RECORD_AUDIO)
AddPermission("android.permission.WAKE_LOCK")
AddPermission("android.permission.DEVICE_POWER")
'AddPermission("android.permission.ACCESS_COARSE_UPDATES")
AddPermission("android.permission.READ_PHONE_STATE")
AddPermission("android.permission.VIBRATE")
AddPermission(android.permission.USE_FINGERPRINT)
AddPermission(android.permission.SEND_SMS)
AddPermission(android.permission.PROCESS_OUTGOING_CALLS)
'AddPermission(android.permission.READ_EXTERNAL_STORAGE)
'AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
'AddPermission("android.permission.CAMERA")
'AddPermission("android.permission.FLASHLIGHT")
'AddPermission("android.hardware.camera")

SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:largeHeap, "true")

'End of default text.
''android:name="com.google.android.geo.API_KEY"
''android:name="com.google.android.geo.API_KEY"
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" />

)

CreateResourceFromFile(Macro, JhsIceZxing1.CaturePortrait)
'************ Google Play Services Base ************
AddApplicationText(
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:exported="false"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@Integer/google_play_services_version" />
)
SetActivityAttribute(frmVideo, android:screenOrientation, "unspecified")
'************ Google Play Services Base (end) ************
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Try each one in sequence and test to see if the error changes with any one of the below changes:

1) Try disabling Play Protect in the settings of the play store app

2) Removing this line from the manifest:

CreateResourceFromFile(Macro, JhsIceZxing1.CaturePortrait)

3) Remove these lines from the manifest:
''android:name="com.google.android.geo.API_KEY"
''android:name="com.google.android.geo.API_KEY"

4) Remove (comment it out) all the AddPermission lines

5) Changing this part in the manifest:
B4X:
AddManifestText(
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
To this (remove the write_external_storage line):
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
 
Upvote 0

GeoffT660

Active Member
Licensed User
Longtime User
No Luck. I disabled PlayProtect, made the changes and still get the message. I then removed all line from the manifest and still got the same exact message.
 
Upvote 0

GeoffT660

Active Member
Licensed User
Longtime User
I was able to install a much simpler b4a app on the Pixel so it must have something to do with my app. I also tried copying the manifest from the app that worked to my app and it still failed with the same message. I guess I will now need to deconstruct my app to see where the issue might be. Never had an issue on any other device.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Perhaps one of the libraries you're using? Try removing them one by one to see if that helps.

- Colin.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Some last things to try...

1) Right before you try to install the app, unckeck the "Filter" checkbox on the "Log" tab in the B4A IDE - this will start displaying all the raw log events.

Then launch the app, and after you see the error, disconnect the device (wifi/usb) from the IDE so that it will stop recording log events.

Right click in the log window and select "Copy all to clipboard" and paste into a notepad document.

Then try to find the lines in the log file (towards the end) that might give us a clue on whats causing the error.

2) The other question I had is when you turned on "Developer Mode" on the phone, did you change any of the developer settings (other then USB debug)? If you did, maybe that's possibly causing this error"
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Did the raw logs give up any clues?
 
Upvote 0

GeoffT660

Active Member
Licensed User
Longtime User
I have determined that the SQLCipher library was the previous version 1.50 and was causing the installation issue. After updating the library I now find it will no longer read the my db and I get the error:

net.sqlcipher.database.SQLiteException: file is not a database: , while compiling: select count(*) from sqlite_master;

The post does for the new library 1.60 does state: Not compatible by default with databases created with older versions.

I will create a new post but does anyone know how to update my existing db to work with SQLCipher v4.00?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The post does for the new library 1.60 does state: Not compatible by default with databases created with older versions.

I will create a new post but does anyone know how to update my existing db to work with SQLCipher v4.00?
Probably the answer is

You have two options:
- Use the desktop version of SQLCipher. It may require purchasing a license.
- Create a program that reads the data from the existing databases and writes it to a password protected database.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…