android - Zipaligned 应用程序出错

标签 android android-manifest zipalign

应用程序在 zipaligned 之前运行良好。 签名后,该应用无法安装在我的手机或平板电脑上。 我把它上传到 playstore 。 它不显示错误,但支持的设备显示 0。 有什么问题吗 ? 这是 manifest.xml。

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.emapps.easystudy"
    android:versionCode="1"
    android:versionName="0.6" >

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

    <uses-feature android:name="android.hardware.screen.portraits" />

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="22" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".StartActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <activity
            android:name=".AwardsGrid"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".AwardsGreyGrid"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="screenslide.ScreenSlideActivity"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".MainActivity"
            android:screenOrientation="portrait" >
        </activity>


        <receiver android:name=".Notificationmassage" >
        </receiver>
        <receiver android:name=".StudyingNotification" >
        </receiver>

        <activity
            android:name=".Setting"
            android:label="@string/title_activity_setting"
            android:screenOrientation="portrait" >
        </activity>
    </application>

</manifest>

最佳答案

如果您使用的是 IDE“构建签名的 apk”GUI 功能,则不需要 zipalign,因为最后一步将由 IDE 完成。
如果您使用命令行,请执行以下步骤:Signing manually


Zipalign

Caution: zipalign must only be performed after the .apk file has been signed with your private key. If you perform zipalign before signing, then the signing procedure will undo the alignment. Also, do not make alterations to the aligned package. Alterations to the archive, such as renaming or deleting entries, will potentially disrupt the alignment of the modified entry and all later entries. And any files added to an "aligned" archive will not be aligned.

关于android - Zipaligned 应用程序出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30376021/

相关文章:

android 通知一项 Activity 和另一项 Activity 的最佳方法

java - 如何使用Camera2删除图像中的GPS数据?

Android O 中的 android:appCategory。哪些值?

android - Jenkins CI : zipalign failed on APK : exit code 1

android - AzureDevOps Android Pipeline zipalign - 失败,退出代码为 1

java - Android应用程序在旋转屏幕时崩溃

java - android - 如何获取发生异常的类和方法名称

android - 在应用程序之间使用隐式 Intent 的自定义操作

android - 如何在每个 Activity 的 ActionBar 上显示 Android 应用名称?

android - 如何在android中压缩对齐APK文件?