[英]I renamed a package and my app won't launch
我一直在按照本教程创建一个Android游戏。 我下载了他提供的骨骼,但将其中一个软件包从robotgame
为highst
。 每当我尝试将带有示例代码的应用程序部署到我的设备时,都会收到以下错误。
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.ronyo.robotgame/com.ronyo.highst.Loader }
Error type 3
Error: Activity class {com.ronyo.robotgame/com.ronyo.highst.Loader} does not exist.
我在项目中搜索了robotgame
的实例,但找不到它的实例。 上面的教程是使用Eclipse创建的,我正将其移植到Android Studio。 我想知道是否在切换IDE时是否忽略了某些内容?
这是我的AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ronyo.highst"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:icon="@drawable/icon"
android:label="Loader" >
<activity
android:name=".Loader"
android:configChanges="keyboard|keyboardHidden|orientation"
android:label="Loader"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.inten.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
删除文件夹.idea和.gradle,然后单击“与gradle文件同步项目”按钮
似乎该软件包并未在所有地方进行更新。 您是否更改了清单中的任何内容?
在AndroidManifest.xml文件的<manifest
标记中,应该有一个package属性。 需要更新它以匹配您的新软件包名称com.ronyo.highst
。
在此处查看文档: http : //developer.android.com/guide/topics/manifest/manifest-element.html
不要直接更改它,它不会更新所有引用,请使用它
右键单击项目> Android工具>重命名应用程序包
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.