且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

安装后,Android 应用程序无法打开.但它可以在模拟器中运行

更新时间:2023-10-20 20:01:52

我发现了问题!我在清单中使用不同的属性声明了 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.