简体   繁体   English

签名生成的APK与Android Studio内部的签名不同

[英]Signed generated APK does not work the same as inside Android Studio

I have generated an APK using Android Studio and I don't know why the APK behavior is different from installing the software using the usb wire on debug mode. 我已经使用Android Studio生成了APK,但我不知道为什么APK行为与在调试模式下使用usb线安装软件不同。 I have two activities in the same application and when I install it from debug, it appears the first of them but if I install it using the APK, it is launched directly in the second activity. 我在同一应用程序中有两个活动,当我从调试安装它时,它似乎是第一个活动,但是如果我使用APK安装它,则会在第二个活动中直接启动它。

Any hint? 有什么提示吗?

Thanks! 谢谢!

EDIT: this is the new manifest after modifying it accordingly to the answer given by Bala Raja. 编辑:这是根据Bala Raja给出的答案对其进行相应修改后的新清单。 However, the problem is that now Android is not identifying the second activity as a Launcher. 但是,问题在于,现在Android并未将第二个活动标识为启动器。 What could I do? 我能做什么?

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.test"
          android:versionCode="1"
          android:versionName="1.0">
    <uses-sdk android:minSdkVersion="19"/>
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.REORDER_TASKS" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:label="@string/app_name" android:icon="@drawable/happy" android:debuggable="true">
        <activity android:name=".Configure"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity android:name=".Launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" >
            <intent-filter>
                <action android:name="android.intent.action.CLOSE_SYSTEM_DIALOGS" />
                <category android:name="android.intent.category.LAUNCHER"/>
                <category android:name="android.intent.category.HOME" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>
</manifest>
<intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

paste this in your activity in manifest file which you want first. 将此粘贴到您首先要的清单文件中的活动中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM