Java &引用;应用程序isn';“t回应”;一旦启动应用程序

Java &引用;应用程序isn';“t回应”;一旦启动应用程序,java,android,multithreading,performance,Java,Android,Multithreading,Performance,当我在应用程序上工作时,我点击run,一旦应用程序启动,它就会在打开启动屏幕之前卡住,并向我显示“应用程序没有响应,你想关闭它吗”对话框 !!我甚至没有打开闪屏课程。!我在OnCreate中添加了一些日志,但是它没有显示在logcat中,我创建了一个新的空活动,并将其设置为launcher活动,同样的事情也发生了 根据我的经验,当我在执行线程代码时误用while循环或某些bug时,此对话框将显示出来。!但这太奇怪了 你们觉得呢,伙计们 #更新1 当对话框显示时,我在logcat上找到了这一行 E

当我在应用程序上工作时,我点击run,一旦应用程序启动,它就会在打开启动屏幕之前卡住,并向我显示“应用程序没有响应,你想关闭它吗”对话框

!!我甚至没有打开闪屏课程。!我在
OnCreate
中添加了一些日志,但是它没有显示在
logcat
中,我创建了一个新的空活动,并将其设置为launcher活动,同样的事情也发生了

根据我的经验,当我在执行线程代码时误用while循环或某些bug时,此对话框将显示出来。!但这太奇怪了

你们觉得呢,伙计们

#更新1 当对话框显示时,我在
logcat
上找到了这一行

E/com.facebook.internal.AttributeIdentifiers:不应从主线程调用GetAttributeIdentifiers


启动器活动

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}
这是我的
bluid.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '27.0.3'

    dexOptions {
        javaMaxHeapSize "4g"
    }


    lintOptions {
        quiet true
        abortOnError false
        ignoreWarnings true
    }
    configurations {
        all*.exclude group: 'commons-io'

    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'BinaryEncoder.java'
    }

    defaultConfig {
        applicationId "xxxxxxx"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 3
        versionName "1.2"
        multiDexEnabled true
        ndk {
            abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
        }
        resConfigs "en"

    }
    sourceSets {
        main {
            java {
                exclude 'com.twilio:client-android:1.2.18.org.apache.http.lejacy.jar.org.apache.BinaryEncoder.java'
                exclude 'org.apache.commons.codec.BinaryEncoder.java'
            }
        }
        androidTest {
            java {
                exclude 'commons-codec-1.10/**'
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
}


dependencies {
    compile fileTree(include: '*.jar', dir: 'libs')
    compile files('libs/YouTubeAndroidPlayerApi.jar')
    compile("com.github.hotchemi:permissionsdispatcher:2.4.0") {
        // if you don't use android.app.Fragment you can exclude support for them
        exclude module: "support-v13"
    }
    configurations {
        all*.exclude group: 'com.android.support', module: 'support-v13'
    }


    compile 'com.stripe:stripe-android:7.0.1'
    compile 'com.braintreepayments.api:braintree:2.7.0'
    compile 'com.braintreepayments.api:drop-in:3.1.0'
    compile 'jp.wasabeef:recyclerview-animators:2.2.7'
    compile 'com.github.markomilos:paginate:0.5.1'
    compile 'com.github.czy1121:segmentedview:1.0.0'
    implementation 'com.orhanobut:logger:2.2.0'
    compile 'com.twilio:client-android:1.2.18'
    compile 'com.squareup.okio:okio:1.11.0'
    compile 'com.squareup.retrofit2:retrofit:2.2.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
    compile 'com.github.mukeshsolanki:country-picker-android:1.1.9'
    compile 'com.google.android.gms:play-services-gcm:11.4.0'
    compile 'com.google.android.gms:play-services-identity:11.4.0'
    compile 'com.google.android.gms:play-services-plus:11.4.0'
    compile 'com.google.android.gms:play-services-maps:11.4.0'
    compile 'lib.kingja.switchbutton:switchbutton:1.1.3'
    compile 'com.orhanobut:hawk:2.0.1'
    compile 'com.afollestad:material-camera:0.4.4'
    compile 'com.werb.pickphotoview:pickphotoview:0.3.0'
    compile 'com.github.Kennyc1012:BottomSheet:2.3.4'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.android.support:design:26.0.1'
    compile 'com.android.support:cardview-v7:26.0.1'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.google.code.gson:gson:2.8.1'
    compile 'com.squareup.okhttp:okhttp:2.5.0'
    compile 'de.greenrobot:eventbus:2.4.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.paypal.sdk:paypal-android-sdk:2.14.4'
    compile 'com.koushikdutta.ion:ion:2.1.8'
    compile 'com.afollestad.material-dialogs:core:0.8.6.0'
    compile 'com.amitshekhar.android:android-networking:1.0.0'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.android.support:support-v4:26.0.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-messaging:11.4.0'
    compile 'com.google.firebase:firebase-core:11.4.0'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:2.4.0'
}
apply plugin: 'com.google.gms.google-services'

就是这条线,我试过了,它成功了

E/com.facebook.internal.AttributionIdentifiers: getAttributionIdentifiers should not be called from the main thread

张贴你的发射器Activity@GhulamMoinulQuadir完成