简体   繁体   English

Android App不断在Build上崩溃。 调试器只显示很少

[英]Android App keeps crashing on Build. Debugger only shows little

I have a simple application with two activities. 我有两个活动的简单应用程序。 A Connection Activity that establishes a Bluetooth connection; 建立蓝牙连接的连接活动; and a PollTaker Activity that gets a message and manipulates the data from there. 还有一个PollTaker Activity,它获取一条消息并从那里处理数据。

The manifest is like so: http://pastebin.com/xFs3AdrF 清单是这样的: http : //pastebin.com/xFs3AdrF

When the app starts it should begin with a Connection activity that is also the default and load up the following content view: http://pastebin.com/KCDeAki1 当应用启动时,它应该以默认也是Connection活动开始,并加载以下内容视图: http : //pastebin.com/KCDeAki1

I went and checked previous questions and this was the closest I could find: New app crashing on start-up, debug not helping 我去检查了以前的问题,这是我能找到的最接近的问题: 新应用在启动时崩溃,调试无济于事

However I have my components being set AFTER I call setContentView() in onCreate. 但是,我在onCreate中调用setContentView()之后设置了组件。 Am I misunderstanding something or did I incorrectly implement this? 我是误解了什么,还是执行不正确?

Code for my Connection activity: http://pastebin.com/GcZyDayc 我的连接活动的代码: http : //pastebin.com/GcZyDayc

EDIT: Forgot to mention I had my own debug logs written and all that shows up is the Log in onCreate(). 编辑:忘了提我写了我自己的调试日志,显示的全部是onCreate()中的日志。

After testing it turned out to be something with my Android SDK Files with BT. 经过测试,事实证明这与我带有BT的Android SDK文件有关。 As soon as I commented out the 我一评论出

btAdapter = BluetoothAdapter.getDefaultAdapter();
CheckBTState();

in my connection class my app loaded up the first page. 在我的连接类中,我的应用程序加载了第一页。 However this confuses me since the test app I based this on uses the same Adapter Test to enable it at start with no problems. 但是,这使我感到困惑,因为我所基于的测试应用程序使用相同的适配器测试来在启动时毫无问题地启用它。 Probably incorrectly loaded SDK files. 可能是错误地加载了SDK文件。

EDIT: Newbie Developer mistake. 编辑:新手开发人员错误。 I forgot to add the user permissions for BT in my manifest. 我忘了在清单中添加BT的用户权限。 (Doh...) (Do ...)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM