我安装后的And​​r​​oid应用程序将不会打开。但它可以在仿真器上运行 [英] Android app won't open after i install. But it can run in emulator

查看:236
本文介绍了我安装后的And​​r​​oid应用程序将不会打开。但它可以在仿真器上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从月食出口我的应用程序并安装它在我的手机上。安装完成后,我点击从安装程序包打开,但安装程序强制关闭。后来,当我试图启动应用程序,没有发生在我点击它。我点击该应用,在应用程序的抽屉,但它返回到主屏幕代替。

I have exported my app from eclipse and installed it on my phone. After installation, I click open from package installer, but the installer force close. Afterwards, when I tried to launch the app, nothing happen after I click it. I click the app in app drawer but it return to home screen instead.

我能够在模拟器并在调试模式下,当我通过USB连接我的设备运行,但不是当我出口APK安装。

I am able to run in emulator and in debug mode when I connect my device via usb, but not when I export the apk to install.

请注意,这不是我出口到安装第一个应用程序。 previous应用程序工作正常。

Note that this is not the first app that I exported to install. Previous apps are working fine.

推荐答案

我发现这个问题!我宣布活动在清单2次不同的属性,如:

I found the problem! I had declared the activity 2 times in the manifest with different properties, like:

<activity android:name=".myclass"></activity> 

<activity android:name=".myclass" android:label="@string/app_name">
  <intent-filter>   
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.LAUNCHER" /> 
  </intent-filter>
</activity> 

取下清单不需要之一,它会工作。

Remove the unwanted one from the manifest and it will work.

这篇关于我安装后的And​​r​​oid应用程序将不会打开。但它可以在仿真器上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆