我是Android和Java的新手。我目前正在上一门课程,向我介绍Android和Eclipse。我有一个问题。一旦我构建了我的应用程序,我就可以通过虚拟应用程序运行它,但我无法将其安装到我的Galaxy Note II手机上。我允许调试,模拟和未知来源。 Eclipse可以看到我的手机。 此外,我可以通过资源管理器安装apk。我最近读到了apk也应该签名。我该怎么做,其他人可以帮忙吗?
[2013-12-10 18:44:47 - Awesome2a] ------------------------------
[2013-12-10 18:44:47 - Awesome2a] Android Launch!
[2013-12-10 18:44:48 - Awesome2a] adb is running normally.
[2013-12-10 18:44:48 - Awesome2a] Performing myapp.awesome2a.MainActivity activity launch
[2013-12-10 18:44:48 - Awesome2a] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2013-12-10 18:45:14 - Awesome2a] Uploading Awesome2a.apk onto device '42f73302b863bf67'
[2013-12-10 18:45:15 - Awesome2a] Installing Awesome2a.apk...
[2013-12-10 18:45:16 - Awesome2a] Installation failed due to invalid APK file!
[2013-12-10 18:45:16 - Awesome2a] Please check logcat output for more details.
[2013-12-10 18:45:16 - Awesome2a] Launch canceled!
当我看一下Logcat时,我会收到这些信息。
12-10 18:44:00.002: D/STATUSBAR-Clock(3084): onReceive() - ACTION_TIME_TICK
12-10 18:44:00.007: D/STATUSBAR-Clock(3084): onReceive() - ACTION_TIME_TICK
12-10 18:44:00.032: D/ClockAlarmWidgetService(5457): [ClockAlarmWidgetService] onReceive: action = android.intent.action.TIME_TICK
12-10 18:44:00.032: E/ClockAlarmWidget(5457): [AlarmWidgetIdManager] getListItem() : itemIndex=0, widgetID:1
12-10 18:44:00.032: E/ClockAlarmWidget(5457): [AlarmWidgetIdManager] getListItem() : ItemIndex exceed ListItemCount. itemIndex=1
12-10 18:44:00.032: E/ClockAlarmWidget(5457): [AlarmWidgetIdManager] getListItem() : itemIndex=1, widgetID:1
12-10 18:44:00.032: D/ClockAlarmWidget(5457): [ClockAlarmWidgetProvider] fillData() - itemIndex:0, listitemID: 0
12-10 18:44:00.037: D/ClockAlarmDataProvider(5457): getAlarm() - too many same ID alarm data. nCount: 0
12-10 18:44:00.042: D/ClockAlarmWidget(5457): alarmItem = null
12-10 18:44:00.042: D/ClockWidget(2408): refreshTime()
12-10 18:44:00.047: D/ClockWidget(2408): TTS Message = It is 6 : 44 PM, Tuesday, December 10
12-10 18:44:05.727: E/MtpService(3505): In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
12-10 18:44:05.727: E/MtpService(3505): battPlugged Type : 2
12-10 18:44:05.727: D/BatteryService(2408): update start
12-10 18:44:05.727: D/BatteryService(2408): level:100 scale:100 status:2 health:2 present:true voltage: 4326 temperature: 249 technology: Li-ion AC powered:false USB powered:true icon:17303211 invalid charger:0
12-10 18:44:05.727: D/STATUSBAR-BatteryController(3084): onReceive() - ACTION_BATTERY_CHANGED
12-10 18:44:05.727: D/STATUSBAR-BatteryController(3084): onReceive() - level:100
12-10 18:44:05.727: D/STATUSBAR-BatteryController(3084): onReceive() - plugged:2
12-10 18:44:05.727: D/STATUSBAR-BatteryController(3084): onReceive() - BATTERY_STATUS_CHARGING:
12-10 18:44:05.732: D/STATUSBAR-PhoneStatusBar(3084): ACTION_BATTERY_CHANGED
12-10 18:44:05.732: D/STATUSBAR-PhoneStatusBar(3084): NORMAL_BATTERY
12-10 18:44:05.737: W/AlarmManager(2408): FACTORY_ON= 0
12-10 18:44:23.687: E/Watchdog(2408): !@Sync 28
12-10 18:44:29.682: E/WifiHW(2408): ##################### set firmware type 0 #####################
12-10 18:44:29.682: D/WifiStateMachine(2408): setWifiEnabled : WifiNative.setFwType(0)
12-10 18:44:29.682: V/AlarmManager(2408): waitForAlarm result :4
12-10 18:44:29.682: V/AlarmManager(2408): trigger ELAPSED_REALTIME_WAKEUP or RTC_WAKEUP
12-10 18:44:29.682: D/WifiService(2408): startScan: false pid=3965, uid=10019
12-10 18:44:29.687: W/AlarmManager(2408): FACTORY_ON= 0
12-10 18:44:29.697: I/wpa_supplicant(3889): Scan requested (ret=0) - scan timeout 30 seconds
12-10 18:44:29.762: W/AlarmManager(2408): FACTORY_ON= 0
12-10 18:44:33.347: I/wpa_supplicant(3889): nl80211: Received scan results (9 BSSes)
12-10 18:44:33.347: D/Tethering(2408): interfaceLinkStateChanged wlan0, true
12-10 18:44:33.347: D/Tethering(2408): interfaceStatusChanged wlan0, true
12-10 18:44:33.357: W/AlarmManager(2408): FACTORY_ON= 0
12-10 18:44:33.377: D/dalvikvm(3965): GC_CONCURRENT freed 511K, 8% free 13209K/14343K, paused 1ms+1ms, total 14ms
12-10 18:44:33.377: D/dalvikvm(3965): WAIT_FOR_CONCURRENT_GC blocked 8ms
12-10 18:44:33.382: W/AlarmManager(2408): FACTORY_ON= 0
12-10 18:44:33.412: E/WifiHW(2408): ##################### set firmware type 0 #####################
12-10 18:44:33.412: D/WifiStateMachine(2408): setWifiEnabled : WifiNative.setFwType(0)
12-10 18:44:33.417: W/AlarmManager(2408): FACTORY_ON= 0
12-10 18:44:33.467: I/GCoreUlr(3965): Successfully inserted location
12-10 18:44:33.467: I/GCoreUlr(3965): Not calling LocationReportingService, hasMoved: false, elapsed millis: 780030, request: Phone
12-10 18:44:34.682: V/AlarmManager(2408): waitForAlarm result :4
12-10 18:44:41.742: D/BatteryService(2408): update start
12-10 18:44:41.747: E/MtpService(3505): In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
12-10 18:44:41.747: E/MtpService(3505): battPlugged Type : 2
12-10 18:44:41.747: D/BatteryService(2408): level:100 scale:100 status:2 health:2 present:true voltage: 4326 temperature: 242 technology: Li-ion AC powered:false USB powered:true icon:17303211 invalid charger:0
12-10 18:44:41.747: D/STATUSBAR-BatteryController(3084): onReceive() - ACTION_BATTERY_CHANGED
12-10 18:44:41.747: D/STATUSBAR-BatteryController(3084): onReceive() - level:100
12-10 18:44:41.747: D/STATUSBAR-BatteryController(3084): onReceive() - plugged:2
12-10 18:44:41.747: D/STATUSBAR-BatteryController(3084): onReceive() - BATTERY_STATUS_CHARGING:
12-10 18:44:41.762: W/AlarmManager(2408): FACTORY_ON= 0
12-10 18:44:41.762: D/STATUSBAR-PhoneStatusBar(3084): ACTION_BATTERY_CHANGED
12-10 18:44:41.762: D/STATUSBAR-PhoneStatusBar(3084): NORMAL_BATTERY
12-10 18:44:41.777: D/dalvikvm(3965): GC_CONCURRENT freed 396K, 8% free 13201K/14343K, paused 12ms+1ms, total 27ms
12-10 18:44:53.687: E/Watchdog(2408): !@Sync 29
12-10 18:44:59.997: V/AlarmManager(2408): waitForAlarm result :8
12-10 18:44:59.997: V/AlarmManager(2408): ClockReceiver onReceive() ACTION_TIME_TICK
12-10 18:44:59.997: W/AlarmManager(2408): FACTORY_ON= 0
我完全没有头绪。你能帮忙吗?
答案 0 :(得分:0)
嗯,我怀疑项目设置或androidmanifest.xml文件有问题。在Eclipse的顶部栏中,你可以去Run>运行配置,切换到“目标”选项卡,然后为当前配置选择“始终提示选择设备”?只是为了确保它被部署到正确的设备上。假设没有修复它,你可以发布Android清单吗?此外,您使用的是任何库还是有任何外部依赖项?
答案 1 :(得分:0)
Usualy如果你去
Project > Unset build automatically
然后,
Proyect > clean
然后,在项目资源管理器中:
right click on project name > refresh
然后,
Proyect > build project
然后从设备中卸载您可能拥有的任何版本的应用,并尝试重新安装它。