Android Question SOLVED - Help - Manifest problem - keep finding Permission.Install_packages

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I keep finding this in my AndroidManifest.xml and I don't know where it is coming from.

Stopping my program from being released in Play Store

B4X:
<receiver
                    android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
                    android:enabled="true"
                    android:exported="true"
                    android:permission="android.permission.INSTALL_PACKAGES" >
                    <intent-filter>
                        <action android:name="com.android.vending.INSTALL_REFERRER" />
                    </intent-filter>
        </receiver>

my manifest looks like this
B4X:
'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.basic4ppc.com/forum/showthread.php?p=78136


AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)



SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateHidden)
SetActivityAttribute(Main, android:configChanges, "orientation|keyboard|keyboardHidden|screenSize|uiMode")
'SetActivityAttribute(Main, android:configChanges, "orientation|keyboard|keyboardHidden|screenSize")
'SetActivityAttribute(activityname, android:configChanges,"keyboard|keyboardHidden|navigation")
'The "orientation" value prevents restarts when the screen orientation changes.
'The "screenSize" value also prevents restarts when orientation changes, but only for Android 3.2 (API level 13) and above.
'The "screenLayout" value is necessary to detect changes that can be triggered by devices such as foldable phones and convertible Chromebooks.
'The "keyboardHidden" value prevents restarts when the keyboard availability changes
'The user interface mode has changed — the user has placed the device into a desk or car dock, or the night mode has changed.
'SetActivityAttribute(Main, android:windowSoftInputMode, "adjustNothing")

'SetActivityAttribute(main, android:windowSoftInputMode, adjustNothing|stateHidden)

SetApplicationAttribute(android:largeHeap,"true")  

'---------------------------------------------------------------
'  No longer needed with Adaptive Icons
'---------------------------------------------------------------
SetApplicationAttribute(android:icon, "@drawable/icon")
'---------------------------------------------------------------

SetApplicationAttribute(android:label, "$LABEL$")

'---------------------------------------------------------------------------------------
'                  Android 10 and above does not like these 2 lines.
'=======================================================================================
'   BOTH of the below lines will have to be changed someday
'=======================================================================================
'  Took both lines out 6/6/2021 for SDK 30 testing
'---------------------------------------------------------------------------------------
SetApplicationAttribute(android:requestLegacyExternalStorage, true)
SetApplicationAttribute(android:usesCleartextTraffic, "true")

'SetActivityAttribute(Main, "android:excludeFromRecents", "true")
'---------------------------------------------------------------------------------------


'SetApplicationAttribute(android:resizeableActivity, "true")
'AddApplicationText(<meta-data android:name="android.max_aspect" android:value="10"/>)


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" />
)



SetApplicationAttribute(android:theme, "@style/BBSTheme")


CreateResource(values-v20, theme.xml,
<resources>
    <style
        name="BBSTheme" parent="@android:style/Theme.Material.NoActionBar.Fullscreen">
    </style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
    <style
        name="BBSTheme" parent="@android:style/Theme.Holo.NoActionBar.Fullscreen">
    </style>
</resources>
)



AddApplicationText(
  <activity android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
  android:theme="@android:style/Theme.Translucent.NoTitleBar"
  android:excludeFromRecents="true"
  android:exported="false" />

  <service
  android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
  android:exported="true"
  android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />
)


AddPermission(android.permission.INTERNET)

AddPermission(android.permission.READ_PHONE_STATE)
AddPermission(android.permission.READ_PHONE_NUMBERS)

'AddPermission(android.permission.READ_SMS)

AddPermission(android.permission.VIBRATE)

AddPermission(android.permission.READ_EXTERNAL_STORAGE)
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)


AddManifestText(<uses-feature android:name="android.hardware.telephony" android:required="false"/>)

CreateResourceFromFile(Macro, GooglePlayBilling.GooglePlayBilling)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)

''------------------------------------------------------------------------------------------------
''  Just Added 11/1/2020
''------------------------------------------------------------------------------------------------
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)

AndroidManifest.xml looks like this
B4X:
<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.BOBs.BBS"
    android:versionCode="8036"
    android:versionName="B*Bs-v8.036"
    android:installLocation="internalOnly">
   
    <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31"/>
    <supports-screens android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:anyDensity="true"/>
    <uses-feature android:name="android.hardware.telephony" android:required="false"/>
    <permission android:name="com.BOBs.BBS.permission.C2D_MESSAGE"
      android:protectionLevel="signature" />
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="com.android.vending.BILLING"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.READ_PHONE_NUMBERS"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
    <uses-permission android:name="com.BOBs.BBS.permission.C2D_MESSAGE"/>
    <uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE"/>
    <application
        android:name="androidx.multidex.MultiDexApplication"
        android:largeHeap="true"
        android:icon="@drawable/icon"
        android:label="B*Bs"
        android:requestLegacyExternalStorage="true"
        android:usesCleartextTraffic="true"
        android:theme="@style/BBSTheme">
       
        <provider
          android:name="androidx.core.content.FileProvider"
          android:authorities="com.BOBs.BBS.provider"
          android:exported="false"
          android:grantUriPermissions="true">
          <meta-data
          android:name="android.support.FILE_PROVIDER_PATHS"
          android:resource="@xml/provider_paths"/>
          </provider>
        <activity android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
          android:theme="@android:style/Theme.Translucent.NoTitleBar"
          android:excludeFromRecents="true"
          android:exported="false" />
       
          <service
          android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
          android:exported="true"
          android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />
        <meta-data
                    android:name="com.google.android.play.billingclient.version"
                    android:value="5.0.0" />
       
                <activity
                    android:name="com.android.billingclient.api.ProxyBillingActivity"
                    android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
                    android:exported="false"
                    android:theme="@android:style/Theme.Translucent.NoTitleBar" />
        <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" />
        <receiver
                    android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
                    android:enabled="true"
                    android:exported="false" >
                </receiver>
       
          <service
                    android:name="com.google.android.gms.measurement.AppMeasurementService"
                    android:enabled="true"
                    android:exported="false" />
                   
         <receiver
                    android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
                    android:enabled="true"
                    android:exported="true"
                    android:permission="android.permission.INSTALL_PACKAGES" >
                    <intent-filter>
                        <action android:name="com.android.vending.INSTALL_REFERRER" />
                    </intent-filter>
        </receiver>
        <service
                    android:name="com.google.android.gms.measurement.AppMeasurementJobService"
                    android:enabled="true"
                    android:exported="false"
                    android:permission="android.permission.BIND_JOB_SERVICE" />
       
         <service android:name="com.google.firebase.components.ComponentDiscoveryService"  android:directBootAware="true" >
                    <meta-data
                        android:name="com.google.firebase.components:com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar"
                        android:value="com.google.firebase.components.ComponentRegistrar" />
                     <meta-data
                        android:name="com.google.firebase.components:com.google.firebase.iid.Registrar"
                        android:value="com.google.firebase.components.ComponentRegistrar" />
                     <meta-data
                        android:name="com.google.firebase.components:com.google.firebase.auth.FirebaseAuthRegistrar"
                        android:value="com.google.firebase.components.ComponentRegistrar" />
                     <meta-data
                        android:name="com.google.firebase.components:com.google.firebase.storage.StorageRegistrar"
                        android:value="com.google.firebase.components.ComponentRegistrar" />
                    <meta-data
                        android:name="com.google.firebase.components:com.google.firebase.firestore.FirestoreRegistrar"
                        android:value="com.google.firebase.components.ComponentRegistrar"/>
       
                    <meta-data
                            android:name="com.google.firebase.components:com.google.firebase.database.DatabaseRegistrar"
                            android:value="com.google.firebase.components.ComponentRegistrar"/>
                        <meta-data
                        android:name="com.google.firebase.components:com.google.firebase.messaging.FirebaseMessagingRegistrar"
                        android:value="com.google.firebase.components.ComponentRegistrar" />
                     <meta-data
                        android:name="com.google.firebase.components:com.google.firebase.installations.FirebaseInstallationsRegistrar"
                        android:value="com.google.firebase.components.ComponentRegistrar" />
                      <meta-data
                        android:name="com.google.firebase.components:com.google.firebase.crashlytics.CrashlyticsRegistrar"
                        android:value="com.google.firebase.components.ComponentRegistrar" />
                      
        </service>
           <provider
          android:authorities="com.BOBs.BBS.firebaseinitprovider"
          android:name="com.google.firebase.provider.FirebaseInitProvider"
          android:exported="false"
           android:directBootAware="true"
          android:initOrder="100" />
         
           <receiver
          android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
          android:exported="true"
          android:permission="com.google.android.c2dm.permission.SEND" >
          <intent-filter>
          <action android:name="com.google.android.c2dm.intent.RECEIVE" />
          <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
          <category android:name="com.BOBs.BBS" />
          </intent-filter>
          </receiver>
            <receiver
          android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
          android:exported="false" />
       
       
          <service
          android:name="com.google.firebase.iid.FirebaseInstanceIdService"
          android:exported="true">
          <intent-filter android:priority="-500">
          <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
          </intent-filter>
          </service>
        <activity
                    android:name="com.google.firebase.auth.internal.FederatedSignInActivity"
                    android:excludeFromRecents="true"
                    android:exported="true"
                   android:launchMode="singleTask"
                    android:permission="com.google.firebase.auth.api.gms.permission.LAUNCH_FEDERATED_SIGN_IN"
                    android:theme="@android:style/Theme.Translucent.NoTitleBar" />
       
                    <activity
                    android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
                    android:excludeFromRecents="true"
                    android:exported="false"
                    android:theme="@android:style/Theme.Translucent.NoTitleBar" />
       
                <!--
                    Service handling Google Sign-In user revocation. For apps that do not integrate with
                    Google Sign-In, this service will never be started.
                -->
                <service
                    android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
                    android:exported="true"
                    android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />
        <activity
            android:windowSoftInputMode="adjustResize|stateHidden"
            android:launchMode="singleTop"
            android:name=".main"
            android:label="B*Bs"
            android:screenOrientation="unspecified"
            android:exported="true"
            android:configChanges="orientation|keyboard|keyboardHidden|screenSize|uiMode">
            <intent-filter>
               <action android:name="android.intent.action.MAIN" />
               <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
           
        </activity>
        <service
            android:name=".starter"
            android:exported="true">
        </service>
        <receiver
            android:name=".starter$starter_BR"
            android:exported="true">
        </receiver>
        <service
            android:name=".httputils2service"
            android:exported="true">
        </service>
        <receiver
            android:name=".httputils2service$httputils2service_BR"
            android:exported="true">
        </receiver>
    </application>
</manifest>

Tried Clean project (but doesn't delete AndroidManifest.xml - so I delete it manually but it get created the same way)

I am thinging it must be some library I am using
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
It turns out that that this statement in my manifest
B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
is causing the
B4X:
 android:permission="android.permission.INSTALL_PACKAGES"
to be added to my AndroidManifest.xml

Is there anyway to stop this?
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Well I made a little test program that uses the same manifest I use and the only line in the manifest that seems to do this it this line

B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)   'Comment/Uncomment this line to cause INSTALL_PACKAGES

Attaching program

NOTE: I've added my json file to the zip file (not sure if I should be putting that in there, but couldn't compile without it)
 

Attachments

  • TestManifest.zip
    12.8 KB · Views: 27
  • AndroidManifest-Line NOT Commented out.xml
    9.1 KB · Views: 25
  • AndroidManifest-line Commented Out.xml
    4.4 KB · Views: 29
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Well, I removed any ability to download and install a APK from my app and they still flagged
B4X:
Issue details
Summary
Status
[LIST]
[*] error Update rejected
[*]Previous version available on Google Play
[/LIST]
Rejected
Oct 24, 2022, 3:58 AM

Violation
Request Install Packages Permission: Permission use is not directly related to your app's core purpose.

Details
We found that your app is not compliant with how REQUEST_INSTALL_PACKAGES permission is allowed to be used. Specifically, the use of the permission is not directly related to the core purpose of the app.

I am sure there is nothing in my code cause it. Have scanned everything looking for it.

Should I just appeal and state that what they are seeing is used by Firebase Analytics?

OR can this be removed from Firebase Analytics to see if that lets my app be released?

Maybe I am caught in that I did have code to do this and now they are seeing this as still being the same thing.
 
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
@Erel
This part do not exist in native implementation, I can't find this in "merged manifest":
B4X:
android:permission="android.permission.INSTALL_PACKAGES"
I'm using (currently latest versions):
B4X:
com.google.firebase:firebase-analytics:21.2.0
com.google.firebase:firebase-crashlytics:18.3.1
Probably removed in last few months.
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Where can I find those version?

So should I change my
B4X:
#additionalJar                    : com.google.firebase:firebase-installations
to this
B4X:
 #additionalJar                    : com.google.firebase:firebase-analytics:21.2.0
 #additionalJar                    : com.google.firebase:firebase-crashlytics:18.3.1

These are my library versions:
1666808133130.png
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'm working on updating AndroidX and Firebase sdks. It will be available soon.

For now, remove:
B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)

And add:
B4X:
CreateResourceFromFile("google-services", "google-services.json")
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.WAKE_LOCK)
AddPermission(com.google.android.c2dm.permission.RECEIVE)
AddPermission(${applicationId}.permission.C2D_MESSAGE)
AddPermission(com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE)
AddManifestText( <permission android:name="${applicationId}.permission.C2D_MESSAGE"
  android:protectionLevel="signature" />)
AddApplicationText(
 <receiver
            android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
            android:enabled="true"
            android:exported="false" >
        </receiver>

  <service
            android:name="com.google.android.gms.measurement.AppMeasurementService"
            android:enabled="true"
            android:exported="false" />
            
 <receiver
            android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
            android:enabled="true"
            android:exported="true"  >
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
</receiver>
<service
            android:name="com.google.android.gms.measurement.AppMeasurementJobService"
            android:enabled="true"
            android:exported="false"
            android:permission="android.permission.BIND_JOB_SERVICE" />

 <service android:name="com.google.firebase.components.ComponentDiscoveryService"  android:directBootAware="true" >
            <meta-data
                android:name="com.google.firebase.components:com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
             <meta-data
                android:name="com.google.firebase.components:com.google.firebase.iid.Registrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
             <meta-data
                android:name="com.google.firebase.components:com.google.firebase.auth.FirebaseAuthRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
             <meta-data
                android:name="com.google.firebase.components:com.google.firebase.storage.StorageRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
            <meta-data 
                android:name="com.google.firebase.components:com.google.firebase.firestore.FirestoreRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar"/>

            <meta-data
                    android:name="com.google.firebase.components:com.google.firebase.database.DatabaseRegistrar"
                    android:value="com.google.firebase.components.ComponentRegistrar"/>
                <meta-data
                android:name="com.google.firebase.components:com.google.firebase.messaging.FirebaseMessagingRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
             <meta-data
                android:name="com.google.firebase.components:com.google.firebase.installations.FirebaseInstallationsRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
              <meta-data
                android:name="com.google.firebase.components:com.google.firebase.crashlytics.CrashlyticsRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />
               
</service>
   <provider
  android:authorities="${applicationId}.firebaseinitprovider"
  android:name="com.google.firebase.provider.FirebaseInitProvider"
  android:exported="false"
   android:directBootAware="true"
  android:initOrder="100" />
  
   <receiver
  android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
  android:exported="true"
  android:permission="com.google.android.c2dm.permission.SEND" >
  <intent-filter>
  <action android:name="com.google.android.c2dm.intent.RECEIVE" />
  <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
  <category android:name="${applicationId}" />
  </intent-filter>
  </receiver>
    <receiver
  android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
  android:exported="false" />


  <service
  android:name="com.google.firebase.iid.FirebaseInstanceIdService"
  android:exported="true">
  <intent-filter android:priority="-500">
  <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
  </intent-filter>
  </service>
)
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
In my real app I get this error, but in the test manifest app I created it works fine.

How do I figure out where the path error is

Copied into my manifest now get this error
B4X:
B4A Version: 11.80
Parsing code.    (1.19s)
    Java Version: 14
Building folders structure.    (0.15s)
Running custom action.    (0.05s)
Running custom action.    (0.17s)
Compiling code.    (0.68s)
Compiling layouts code.    (0.02s)
Organizing libraries.    Error
Illegal characters in path.


TURNS out this is not related to the changes you gave me. But what is causing it



FIGURED IT OUT
I had added a comment (single quote) to end of this line
B4X:
    #additionalJar                    : com.google.firebase:firebase-installations        '

I guess not comments on those #additionalJar lines.

Sorry about this will continue to test and report back
 

Attachments

  • AndroidManifest.xml
    9.6 KB · Views: 30
Last edited:
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Well it looks like this is going to fix the problems I have had.
Cannot say for 100% - Google has not actually released a new version for me yet.

Now they are complaining that a VERY Old version (3 years old) in a closed testing track needs to be fixed
WOW - Really I could not even release this version if I wanted to. Because of the version number
And as I just noticed there is just NO way of deleting this version - I actually have to release a new version to this then move it up the line.
WHAT a pain in the butt.

Will close this thread when they actually release something for me. But looks like it is now moving in the right direction

EREL - Thanks so much for this fix.
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Well they finally released my app this morning (WOW - 7 days)

I still am not sure if I needed this fix, simply because they kept hamming me about Permission.Install_packages but when I finally got someone to actually reply to an email (after I had already fixed the production version) I found that they were talking about a version in the test area that was 3 years old.

But everything works with this fix and GOD, oops I mean Google is happy.
 
Upvote 0
Top