2

Trying to install application via ADB:

adb -s emulator-5554 install -r  E:\D\android\MQTT\app\debug\app-debug.apk

Got error:

Performing Streamed Install
adb: failed to install E:\D\android\MQTT\app\debug\app-debug.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl630168997.tmp/base.apk (at Binary XML file line #26): <meta-data> requires an android:value or android:resource attribute]

AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.kpv.mqtt">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <application
        android:name=".VTS"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <meta-data
            android:name="com.google.android.actions" />

        <activity
            android:name=".helpers.AddDeviceActivity"
            android:label="@string/title_activity_add_device"
            android:parentActivityName=".MainActivity">
            <meta-data

                android:name="android.support.PARENT_ACTIVITY"
                android:value=".MainActivity" />
        </activity>

        <receiver
            android:name=".StartupReceiver"
            android:enabled="true"
            android:exported="true"
            android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.QUICKBOOT_POWERON" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </receiver>

        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <service android:name="org.eclipse.paho.android.service.MqttService" />
    </application>

</manifest>

If I delete lines below evrything goes fine.

<meta-data
    android:name="com.google.android.actions" />

What meta-data is used for? Will I have problems if I just delete it? Why system complains regarding current meta-data? How to correct it?

vico
  • 17,051
  • 45
  • 159
  • 315
  • by default(in newly created project) `AndroidManifest.xml` don't have any meta-data, but you can add meta-data to use them on project, so in your project that one is used somewhere, that's why the error – Ashwini Saini Feb 11 '20 at 08:04
  • learn more about meta-data here. https://stackoverflow.com/questions/38687159/what-is-metadata-and-what-is-the-use-of-it-in-android/38699357 – Ashwini Saini Feb 11 '20 at 08:05

1 Answers1

0

If you are not using Google Assistant Actions you can delete it yes.

The output is telling you the error, you have the meta-data key, but not a value.

It is expecting:

<application>
    <!-- ... -->
    <meta-data 
        android:name="com.google.android.actions" 
        android:resource="@xml/actions" 
    />
</application>

https://developers.google.com/assistant/app/action-schema

Think of meta-data as key-value pairs that other services in your app lookup and use.

Blundell
  • 75,855
  • 30
  • 208
  • 233
  • @Vico If you found this helpful pls remember to upvote or mark it as answered https://stackoverflow.com/help/someone-answers – Blundell Feb 15 '20 at 23:03