运行apk文件Android的时候得到工作室包名称错误 [英] Android Studio gets package name wrong when running .apk

查看:261
本文介绍了运行apk文件Android的时候得到工作室包名称错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我改变了我的包的名字从com.mycompany.myapplication到com.mycompany.testapp。

I changed my package name from com.mycompany.myapplication to com.mycompany.testapp.

一切都建立正常,但当我尝试在模拟器上运行它,我得到:

Everything builds fine but when I try to run it on the emulator, I get:

会议重新启动
  目标设备:NexusS [模拟器-5554]
  上传文件
      本地路径:/home/antony/AndroidStudioProjects/testappProject/testapp/build/apk/testapp-debug-unaligned.apk
      远程路径:/data/local/tmp/com.mycompany.myapplication
  安装com.mycompany.myapplication
  DEVICE shell命令:下午安装-r/data/local/tmp/com.mycompany.myapplication
  PKG:/data/local/tmp/com.mycompany.myapplication
  成功

The session was restarted Target device: NexusS [emulator-5554] Uploading file local path: /home/antony/AndroidStudioProjects/testappProject/testapp/build/apk/testapp-debug-unaligned.apk remote path: /data/local/tmp/com.mycompany.myapplication Installing com.mycompany.myapplication DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.mycompany.myapplication" pkg: /data/local/tmp/com.mycompany.myapplication Success

启动应用程序:com.mycompany.myapplication / com.mycompany.testapp.MainActivity。
  DEVICE shell命令:我开始-D -ncom.mycompany.myapplication / com.mycompany.testapp.MainActivity-a android.intent.action.MAIN -c android.intent.category.LAUNCHER
  开始:{意向ACT = android.intent.action.MAIN猫= [android.intent.category.LAUNCHER] CMP = com.mycompany.myapplication / com.mycompany.testapp.MainActivity}
  错误类型3
  错误:Activity类{com.mycompany.myapplication / com.mycompany.testapp.MainActivity}不存在

Launching application: com.mycompany.myapplication/com.mycompany.testapp.MainActivity. DEVICE SHELL COMMAND: am start -D -n "com.mycompany.myapplication/com.mycompany.testapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.mycompany.myapplication/com.mycompany.testapp.MainActivity } Error type 3 Error: Activity class {com.mycompany.myapplication/com.mycompany.testapp.MainActivity} does not exist.

请注意远程路径^^^是错误的。

Note the remote path ^^^ is wrong.

如果我去了模拟器,我可以从菜单中启动应用程序,它只是当我尝试从Android Studio中的应用程序,我得到这个错误。

If I go to the emulator, I can start the app from the menu, it's just that I get this error when i try to run the app from Android Studio.

我也看到在logcat中,在右上角的下拉为我提供了无过滤器或应用:com.mycompany.myapplication。所以,我甚至不能正确地调试。

I also see in logcat, on the top-right, the drop-down offers me "No Filters" or "app:com.mycompany.myapplication". So I can't even debug properly.

在哪里这些引用com.mycompany.myapplication从哪里来的,我怎么能解决这个问题?

Where are these references to com.mycompany.myapplication coming from, and how can I fix this?

推荐答案

我来回答,以防万一别人卡住这个问题。奇怪的是,重新启动Android Studio中解决了这个问题。没有什么更复杂,没有那么明显。

I'll answer, just in case anyone else gets stuck with this. Strangely enough, restarting Android Studio solved the problem. Nothing more complicated, nothing less obvious.

这篇关于运行apk文件Android的时候得到工作室包名称错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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