android wear-debug.apk显示解析错误

时间:2014-09-17 09:03:09

标签: android android-studio wear-os

我把配置作为磨损并运行到模拟器中,然后我在我的项目输出文件夹中找到了apk。我通过电子邮件发送了一封,在安装可穿戴手表时显示there was a error while parsing the package.任何人都建议我

这是我的manifest.xml

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

    <uses-feature android:name="android.hardware.type.watch" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.DeviceDefault" >
        <activity
            android:name=".MyActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

1 个答案:

答案 0 :(得分:3)

我遇到了同样的错误,只是确保微型应用已签名

以下是我的可穿戴式build.gradle的片段:

android {
    compileSdkVersion 20
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "my.package.name" // same as the main app!
        minSdkVersion 20
        targetSdkVersion 20
        versionCode 1
        versionName "1.0"
    }
    signingConfigs {
        release {
            storeFile file("path/to/keystore")
            storePassword '...'
            keyAlias '...'
            keyPassword '...'
        }
    }
    buildTypes {
        debug {
            runProguard false
            signingConfig signingConfigs.release
        }
        release {
            runProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }
}