应用程序需要很长时间来加载第一个活动

时间:2016-04-12 15:02:02

标签: android

我的应用程序在调用我的应用程序的启动器活动的onCreate方法之前,已经在Nexus 6上捣了很长时间~20秒。 这些是我的第一个活动变得可见之前的日志。

04-12 19:30:46.564 12518-12518/com.dealsmash.dealsmashapp W/System: ClassLoader referenced unknown path: /data/app/com.dealsmash.dealsmashapp-1/lib/arm
04-12 19:31:05.862 12518-12518/com.dealsmash.dealsmashapp W/System: ClassLoader referenced unknown path: /data/app/com.dealsmash.dealsmashapp-1/lib/arm
04-12 19:31:05.909 12518-12518/com.dealsmash.dealsmashapp I/MultiDex: VM with version 2.1.0 has multidex support
04-12 19:31:05.909 12518-12518/com.dealsmash.dealsmashapp I/MultiDex: install
04-12 19:31:05.910 12518-12518/com.dealsmash.dealsmashapp I/MultiDex: VM has multidex support, MultiDex support library is disabled.
04-12 19:31:06.045 12518-13453/com.dealsmash.dealsmashapp I/GMPM: App measurement is starting up
04-12 19:31:06.174 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162190): avc: denied { getattr } for path="/proc/sysrq-trigger" dev="proc" ino=4026544381 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_sysrq:s0 tclass=file permissive=0
04-12 19:31:06.174 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162191): avc: denied { getattr } for path="/proc/1" dev="proc" ino=8630890 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:init:s0 tclass=dir permissive=0
04-12 19:31:06.174 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162192): avc: denied { getattr } for path="/proc/2" dev="proc" ino=8630891 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.174 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162193): avc: denied { getattr } for path="/proc/3" dev="proc" ino=8630892 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.174 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162194): avc: denied { getattr } for path="/proc/7" dev="proc" ino=8630893 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.174 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162195): avc: denied { getattr } for path="/proc/8" dev="proc" ino=8630894 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.174 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162196): avc: denied { getattr } for path="/proc/9" dev="proc" ino=8630895 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.174 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162197): avc: denied { getattr } for path="/proc/10" dev="proc" ino=8630896 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.174 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162198): avc: denied { getattr } for path="/proc/11" dev="proc" ino=8630897 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.174 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162199): avc: denied { getattr } for path="/proc/12" dev="proc" ino=8630898 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.174 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162200): avc: denied { getattr } for path="/proc/15" dev="proc" ino=8630899 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.174 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162201): avc: denied { getattr } for path="/proc/16" dev="proc" ino=8630900 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.184 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162202): avc: denied { getattr } for path="/proc/19" dev="proc" ino=8630901 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.184 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162203): avc: denied { getattr } for path="/proc/20" dev="proc" ino=8630902 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.184 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162204): avc: denied { getattr } for path="/proc/23" dev="proc" ino=8630903 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.184 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162205): avc: denied { getattr } for path="/proc/24" dev="proc" ino=8630904 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.184 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162206): avc: denied { getattr } for path="/proc/26" dev="proc" ino=8630905 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.184 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162207): avc: denied { getattr } for path="/proc/28" dev="proc" ino=8630906 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.184 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162208): avc: denied { getattr } for path="/proc/29" dev="proc" ino=8630907 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:06.184 12518-12518/com.dealsmash.dealsmashapp W/sh.dealsmashapp: type=1400 audit(0.0:162209): avc: denied { getattr } for path="/proc/30" dev="proc" ino=8630908 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
04-12 19:31:08.740 12518-12518/com.dealsmash.dealsmashapp I/CrashlyticsCore: Initializing Crashlytics 2.3.8.97
04-12 19:31:08.772 12518-12518/com.dealsmash.dealsmashapp D/LoginManager: initInstance
04-12 19:31:08.817 12518-12518/com.dealsmash.dealsmashapp D/ContentManager: initInstance
04-12 19:31:08.825 12518-12518/com.dealsmash.dealsmashapp D/BeaconManager: initInstance
04-12 19:31:08.907 12518-13554/com.dealsmash.dealsmashapp D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
04-12 19:31:09.086 12518-12518/com.dealsmash.dealsmashapp D/LoginActivity: onCreate
04-12 19:31:09.585 12518-12524/com.dealsmash.dealsmashapp W/art: Suspending all threads took: 11.012ms
04-12 19:31:09.727 12518-12518/com.dealsmash.dealsmashapp D/ContentManager: fetching all interests
04-12 19:31:09.904 12518-13554/com.dealsmash.dealsmashapp I/Adreno: QUALCOMM build                   : 52af4d2, I8366cd0437
                                                                Build Date                       : 10/20/15
                                                                OpenGL ES Shader Compiler Version: XE031.05.13.02
                                                                Local Branch                     : M14
                                                                Remote Branch                    : 
                                                                Remote Branch                    : 
                                                                Reconstruct Branch               : 
04-12 19:31:09.909 12518-13554/com.dealsmash.dealsmashapp I/OpenGLRenderer: Initialized EGL, version 1.4

请注意,应用程序在第46秒开始,但我的第一个活动onCreate的{​​{1}}方法在下一分钟的第9秒被调用。
首先,我怀疑这是由于一些新添加的依赖,但问题仍然是我删除它们后。这是我的模块的LoginActivity文件,以防万一。

build.gradle

这是我的buildscript { repositories { maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'io.fabric.tools:gradle:1.+' } } apply plugin: 'com.android.application' apply plugin: 'io.fabric' apply plugin: 'com.google.gms.google-services' android { signingConfigs { releaseConfig { keyAlias 'ds_a' keyPassword 'dealsmash' storeFile file('C:/Android/keystore/dealsmash_android.keystore') storePassword 'dealsmash' } } compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.dealsmash.dealsmashapp" minSdkVersion 15 targetSdkVersion 22 versionCode 21 versionName "2.1" multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' zipAlignEnabled true signingConfig signingConfigs.releaseConfig } debug { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } dexOptions { javaMaxHeapSize "4g" } packagingOptions { exclude 'main/AndroidManifest.xml' } } repositories { mavenCentral() maven { url 'https://maven.fabric.io/public' } maven { url "https://jitpack.io" } maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } // maven { url 'https://github.com/taplytics/Taplytics-Android-SDK/raw/master/AndroidStudio/' } } dependencies { compile 'com.facebook.android:facebook-android-sdk:4.7.0' compile 'com.android.support:multidex:1.0.1' compile 'com.shamanland:xdroid-toaster:0.2.4' compile 'com.kontaktio.sdk:kontakt-sdk:2.1.2' compile 'com.google.android.gms:play-services:8.3.0' compile "com.android.support:design:${android_support_lib_version}" compile "com.android.support:cardview-v7:${android_support_lib_version}" compile 'com.github.bumptech.glide:glide:3.6.1' compile 'com.mcxiaoke.volley:library:1.0.17' compile 'com.google.zxing:core:3.2.0' compile 'com.google.code.gson:gson:2.4' compile 'com.google.android.gms:play-services-analytics:8.3.0' compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') { transitive = true; } // compile 'com.github.javiersantos:MaterialStyledDialogs:1.3' compile 'com.bugfender.sdk:android:0.1.8-SNAPSHOT' // compile 'com.github.nitinverma:ViewPagerIndicator:2.4.2.0:release@aar' // Taplytics // compile("com.taplytics.sdk:taplytics:+@aar") // Dependencies for Taplytics // compile("com.squareup.okhttp:okhttp-urlconnection:+") // compile("com.squareup.okhttp:okhttp:+") //Excluding org.json due to compiler warnings // compile("com.github.nkzawa:socket.io-client:+") { // exclude group: "org.json" // } // compile("com.github.nkzawa:engine.io-client:+") { // exclude group: "org.json" // } } 课程。

Application

1 个答案:

答案 0 :(得分:1)

要找出哪种方法需要很长时间,您可以尝试使用它 http://developer.android.com/tools/debugging/debugging-tracing.html

你真的需要创建应用程序中的所有方法吗?我认为其中一个需要一段时间