При попытке запустить приложение в Android Studio на реальном устройстве, приложение не устанавливается! Ну... Сначала устанавливается (антивирус пишет, что приложение проверено), а потом оно пропадает (так и не запустив Activity). Приложение — Hello World. В Eclipse все работало нормально.
Вот вывод в консоль:
Waiting for device.
Target device: lenovo-lenovo_a536-0123456789ABCDEF
Uploading file
local path: D:\Android Aplication\myApplication\DictionaryDemo_3\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/com.dictionarydemo_3
Installing com.dictionarydemo_3
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.dictionarydemo_3"
WARNING: linker: libvc1dec_sa.ca7.so has text relocations. This is wasting memory and is a security risk. Please fix.
WARNING: linker: libvc1dec_sa.ca7.so has text relocations. This is wasting memory and is a security risk. Please fix.
pkg: /data/local/tmp/com.dictionarydemo_3
Success
Launching application: com.dictionarydemo_3/com.dictionarydemo_3.MainActivity.
DEVICE SHELL COMMAND: am start -n "com.dictionarydemo_3/com.dictionarydemo_3.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
WARNING: linker: libvc1dec_sa.ca7.so has text relocations. This is wasting memory and is a security risk. Please fix.
WARNING: linker: libvc1dec_sa.ca7.so has text relocations. This is wasting memory and is a security risk. Please fix.
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.dictionarydemo_3/.MainActivity }
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.dictionarydemo_3/.MainActivity } from null (pid=4359, uid=2000) not exported from uid 10187
at android.os.Parcel.readException(Parcel.java:1465)
at android.os.Parcel.readException(Parcel.java:1419)
at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:2228)
at com.android.commands.am.Am.runStart(Am.java:680)
at com.android.commands.am.Am.onRun(Am.java:270)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method)
Как исправить?
Ответ
Нужно было добавить в код Activity (в файле Manifest.xml):
Комментариев нет:
Отправить комментарий