自从我将Android Studio从1.5更新到2.1以来,我已经多次遇到以下错误(不总是)。这是“运行”对话框的输出:
05/04 10:15:14: Launching app
$ adb push C:\Users\Sition\AndroidStudioProjects\DigginTemp\app\build\outputs\apk\app-debug.apk /data/local/tmp/com.example.sition.diggintemp
$ adb shell pm install -r "/data/local/tmp/com.example.sition.diggintemp"
pkg: /data/local/tmp/com.example.sition.diggintemp
Success
$ adb shell am start -n "com.example.sition.diggintemp/com.example.sition.diggintemp.StartActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Unexpected error while executing: am start -n "com.example.sition.diggintemp/com.example.sition.diggintemp.StartActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while Launching activity
但奇怪的是,在logcat中什么也找不到。我真的不知道是什么原因导致了这种情况,因为这个错误并不能说明出了什么问题,除了StartActivity的启动出了问题(自更新以来,我几乎没有改变,甚至根本没有改变)。
我的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sition.diggintemp"
android:versionCode="5"
android:versionName="0.2">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_VIDEO" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application
android:name=".misc.AppController"
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".StartActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity android:name=".LoginActivity" />
<activity
android:name=".LoadActivity"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity android:name=".ProjectOverviewActivity" />
<activity android:name=".CameraActivity" />
<activity android:name=".VideoActivity" />
</application>
</manifest>
有人知道如何解决这个问题吗?
编辑:
在我从logcat中删除过滤器后,我得到了一些输出,这是一部分:
05-04 11:59:57.585 540-1126/? D/dalvikvm: GC_EXPLICIT freed 249K, 17% free 67587K/80892K, paused 8ms+53ms, total 657ms
05-04 11:59:57.984 3427-3427/? I/dalvikvm: Turning on JNI app bug workarounds for target SDK version 8...
05-04 11:59:58.273 540-744/? W/LicenseLogService: log() is called by non admin
05-04 11:59:58.281 540-744/? W/LicenseLogService: log() is called by non admin
05-04 11:59:58.289 540-652/? D/ECS_EnterpriseContainerService: <<< Intent action is >>> : android.intent.action.PACKAGE_ADDED
05-04 11:59:58.289 540-652/? D/ECS_EnterpriseContainerService: <<< Intent data is >>> : package:com.example.sition.diggintemp
05-04 11:59:58.289 540-652/? I/ECS_EnterpriseContainerService: Inside package added listener
05-04 11:59:58.296 540-652/? I/Monitor: SIOP:: Current AP = 0, CP = 0, PST = 300
05-04 11:59:58.296 540-652/? D/BatteryService: Sending ACTION_BATTERY_CHANGED.
05-04 11:59:58.304 786-786/? D/STATUSBAR-BatteryController: onReceive() - ACTION_BATTERY_CHANGED
05-04 11:59:58.304 786-786/? D/STATUSBAR-BatteryController: onReceive() - BATTERY_STATUS_FULL:
05-04 11:59:58.312 25355-25355/? V/CircleBatteryWidget: Valeur recuperee a partir de l'intent
05-04 11:59:58.312 25355-25355/? V/CircleBatteryWidget: Valeur recuperee : 100
05-04 11:59:58.429 3308-3308/? I/BaseStore: ConfigStore database version: 1
05-04 11:59:58.445 540-689/? W/Resources: Converting to string: TypedValue{t=0x12/d=0xffffffff a=-1}
05-04 11:59:58.734 786-786/? D/STATUSBAR-PhoneStatusBar: mBrightnessEnablebySettings = true mBrightnessEnablebyBattery = true mBrightnessEnablebyDisableFlag = true
05-04 11:59:58.820 25355-25355/? V/CircleBatteryWidget: Widget W :108
05-04 11:59:58.820 25355-25355/? V/CircleBatteryWidget: Widget H :108
05-04 11:59:58.820 25355-25355/? V/CircleBatteryWidget: Bitmap W :108
05-04 11:59:58.820 25355-25355/? V/CircleBatteryWidget: Bitmap H :108
05-04 11:59:58.992 3308-3308/? I/dalvikvm: Could not find method android.database.Cursor.getNotificationUri, referenced from method com.google.android.music.utils.ColumnIndexableCursor.getNotificationUri
05-04 11:59:58.992 3308-3308/? W/dalvikvm: VFY: unable to resolve interface method 931: Landroid/database/Cursor;.getNotificationUri ()Landroid/net/Uri;
05-04 11:59:58.992 3308-3308/? D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
05-04 11:59:59.101 3427-3427/? I/PCWCLIENTTRACE_LOG: DEFAULT_LOGON : true
05-04 11:59:59.101 3427-3427/? I/PCWCLIENTTRACE_LOG: DEFAULT_LOGLEVEL : 3
05-04 11:59:59.101 3427-3427/? I/PCWCLIENTTRACE_PushUtil: SPPPushClient is installed : true
05-04 11:59:59.101 3427-3427/? I/PCWCLIENTTRACE_PushUtil: sales region : global
05-04 11:59:59.109 3427-3427/? I/PCWCLIENTTRACE_PushUtil: getPushTypeList : [SPP, GCM]
05-04 11:59:59.109 3427-3427/? I/PCWCLIENTTRACE_SYSTEMReceiver: [onReceive] - android.intent.action.PACKAGE_ADDED
05-04 11:59:59.203 3308-3308/? I/dalvikvm: Could not find method android.database.Cursor.setExtras, referenced from method com.google.android.music.utils.ColumnIndexableCursor.setExtras
05-04 11:59:59.203 3308-3308/? W/dalvikvm: VFY: unable to resolve interface method 953: Landroid/database/Cursor;.setExtras (Landroid/os/Bundle;)V
05-04 11:59:59.203 3308-3308/? D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
05-04 11:59:59.203 3308-3308/? I/dalvikvm: Could not find method android.database.Cursor.setExtras, referenced from method com.google.android.music.utils.ColumnIndexableCursor.setExtrasInternal
05-04 11:59:59.203 3308-3308/? W/dalvikvm: VFY: unable to resolve interface method 953: Landroid/database/Cursor;.setExtras (Landroid/os/Bundle;)V
这里是另一部分:
05-04 12:00:01.664 3440-3440/? D/Spen: SpenSdk jar version = 55
05-04 12:00:01.664 3440-3440/? D/Spen: You SHOULD INSTALL SpenSdk apk file !!!!
05-04 12:00:01.664 3440-3440/? W/System.err: com.samsung.android.sdk.SsdkUnsupportedException: SpenSdk apk is not installed.
05-04 12:00:01.828 3440-3440/? W/System.err: at com.samsung.android.sdk.pen.Spen.initialize(Spen.java:202)
05-04 12:00:01.828 3440-3440/? W/System.err: at com.samsung.android.sdk.pen.Spen.initialize(Spen.java:114)
05-04 12:00:01.828 3440-3440/? W/System.err: at com.sec.samsung.gallery.app.imagenote.photonote.NoteSpenSurfaceView.initializeSPenSDK(NoteSpenSurfaceView.java:118)
05-04 12:00:01.835 3440-3440/? W/System.err: at com.sec.samsung.gallery.app.imagenote.photonote.PhotoNoteUtils.isSpenSdk30Supported(PhotoNoteUtils.java:56)
05-04 12:00:01.835 3440-3440/? W/System.err: at com.sec.android.gallery3d.util.GalleryFeature.checkEnableNote(GalleryFeature.java:1546)
05-04 12:00:01.835 3440-3440/? W/System.err: at com.sec.android.gallery3d.util.GalleryFeature.init(GalleryFeature.java:428)
05-04 12:00:01.835 3440-3440/? W/System.err: at com.sec.android.gallery3d.app.GalleryAppImpl.getDataManager(GalleryAppImpl.java:229)
05-04 12:00:01.835 3440-3440/? W/System.err: at com.sec.android.gallery3d.provider.GalleryProvider.onCreate(GalleryProvider.java:126)
05-04 12:00:01.835 3440-3440/? W/System.err: at android.content.ContentProvider.attachInfo(ContentProvider.java:1058)
05-04 12:00:01.835 3440-3440/? W/System.err: at android.app.ActivityThread.installProvider(ActivityThread.java:5067)
05-04 12:00:01.835 3440-3440/? W/System.err: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4679)
05-04 12:00:01.835 3440-3440/? W/System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4592)
05-04 12:00:01.835 3440-3440/? W/System.err: at android.app.ActivityThread.access$1400(ActivityThread.java:158)
05-04 12:00:01.835 3440-3440/? W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
05-04 12:00:01.835 3440-3440/? W/System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
05-04 12:00:01.835 3440-3440/? W/System.err: at android.os.Looper.loop(Looper.java:176)
05-04 12:00:01.843 3440-3440/? W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5365)
05-04 12:00:01.843 3440-3440/? W/System.err: at java.lang.reflect.Method.invokeNative(Native Method)
05-04 12:00:01.843 3440-3440/? W/System.err: at java.lang.reflect.Method.invoke(Method.java:511)
05-04 12:00:01.851 3440-3440/? W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
05-04 12:00:01.851 3440-3440/? W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
05-04 12:00:01.851 3440-3440/? W/System.err: at dalvik.system.NativeStart.main(Native Method)
另一部分:
05-04 12:00:06.429 3487-3487/? I/SA: [DM] init START
05-04 12:00:06.437 3487-3487/? I/SA: [DM] This device is not a Vodafone
05-04 12:00:06.460 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060000 (t=5 e=0) in package 0 (error -75)
05-04 12:00:06.460 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060001 (t=5 e=1) in package 0 (error -75)
05-04 12:00:06.460 3487-3487/? W/ResourceType: No package identifier when getting value for resource number 0x00000000
05-04 12:00:06.468 3487-3487/? W/ResourceType: No package identifier when getting value for resource number 0x00000000
05-04 12:00:06.468 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060003 (t=5 e=3) in package 0 (error -75)
05-04 12:00:06.468 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060004 (t=5 e=4) in package 0 (error -75)
05-04 12:00:06.468 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060005 (t=5 e=5) in package 0 (error -75)
05-04 12:00:06.468 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060006 (t=5 e=6) in package 0 (error -75)
05-04 12:00:06.468 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060007 (t=5 e=7) in package 0 (error -75)
05-04 12:00:06.468 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060008 (t=5 e=8) in package 0 (error -75)
05-04 12:00:06.476 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060009 (t=5 e=9) in package 0 (error -75)
05-04 12:00:06.476 3487-3487/? W/ResourceType: Failure getting entry for 0x7f06000a (t=5 e=10) in package 0 (error -75)
05-04 12:00:06.476 3487-3487/? W/ResourceType: Failure getting entry for 0x7f06000d (t=5 e=13) in package 0 (error -75)
05-04 12:00:06.476 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060012 (t=5 e=18) in package 0 (error -75)
05-04 12:00:06.484 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060013 (t=5 e=19) in package 0 (error -75)
05-04 12:00:06.484 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060014 (t=5 e=20) in package 0 (error -75)
05-04 12:00:06.484 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060015 (t=5 e=21) in package 0 (error -75)
05-04 12:00:06.484 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060016 (t=5 e=22) in package 0 (error -75)
05-04 12:00:06.484 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060017 (t=5 e=23) in package 0 (error -75)
05-04 12:00:06.492 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060018 (t=5 e=24) in package 0 (error -75)
05-04 12:00:06.492 3487-3487/? W/ResourceType: No package identifier when getting value for resource number 0x00000000
05-04 12:00:06.500 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060019 (t=5 e=25) in package 0 (error -75)
05-04 12:00:06.500 3487-3487/? W/ResourceType: No package identifier when getting value for resource number 0x00000000
05-04 12:00:06.500 3487-3487/? W/ResourceType: Failure getting entry for 0x7f06001a (t=5 e=26) in package 0 (error -75)
05-04 12:00:06.500 3487-3487/? W/ResourceType: Failure getting entry for 0x7f06001b (t=5 e=27) in package 0 (error -75)
05-04 12:00:06.507 3487-3487/? W/ResourceType: Failure getting entry for 0x7f06001d (t=5 e=29) in package 0 (error -75)
05-04 12:00:06.507 3487-3487/? W/ResourceType: Failure getting entry for 0x7f06001e (t=5 e=30) in package 0 (error -75)
05-04 12:00:06.507 3487-3487/? W/ResourceType: Failure getting entry for 0x7f06001f (t=5 e=31) in package 0 (error -75)
05-04 12:00:06.507 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060020 (t=5 e=32) in package 0 (error -75)
05-04 12:00:06.507 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060022 (t=5 e=34) in package 0 (error -75)
05-04 12:00:06.507 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060023 (t=5 e=35) in package 0 (error -75)
05-04 12:00:06.515 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060025 (t=5 e=37) in package 0 (error -75)
05-04 12:00:06.515 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060026 (t=5 e=38) in package 0 (error -75)
05-04 12:00:06.515 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060027 (t=5 e=39) in package 0 (error -75)
05-04 12:00:06.523 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060028 (t=5 e=40) in package 0 (error -75)
05-04 12:00:06.523 3487-3487/? W/ResourceType: Failure getting entry for 0x7f06002a (t=5 e=42) in package 0 (error -75)
05-04 12:00:06.523 3487-3487/? W/ResourceType: Failure getting entry for 0x7f06002c (t=5 e=44) in package 0 (error -75)
05-04 12:00:06.523 3487-3487/? W/ResourceType: Failure getting entry for 0x7f06002b (t=5 e=43) in package 0 (error -75)
05-04 12:00:06.523 3487-3487/? W/ResourceType: Failure getting entry for 0x7f06002d (t=5 e=45) in package 0 (error -75)
05-04 12:00:06.531 3487-3487/? W/ResourceType: Failure getting entry for 0x7f06002f (t=5 e=47) in package 0 (error -75)
05-04 12:00:06.531 3487-3487/? W/ResourceType: Failure getting entry for 0x7f06002e (t=5 e=46) in package 0 (error -75)
05-04 12:00:06.531 3487-3487/? W/ResourceType: Failure getting entry for 0x7f060031 (t=5 e=49) in package 0 (error -75)
05-04 12:00:06.578 3487-3487/? I/SA: support phone number id : true
05-04 12:00:06.578 3487-3487/? I/SA: [DM] Supports Ref Jpn : false
05-04 12:00:06.578 3487-3487/? I/SA: [DM] init END
我真的不知道如何修复它(我会调查一下)
我认为这个问题是android Studio最新更新版本的错误,我遇到了同样的问题,上面没有一个是解决方案,从上面所说的所有内容中有时唯一有效的是,如果您在运行之前先“与Gradle Files同步项目”,但您必须一遍又一遍地这样做。对我来说,总是有效的是运行程序,在它安装了apk并给出启动活动的错误后,忽略错误并直接进入您的模拟器,找到您的项目/应用程序图标并直接点击或启动它,它将在您所做的所有更改中正常启动。这可能是一个解决方法,但它提供了结果
您可以通过如下所述重新启动android studio来解决问题
有时再次运行(不止一次)在我的情况下工作正常,然后其他后续运行成功。
不确定,但您可以尝试禁用“instant run”。要禁用“即时运行”,您可以转到首选项对话框(可能是Windows上的设置对话框),然后选择“生成、执行、部署”--
我在清单文件中为我的一个活动定义了一个意图过滤器。当我试图使用以下命令从adb外壳启动此活动时: $adb shell am start 我得到以下错误: 开始:Intent{act=android.Intent.action.VIEW dat=http://www.example.com/gizmospkg=com。实例Android} 错误:活动未启动,无法解析Intent{act=andro
当我尝试用Google Maps活动模板打开一个新项目时,我会遇到以下错误。 错误:(3)检索项的父项时出错:找不到与给定名称“Android:TextApparance.Material.Widget.Button.Inverse”匹配的资源。 我对此完全陌生,我试着看过类似的帖子,但我无法理解那里给出的解释。 这些错误出现在名为google_maps_api.xml的文件中
问题内容: 在添加异步任务之前,我已经对代码进行了一些更改,我的应用程序可以正常运行其远程服务器上的身份验证用户名和密码,但是在登录成功消息消失后无法启动其他活动。有人建议我现在添加一个异步任务,但是我输入正确的用户名和密码后它将停止工作。当我输入错误的用户名和密码时,其工作正常将显示错误的用户名密码消息。如果有人能够知道会出现什么错误,请帮助我。 码- 日志猫 QuestionnActivi
当我尝试从一个活动()切换到另一个活动()时出错。我做错了什么?我的代码没有错误。 以下是日志猫的内容: E/AndroidRuntime(787): FATAL EXCEPTION: main E/AndroidRuntime(787): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.intellig
我已经更改了我想首先运行的活动从主活动到另一个。我通过编辑Android清单并移动这段代码做到了这一点: 我的清单现在是这样的: 当我运行它在我的手机和平板电脑(从android工作室)我得到下面的错误和应用程序不启动自动像以前一样。但是当我点击图标时,它通常首先以正确的活动开始。 但是当我使用模拟器时,正确的活动只在第一次安装时启动,而之前设置的活动则会启动。 我不知道为什么会这样。我完全没有安
我在模拟器上运行一个Android应用程序。它一直工作到昨天和今天我更新了Android Studio。我得到以下错误。如何解决? 模拟器:警告:将内存大小增加到1GB模拟器:错误: x86仿真目前需要硬件加速!请确保英特尔HAXM已正确安装并可用。CPU加速状态:HAXM必须更新(版本1.1.1