对,所以在叹气之前,请先阅读。
我是一个新的业余程序员,确实需要您的帮助。
我在运行4.4.2的电话上调试我的应用程序,并且在调试过程中一直工作,但是当我断开USB电缆的连接时,它显示“不幸的是LSA已停止”(我什至尝试将其导出为已签名的应用程序并安装在通电话。)
这是清单文件,但是如果您需要其他文件,请询问。抱歉,如果答案很简单,或者已经回答过(我确定没有),谢谢。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lsa"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="16"
    android:targetSdkVersion="21" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".LoginActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".Contents"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".RevPage"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
</application>

</manifest>


编辑
我在堆栈跟踪中找到了这个

12-04 18:57:59.165    4410-4465/lawnswood.lsa E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1
Process: lawnswood.lsa, PID: 4410
java.lang.RuntimeException: An error occured while executing doInBackground()
        at android.os.AsyncTask$3.done(AsyncTask.java:300)
        at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
        at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
        at java.util.concurrent.FutureTask.run(FutureTask.java:242)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
        at java.lang.Thread.run(Thread.java:841)
 Caused by: java.lang.SecurityException: Permission Denial: reading   com.android.providers.contacts.ContactsProvider2 uri content://com.android.contacts/profile/data from   pid=4410, uid=10186 requires android.permission.READ_CONTACTS, or grantUriPermission()
        at android.os.Parcel.readException(Parcel.java:1465)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
        at android.content.ContentProviderProxy.query(ContentProviderNative.java:413)
        at android.content.ContentResolver.query(ContentResolver.java:464)
        at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)
        at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:631)
        at android.content.ContentResolver.query(Native Method)
        at android.content.CursorLoader.loadInBackground(CursorLoader.java:65)
        at android.content.CursorLoader.loadInBackground(CursorLoader.java:43)
        at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
        at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
        at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:57)
        at android.os.AsyncTask$2.call(AsyncTask.java:288)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:841)

最佳答案

Caused by: java.lang.SecurityException: Permission Denial: reading   com.android.providers.contacts.ContactsProvider2 uri content://com.android.contacts/profile/data from   pid=4410, uid=10186 requires android.permission.READ_CONTACTS, or grantUriPermission()


这对我说,您需要将<uses-permission android:name="android.permission.READ_CONTACTS">放入您的android清单中,因为您似乎正在尝试读取联系人列表,但没有权限。它可能在调试时起作用,因为调试允许它在未经许可的情况下运行,但是我不确定。

关于java - 不幸的是<App Name>已停止。请阅读:不一样,我保证,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/27256492/

10-10 01:50