简体   繁体   English

应用无法安装,但可以在模拟器中正常运行

[英]App won't install but runs fine in emulator

How can I diagnose apk install issues? 如何诊断APK安装问题? I have an app that compiles and runs in the emulator without any issues. 我有一个可以在模拟器中编译并运行的应用程序,没有任何问题。 But as soon as I export and try to load on my phone, it fails to install with no error to point me in the right direction. 但是,一旦我导出并尝试在手机上加载,它就安装成功,没有错误,可以向我指出正确的方向。

If the application is already installed or signed with a different key you may not be able to install the application again. 如果该应用程序已经安装或使用其他密钥签名,则可能无法再次安装该应用程序。 Another way you can install the application is to use adb from the terminal with the reinstall option: 安装应用程序的另一种方法是通过带有reinstall选项的终端使用adb:

adb install -r myApp.apk

It is also best to try doing this with another terminal or DDMS running logcat so you can see if there are any errors that happen when you try to install the application. 最好也与运行logcat的另一个终端或DDMS一起尝试执行此操作,以便在尝试安装应用程序时可以查看是否发生任何错误。

i have the same issue,The problem was the main activity in my AndroidManifest.xml file was written twice.i delete the first one and issue solved 我有同样的问题,问题是我的AndroidManifest.xml文件中的主要活动写了两次。我删除了第一个,问题就解决了

 <activity
        android:name=".SplashScreen"
        android:configChanges="orientation|keyboardHidden|screenSize"
        android:label="@string/title_activity_splash_screen"
        android:theme="@style/FullscreenTheme" >
    </activity>

so this activity is once defined here and twice again in AndriodManifest 因此,此活动一次在此处定义,AndriodManifest中再次定义

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

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

Whatever issues I faced file installing application on device that is I m discussing. 无论遇到什么问题,我正在讨论的是在设备上安装应用程序的文件。

  • Check whether you are installing application at right place(usually data/app) 检查您是否在正确的位置安装应用程序(通常是数据/应用程序)

  • Check permission for directory that you have right to install application in directory if not change the permission. 如果没有更改权限,请检查目录的权限,您有权在目录中安装应用程序。

  • Still won't work try to install application in system/app folder. 尝试将应用程序安装在system / app文件夹中仍然无法正常工作。

Are you installing it via Eclipse or sending it to phone other way and trying to do it with system file manager? 您是通过Eclipse安装它还是通过其他方式将其发送到电话并尝试使用系统文件管理器来完成?

Some standard file managers don't allow you to install .apk. 一些标准文件管理器不允许您安装.apk。 You have to send the file via Bluetooth or in some other way "receive" it. 您必须通过蓝牙发送文件或以其他方式“接收”文件。

You will have to turn on USB debugging on your phone. 您将必须在手机上打开USB调试。 On the device, go to the home screen, press MENU, select Applications > Development, then enable USB debugging. 在设备上,转到主屏幕,按MENU,选择应用程序>开发,然后启用USB调试。 Then in Eclipse switch to the Debug perspective (Menu Bar -> Window -> Open Perspective -> Debug). 然后在Eclipse中切换到“调试”透视图(菜单栏->窗口->打开透视图->调试)。 You will see a view called logcat with Android icon. 您将看到一个带有Android图标的名为logcat的视图。 Click on it, it will display the debugging messages. 单击它,它将显示调试消息。 Now, install the app on the phone using Eclipse and check the logcat for the error message. 现在,使用Eclipse在手机上安装该应用程序,并在logcat中检查错误消息。

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

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