Android Question [SOLVED] - Playstore ABB - Error: Found multiple <meta-data> elements for key 'com.google.android.gms.version', expected at most one.

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hello

I get Error: Found multiple <meta-data> elements for key 'com.google.android.gms.version', expected at most one. this when try to upload a new abb file to the playstore.

Main
B4X:
#MultiDex: true
#AdditionalJar: android-support-v4
#AdditionalJar: com.google.android.gms:play-services-base
#AdditionalJar: com.android.support:support-compat

#Extends: android.support.v7.app.AppCompatActivity
#AdditionalRes: ..\resource

 
' // Original Islesystems key
#SignKeyFile: C:\B4X\Keys\Android\vitllink.keystore
#SignKeyPassword: islekram71

#CustomBuildAction: 1, c:\windows\system32\cmd.exe,/c java -jar C:\Java\B4XLocalizator.jar ..\localization\strings.xlsx ..\Files\strings.db

Manifest
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.b4x.com/forum/showthread.php?p=78136

' // 2022.05.17 - EX710SYSTEM only supports upto SDK 29
#if EX710SYSTEM
    AddManifestText(
     <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="29"/>
     <supports-screens android:largeScreens="true"
         android:normalScreens="true"
         android:smallScreens="true"
        android:anyDensity="true"/>)
#else if PLAYSTORE
    AddManifestText(
         <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="31"/>
         <supports-screens android:largeScreens="true"
             android:normalScreens="true"
             android:smallScreens="true"
            android:anyDensity="true"/>)

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

#End if

 ' // Mark as SYSTEM APP
#if PLATFORM
    SetManifestAttribute(android:sharedUserId, "android.uid.system")
#End if

' // Needed for SSL error fix
AddApplicationText(<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>)

' // https://developer.android.com/guide/topics/manifest/uses-feature-element#hw-features
AddManifestText(<uses-feature android:name="android.hardware.bluetooth"/>)
AddManifestText(<uses-feature android:name="android.hardware.bluetooth_le"/>)
AddManifestText(<uses-feature android:name="android.hardware.location.gps"/>)
AddManifestText(<uses-feature android:name="android.hardware.camera"/>)
AddManifestText(<uses-feature android:name="android.hardware.camera.autofocus"/>)
AddManifestText(<uses-feature android:name="android.hardware.camera.flash" />)

SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")

' // 2022.12.05 - https://www.b4x.com/android/forum/threads/service-not-running-on-sleepmode.98821/#post-622668
'SetActivityAttribute(main, android:showWhenLocked, "true")
'SetActivityAttribute(main, android:turnScreenOn, "true")
'SetActivityAttribute(tpa_running, android:showWhenLocked, "true")
'SetActivityAttribute(tpa_running, android:turnScreenOn, "true")


' // ACTIVITIES
SetActivityAttribute(main, android:launchMode, "singleTask")
SetActivityAttribute(main, android:clearTaskOnLaunch, "true")
' // Keyboards
SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateHidden)
SetActivityAttribute(tpa_create,android:windowSoftInputMode, adjustResize|stateHidden)
SetActivityAttribute(tpa_running,android:windowSoftInputMode, adjustPan|stateHidden)

SetActivityAttribute(Settings, android:screenOrientation, "unspecified")
SetActivityAttribute(NewAppAvailable, android:theme, "@android:style/Theme.Translucent.NoTitleBar")
' // Background GPS/BLE
SetServiceAttribute(svc_ble, android:foregroundServiceType, "location")
SetServiceAttribute(svc_itag, android:foregroundServiceType, "location")
SetServiceAttribute(svc_gps, android:foregroundServiceType, "location")

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

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


AddApplicationText(
                    <meta-data android:name="app_key_sos_data"
                               android:value="4ac9e6c316effb7be10a791055ef6c4c348b0ff76c3f51ede05f60e8a0896a90" />     
                                    
                    <meta-data android:name="app_key_sos_intent"
                               android:value="com.is.vitllinkSOS" />     
                                               
                    <meta-data android:name="app_key_sos_priority"
                                android:value="55" />         

                    <receiver android:name=".svc_intents$svc_intents_BR"
                              android:exported="true" >
                              <intent-filter>
                                      <action android:name="com.sonim.intent.action.SOS_KEY_DOWN" />
                                      <action android:name="com.sonim.intent.action.SOS_KEY_UP" />
                              </intent-filter>
                    </receiver>
                )
' // Needed for SSL error fix
AddApplicationText(
                   <meta-data android:name="com.google.android.gms.version"
                    android:value="[USER=21225]@Integer[/USER]/google_play_services_version"/>
                )

CreateResource(values, colors.xml,
                <resources>
                    <color name="actionbar">#ffC8001F</color>
                       <color name="statusbar">#ffC8001F</color>
                       <color name="navigationBar">#ffC8001F</color>
                </resources>
                )
CreateResource(values, themes.xml,
                <resources>
                    <style name="MyAppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
                        <item name="android:statusBarColor">@color/navigationBar</item>
                        <item name="android:navigationBarColor">@color/navigationBar</item>
                        <item name="windowNoTitle">true</item>
                        <item name="windowActionBar">false</item>
                        <item name="windowActionModeOverlay">true</item>     
                    </style> 
                </resources>
                )


CreateResource(xml, provider_paths,
                <paths>
                   <external-files-path name="name" path="" />
                   <files-path name="name" path="" />
                   <files-path name="name" path="shared" />
                </paths>
                )

#if not(PLATFORM) or not(EX710SYSTEM) or not(S10SYSTEM)
    ' // vitllink SOS hash key - Sonim Only
    AddManifestText(<meta-data android:name="app_key_sos_data" android:value="4ac9e6c316effb7be10a791055ef6c4c348b0ff76c3f51ede05f60e8a0896a90" />)
    AddManifestText(<meta-data android:name="app_key_sos_intent" android:value="com.is.vitllinkSOS" />)     
    AddManifestText(<meta-data android:name="app_key_sos_priority" android:value="55" />)
    ' // ECOM : https://support.ecom-ex.com/ecomfaq/item?id=1125&catid=303
    AddApplicationText(
    <meta-data android:name="ecom.device.key" android:value="alert" />
    <receiver
        android:name=".svc_intents$svc_intents_BR"
        android:enabled="true"
        android:exported="true">
        <intent-filter>
            <action android:name="com.ecom.intent.action.SOS_BUTTON_DOWN" />
            <action android:name="com.ecom.intent.action.SOS_BUTTON_UP" />    
        </intent-filter>
    </receiver>
    )
#end if

'Overlay permissions
AddPermission(android.permission.SYSTEM_ALERT_WINDOW)
' // Location permissions
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission(android.permission.ACCESS_COARSE_UPDATES)
AddPermission(android.permission.ACCESS_BACKGROUND_LOCATION)
AddPermission(android.permission.ACCESS_FINE_LOCATION)
' // net
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.ACCESS_WIFI_STATE)
' // bt
AddPermission(android.permission.BLUETOOTH)
AddPermission(android.permission.BLUETOOTH_SCAN)
AddPermission(android.permission.BLUETOOTH_CONNECT)
AddPermission(android.permission.BLUETOOTH_ADMIN)

AddPermission(android.permission.CAMERA)
AddPermission(android.permission.CHANGE_NETWORK_STATE)
AddPermission(android.permission.CHANGE_WIFI_STATE)
AddPermission(android.permission.FLASHLIGHT)
AddPermission(android.permission.INTERNET)

AddPermission(android.permission.MODIFY_PHONE_STATE)
AddPermission(android.permission.MODIFY_AUDIO_SETTINGS)

AddPermission(android.permission.RECEIVE_BOOT_COMPLETED)
AddPermission(android.permission.UPDATE_DEVICE_STATS)
AddPermission(android.permission.VIBRATE)
AddPermission(android.permission.WAKE_LOCK)
' // MLWifi
'AddPermission(android.permission.WRITE_SETTINGS)
' // SMS
' // https://legalitgroup.com/en/sms-call-log-permissions-receive-approval-from-google-play-for-sensitive-permissions/
AddPermission(android.permission.SEND_SMS)

#if not(PLAYSTORE) 
    ' // app updater
    AddPermission(android.permission.REQUEST_INSTALL_PACKAGES)
    AddPermission(android.permission.INSTALL_PACKAGES)

    ' // calls
    AddPermission(android.permission.PROCESS_OUTGOING_CALLS) 
    AddPermission(android.permission.ANSWER_PHONE_CALLS)

    ' // SMS
    AddPermission(android.permission.RECEIVE_SMS)
    AddReceiverText(svc_sms_interceptor,
                    <intent-filter android:priority="2147483647">
                    <action android:name="android.provider.Telephony.SMS_RECEIVED" />
                    </intent-filter>)
#end if
' // Call
AddPermission(android.permission.CALL_PHONE)
AddPermission(android.permission.CALL_PRIVILEGED)
AddPermission(android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS)


' // 2019.10.21 - Allow home to reguest pincode
AddActivityText(svc_retrievepin, <intent-filter>
   <action android:name="com.is.vitllinkSOS.PINCODE" />
   <category android:name="android.intent.category.DEFAULT" />
</intent-filter>)

AddActivityText(svc_app_running, <intent-filter>
   <action android:name="com.islesystems.APP_RUNNING" />
   <category android:name="android.intent.category.DEFAULT" />
</intent-filter>)



AddReceiverText(svc_shutdown, <intent-filter> <action android:name="android.intent.action.ACTION_SHUTDOWN" /></intent-filter>)
'AddReceiverText(svc_intents, <intent-filter> <action android:name="android.intent.action.PHONE_STATE"/></intent-filter>)
' // intents from ToughShield Smartphone
AddReceiverText(svc_intents, <intent-filter> <action android:name="com.BrighterWirelessMain.Main.SOSDown"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="com.BrighterWirelessMain.Main.SOSUp"/></intent-filter>)
' // Toughshield R500PLUS
AddReceiverText(svc_intents, <intent-filter> <action android:name="com.Toughshield.Main.SOSDown"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="com.Toughshield.Main.SOSUp"/></intent-filter>)
' // MX2
AddReceiverText(svc_intents, <intent-filter> <action android:name="android.intent.action.ENTER_ONEKEYSOS"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="android.intent.action.EXIT_ONEKEYSOS"/></intent-filter>)
' // CHINA PHONE
AddReceiverText(svc_intents, <intent-filter> <action android:name="com.android.action.F3_SOS"/></intent-filter>) 

' // V710
AddReceiverText(svc_intents, <intent-filter> <action android:name="shmaker.android.intent.action.KEYEVENT_DOWN_131"/></intent-filter>)     
AddReceiverText(svc_intents, <intent-filter> <action android:name="shmaker.android.intent.action.KEYEVENT_UP_131"/></intent-filter>)     
AddReceiverText(svc_intents, <intent-filter> <action android:name="shmaker.android.intent.action.KEYEVENT_DOWN_132"/></intent-filter>)     
AddReceiverText(svc_intents, <intent-filter> <action android:name="shmaker.android.intent.action.KEYEVENT_UP_132"/></intent-filter>)     
AddReceiverText(svc_intents, <intent-filter> <action android:name="shmaker.android.intent.action.KEYEVENT_DOWN_133"/></intent-filter>)     
AddReceiverText(svc_intents, <intent-filter> <action android:name="shmaker.android.intent.action.KEYEVENT_UP_133"/></intent-filter>)     
AddReceiverText(svc_intents, <intent-filter> <action android:name="shmaker.android.intent.action.KEYEVENT_DOWN_134"/></intent-filter>)     
AddReceiverText(svc_intents, <intent-filter> <action android:name="shmaker.android.intent.action.KEYEVENT_UP_134"/></intent-filter>)     
AddReceiverText(svc_intents, <intent-filter> <action android:name="shmaker.android.intent.action.SCANER_KEYEVENT_DOWN"/></intent-filter>)     
AddReceiverText(svc_intents, <intent-filter> <action android:name="shmaker.android.intent.action.SCANER_KEYEVENT_UP"/></intent-filter>)     
 
' // F22F25F887
AddReceiverText(svc_intents, <intent-filter> <action android:name="android.intent.action.SOS.now"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="android.intent.action.sos.down"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="android.intent.action.sos.up"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="android.intent.action.sos"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="android.intent.action.sos_ticket"/></intent-filter>)

' // M31 - Android 10
AddReceiverText(br_receiver, <intent-filter> <action android:name="com.android.intent.SOS.down"/></intent-filter>)         
AddReceiverText(br_receiver, <intent-filter> <action android:name="com.android.intent.SOS.up"/></intent-filter>)
AddReceiverText(br_receiver, <intent-filter> <action android:name="android.intent.action.SOS.up"/></intent-filter>)
AddReceiverText(br_receiver, <intent-filter> <action android:name="android.intent.action.SOS.down"/></intent-filter>)
' // Generic
AddReceiverText(svc_intents, <intent-filter> <action android:name="android.intent.action.SOS_BUTTON"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="android.intent.action.PTT.down"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="android.intent.action.PTT.up"/></intent-filter>)
' // RugGear
AddReceiverText(svc_intents, <intent-filter> <action android:name="android.intent.action.CALL_FOR_HELP"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="com.tdc.callforhelp.CallForHelpService"/></intent-filter>)
' // media key down/up
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.MEDIA_KEYDOWN"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.MEDIA_KEYUP"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.MEDIA_HEADPLUGIN"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.MEDIA_HEADPLUGOUT"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.MEDIA_SCREENON"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.MEDIA_SCREENOFF"/></intent-filter>)
' // intents from SOS widget
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.SOS_APPSHOW"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.SOS_APPTERMINATE"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.SOS_APPSTATE"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.WIDGET_LWON"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.WIDGET_LWOFF"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.WIDGET_MDON"/></intent-filter>)
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.WIDGET_MDOFF"/></intent-filter>)
' // selfintent as we interrupted by an non human entity whist try to set off an alert
AddReceiverText(svc_intents, <intent-filter> <action android:name="vitllink.action.SOS_KEEPALIVE"/></intent-filter>)
' // doro phone
AddReceiverText(svc_intents, <intent-filter> <action android:name="com.doro.partner.action.ASSISTANCE_BUTTON_ACTIVATED"/></intent-filter>)


CreateResource(values-v20, theme.xml,
<resources>
    <style
        name="LightTheme" parent="@android:style/Theme.Material.Light">
    </style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
    <style
        name="LightTheme" parent="@android:style/Theme.Holo.Light">
    </style>
</resources>
)
CreateResourceFromFile(Macro, Core.NetworkClearText)
'End of default text.

Regards

John
 
Solution
Wow! That's some manifest entries. You do appear to have duplicate definitions
B4X:
' // Needed for SSL error fix
AddApplicationText(<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>)

...

' // Needed for SSL error fix
AddApplicationText(
                   <meta-data android:name="com.google.android.gms.version"
                    android:value="[USER=21225]@Integer[/USER]/google_play_services_version"/>
                )

agraham

Expert
Licensed User
Longtime User
Wow! That's some manifest entries. You do appear to have duplicate definitions
B4X:
' // Needed for SSL error fix
AddApplicationText(<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>)

...

' // Needed for SSL error fix
AddApplicationText(
                   <meta-data android:name="com.google.android.gms.version"
                    android:value="[USER=21225]@Integer[/USER]/google_play_services_version"/>
                )
 
Upvote 0
Solution
Top