Android 当我从ADB Shell发送BOOT_COMPLETE广播时,应用程序无任何错误关闭

Android 当我从ADB Shell发送BOOT_COMPLETE广播时,应用程序无任何错误关闭,android,android-broadcast,bootcompleted,Android,Android Broadcast,Bootcompleted,我有一个boot complete广播接收器,当手机重新启动时,它没有被调用,所以我删除了onReceive方法中的所有内容,添加了一个log语句,并使用ADB shell发送boot_complete广播,现在,当我发送广播时,应用程序只是关闭,没有任何消息,应用程序的状态在logcat软件包下拉列表中变为死机。 我在清单文件中定义了以下权限: <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED

我有一个boot complete广播接收器,当手机重新启动时,它没有被调用,所以我删除了onReceive方法中的所有内容,添加了一个log语句,并使用ADB shell发送boot_complete广播,现在,当我发送广播时,应用程序只是关闭,没有任何消息,应用程序的状态在logcat软件包下拉列表中变为死机。 我在清单文件中定义了以下权限:

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

以下是我注册接收人的方式:

<receiver
    android:name=".BootCompleteBroadcastReceiver"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED" />
    </intent-filter>
</receiver>

我尝试过不使用android:exported=“true”标签。 我在onReceive方法中什么也不做,我只是有一个日志语句,它没有被打印出来

这是日志,应用程序似乎以某种方式被强制关闭,没有任何错误:

04-24 19:34:28.639   768  1645 D ReceiverController: getBootReceiverEnabledSetting(com.vysh.theeye) at User(0) with identity: 1001
04-24 19:34:28.639   898   898 D AppChangedReceiver: kill back service:com.vysh.theeye
04-24 19:34:28.642   768  1633 V PackageController: forceStopPackage: com.vysh.theeye
04-24 19:34:28.642   768  1633 I ActivityManager: Force stopping com.vysh.theeye appid=10119 user=0: from pid 768
04-24 19:34:28.643   768  1633 I ActivityManager: Killing 31461:com.vysh.theeye/u0a119 (adj 0): stop com.vysh.theeye
04-24 19:34:28.696   195   822 I BufferQueueProducer: [com.vysh.theeye/com.vysh.theeye.MainActivity](this:0xb4dd5000,id:270,api:1,p:-1,c:195) disconnect(P): api 1
04-24 19:34:28.697   195   822 I BufferQueueConsumer: [com.vysh.theeye/com.vysh.theeye.MainActivity](this:0xb4dd5000,id:270,api:1,p:-1,c:195) getReleasedBuffers: returning mask 0xffffffffffffffff
04-24 19:34:28.697   768  3699 I WindowState: WIN DEATH: Window{a34299a u0 com.vysh.theeye/com.vysh.theeye.MainActivity}
04-24 19:34:28.697   768  3699 V WindowManager: Remove Window{a34299a u0 com.vysh.theeye/com.vysh.theeye.MainActivity} client=1866e45, surface=Surface(name=com.vysh.theeye/com.vysh.theeye.MainActivity) Callers=com.android.server.wm.WindowState$DeathRecipient.binderDied:1217 android.os.BinderProxy.sendDeathNotice:566 <bottom of call stack> <bottom of call stack>
04-24 19:34:28.699   195   195 I BufferQueueConsumer: [com.vysh.theeye/com.vysh.theeye.MainActivity](this:0xb4dd5000,id:270,api:1,p:-1,c:-1) disconnect(C)
04-24 19:34:28.700   768  1633 D ActivityManager: SVC-handleAppDiedLocked: app = ProcessRecord{f2d64fb 31461:com.vysh.theeye/u0a119}, app.pid = 31461
04-24 19:34:28.702   195   821 I BufferQueue: [com.vysh.theeye/com.vysh.theeye.MainActivity](this:0xb4dd5000,id:270,api:1,p:-1,c:-1) ~BufferQueueCore
04-24 19:34:28.704   768  1633 W ActivityManager: Scheduling restart of crashed service com.vysh.theeye/.WatcherService in 10229ms
04-24 19:34:28.705   768  1633 D ActivityManager: removeDyingProviderLocked: cpr=ContentProviderRecord{6c3aebd u0 com.vysh.theeye/com.google.firebase.provider.FirebaseInitProvider} always=false inLaunching=false
04-24 19:34:28.705   768  1633 W ActivityManager: Force removing ActivityRecord{e3b6f3d u0 com.vysh.theeye/.MainActivity t2248}: app died, no saved state
04-24 19:34:28.639 768 1645 D Receiver控制器:在标识为1001的用户(0)处设置getBootReceiverEnabledSetting(com.vysh.theeye)
04-24 19:34:28.639 898 898 D应用程序更改接收器:回杀服务:com.vysh.theeye
04-24 19:34:28.642 768 1633 V包装控制器:强制停止包装:com.vysh.theeye
04-24 19:34:28.642 768 1633 I活动管理器:强制停止com.vysh.theeye appid=10119用户=0:来自pid 768
04-24 19:34:28.643 768 1633 I活动管理者:杀死31461:com.vysh.theeye/u0a119(形容词0):停止com.vysh.theeye
04-24 19:34:28.696 195 822 I BufferQueueProducer:[com.vysh.theeye/com.vysh.theeye.main活动](此:0xb4dd5000,id:270,api:1,p:-1,c:195)断开(p):api 1
04-24 19:34:28.697 195 822 I BufferQueueConsumer:[com.vysh.theeye/com.vysh.theeye.main活动](此:0xb4dd5000,id:270,api:1,p:-1,c:195)getReleasedBuffers:返回掩码0xFFFFFFFFFFFFFF
04-24 19:34:28.697 768 3699 I WindowState:WIN DEATH:Window{a34299a u0 com.vysh.theeye/com.vysh.theeye.main activity}
04-24 19:34:28.697 768 3699 V WindowManager:删除窗口{a34299a u0 com.vysh.theeye/com.vysh.theeye.main活动}客户端=1866e45,表面=surface(name=com.vysh.theeye/com.vysh.theeye.main活动)调用方=com.android.server.wm.WindowState$DeathRecipient.binderDied:1217 android.os.BinderProxy.sendDeathNotice:566
04-24 19:34:28.699 195 195 I BufferQueueConsumer:[com.vysh.theeye/com.vysh.theeye.main活动](此:0xb4dd5000,id:270,api:1,p:-1,c:-1)断开(c)
04-24 19:34:28.700 768 1633 D ActivityManager:SVC handleAppDiedLocked:app=ProcessRecord{f2d64fb 31461:com.vysh.theeye/u0a119},app.pid=31461
04-24 19:34:28.702 195 821 I BufferQueue:[com.vysh.theeye/com.vysh.theeye.main活动](此:0xb4dd5000,id:270,api:1,p:-1,c:-1)~BufferQueueCore
04-24 19:34:28.704 768 1633 W ActivityManager:计划在10229毫秒内重新启动崩溃的服务com.vysh.theeye/.WatcherService
04-24 19:34:28.705 768 1633 D活动管理器:RemovedingProviderLocked:cpr=ContentProviderRecord{6c3aebd u0 com.vysh.theeye/com.google.firebase.provider.FirebaseInitProvider}在启动时始终=false=false
04-24 19:34:28.705 768 1633 W活动管理器:强制删除活动记录{e3b6f3d u0 com.vysh.theeye/.main活动t2248}:应用程序已死亡,无保存状态

有趣的是,你能打开另一个终端并用
adb logcat
adb logcat | grep''检查完整的logcat吗?
@KrzysztofKubicki请检查编辑。包括你的主要活动javafile@amir那会有什么帮助?我正在清单中注册接收者。所有应用都被杀死了吗?