我更新了Android应用的代码,包括:
我的早期版本是在Eclipse中创建的,此更新我正在使用Android Studio。导入无效,因此我在Android studio中重新创建了该项目。而对于主要部分,它似乎工作正常。
但是,当应用程序第一次启动时,它很慢。在主屏幕显示之前,需要大约1.5秒的时间盯着白色屏幕。之后,该应用程序运行良好,快速。
重新启动它,将应用程序保留在内存中时会立即启动。如果您将应用程序从内存中取出,则需要另外1.5秒(/ 2秒)才能开始使用。
我在Nexus 7(2013)和FairPhone(Android 4.2.2)上进行了测试。我不明白问题出在哪里,也许你可以帮助我。解决方案会很棒,但即使指出原因也会有很大帮助。
App.java的相关代码(扩展应用程序):
@Override
public void onCreate() {
super.onCreate();
mContext = this;
Log.v("App","onCreate App - before GoogleAnalytics.getInstance(this)");
analytics = GoogleAnalytics.getInstance(this);
analytics.setLocalDispatchPeriod(1800); // every 30 minutes
tracker = analytics.newTracker("REMOVED CODE FOR STACKOVERLOW");
tracker.enableExceptionReporting(true);
// Since I do this 'by hand', enabling automatic will amount to double counting.
tracker.enableAutoActivityTracking(false);
Log.v("App", "onCreate App - after GA");
// Because it is initialized here, we don't need to put it as the application in Manifest
// This means we can use Google Analytics code referring to 'getApplication'.
ActiveAndroid.initialize(this);
Log.v("App", "onCreate App - after AA");
Gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
defaultConfig {
applicationId "com.juliushuijnk.tools.ideagrowr"
minSdkVersion 9
targetSdkVersion 22
versionCode 38
versionName "1.38"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:support-v4:22.2.1'
compile 'uk.co.ribot:easyadapter:1.4.0@aar'
compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
}
登录我的Fairphone(android 4.2.2)
07-19 14:18:24.517 18930-18930/com.juliushuijnk.tools.ideagrowr V/App﹕ onCreate App - before GoogleAnalytics.getInstance(this)
07-19 14:18:24.527 18930-18930/com.juliushuijnk.tools.ideagrowr I/dalvikvm﹕ Could not find method android.app.Notification$Builder.setLocalOnly, referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
07-19 14:18:24.527 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ VFY: unable to resolve virtual method 245: Landroid/app/Notification$Builder;.setLocalOnly (Z)Landroid/app/Notification$Builder;
07-19 14:18:24.528 18930-18930/com.juliushuijnk.tools.ideagrowr I/dalvikvm﹕ DexOpt: access denied from Lcom/google/android/gms/common/GooglePlayServicesUtil; to field Landroid/app/Notification;.extras
07-19 14:18:24.528 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ VFY: unable to resolve instance field 18
07-19 14:18:24.528 18930-18930/com.juliushuijnk.tools.ideagrowr E/dalvikvm﹕ Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
07-19 14:18:24.528 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ VFY: unable to resolve check-cast 25 (Landroid/app/AppOpsManager;) in Lcom/google/android/gms/common/GooglePlayServicesUtil;
07-19 14:18:24.530 18930-18930/com.juliushuijnk.tools.ideagrowr I/dalvikvm﹕ Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zzh
07-19 14:18:24.530 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ VFY: unable to resolve virtual method 553: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
07-19 14:18:24.534 18930-18930/com.juliushuijnk.tools.ideagrowr I/GAv4﹕ Google Analytics 7.5.71 is starting up. To enable debug logging on a device run:
adb shell setprop log.tag.GAv4 DEBUG
adb logcat -s GAv4
07-19 14:18:24.538 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.MainActivity
07-19 14:18:24.547 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.AllIdeasActivity
07-19 14:18:24.548 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.AllNotesActivity
07-19 14:18:24.548 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.CreateIdeaActivity
07-19 14:18:24.548 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.CreateNoteActivity
07-19 14:18:24.549 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.DeleteIdeaActivity
07-19 14:18:24.549 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.OverviewActivity
07-19 14:18:24.549 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.InfoActivity
07-19 14:18:24.550 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.EditQsetActivity
07-19 14:18:24.550 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.LikeActivity
07-19 14:18:24.550 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.MigrateDatabaseActivity
07-19 14:18:24.550 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.SettingsActivity
07-19 14:18:24.551 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.UpdateCoreActivity
07-19 14:18:24.553 18930-18930/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ Bool xml configuration name not recognized: ga_reportUncaughtExceptions
07-19 14:18:24.573 18930-18930/com.juliushuijnk.tools.ideagrowr V/App﹕ onCreate App - after GA
07-19 14:18:24.636 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Unable to resolve superclass of Landroid/support/v4/app/ActivityCompat21$SharedElementCallbackImpl; (54)
07-19 14:18:24.636 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/app/ActivityCompat21$SharedElementCallbackImpl;' failed
07-19 14:18:24.666 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Unable to resolve superclass of Landroid/support/v4/app/FragmentTransitionCompat21$1; (1697)
07-19 14:18:24.666 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/app/FragmentTransitionCompat21$1;' failed
07-19 14:18:24.667 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Unable to resolve superclass of Landroid/support/v4/app/FragmentTransitionCompat21$3; (1697)
07-19 14:18:24.667 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/app/FragmentTransitionCompat21$3;' failed
07-19 14:18:24.687 18930-18930/com.juliushuijnk.tools.ideagrowr I/dalvikvm﹕ Failed resolving Landroid/support/v4/media/TransportMediatorJellybeanMR2$1; interface 1775 'Landroid/view/ViewTreeObserver$OnWindowAttachListener;'
07-19 14:18:24.687 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/media/TransportMediatorJellybeanMR2$1;' failed
07-19 14:18:24.688 18930-18930/com.juliushuijnk.tools.ideagrowr I/dalvikvm﹕ Failed resolving Landroid/support/v4/media/TransportMediatorJellybeanMR2$2; interface 1776 'Landroid/view/ViewTreeObserver$OnWindowFocusChangeListener;'
07-19 14:18:24.688 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/media/TransportMediatorJellybeanMR2$2;' failed
07-19 14:18:24.689 18930-18930/com.juliushuijnk.tools.ideagrowr I/dalvikvm﹕ Failed resolving Landroid/support/v4/media/TransportMediatorJellybeanMR2; interface 197 'Landroid/media/RemoteControlClient$OnGetPlaybackPositionListener;'
07-19 14:18:24.689 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/media/TransportMediatorJellybeanMR2;' failed
07-19 14:18:24.690 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Unable to resolve superclass of Landroid/support/v4/media/VolumeProviderCompatApi21$1; (202)
07-19 14:18:24.690 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/media/VolumeProviderCompatApi21$1;' failed
07-19 14:18:24.705 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Unable to resolve superclass of Landroid/support/v4/media/session/MediaControllerCompatApi21$CallbackProxy; (203)
07-19 14:18:24.705 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/media/session/MediaControllerCompatApi21$CallbackProxy;' failed
07-19 14:18:24.708 18930-18930/com.juliushuijnk.tools.ideagrowr I/dalvikvm﹕ Failed resolving Landroid/support/v4/media/session/MediaSessionCompatApi18$OnPlaybackPositionUpdateListener; interface 199 'Landroid/media/RemoteControlClient$OnPlaybackPositionUpdateListener;'
07-19 14:18:24.708 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/media/session/MediaSessionCompatApi18$OnPlaybackPositionUpdateListener;' failed
07-19 14:18:24.709 18930-18930/com.juliushuijnk.tools.ideagrowr I/dalvikvm﹕ Failed resolving Landroid/support/v4/media/session/MediaSessionCompatApi19$OnMetadataUpdateListener; interface 198 'Landroid/media/RemoteControlClient$OnMetadataUpdateListener;'
07-19 14:18:24.709 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/media/session/MediaSessionCompatApi19$OnMetadataUpdateListener;' failed
07-19 14:18:24.816 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Unable to resolve superclass of Landroid/support/v4/media/session/MediaSessionCompatApi21$CallbackProxy; (207)
07-19 14:18:24.816 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/media/session/MediaSessionCompatApi21$CallbackProxy;' failed
07-19 14:18:24.823 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Unable to resolve superclass of Landroid/support/v4/print/PrintHelperKitkat$1; (264)
07-19 14:18:24.823 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/print/PrintHelperKitkat$1;' failed
07-19 14:18:24.824 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Unable to resolve superclass of Landroid/support/v4/print/PrintHelperKitkat$2; (264)
07-19 14:18:24.824 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/print/PrintHelperKitkat$2;' failed
07-19 14:18:24.847 18930-18930/com.juliushuijnk.tools.ideagrowr I/dalvikvm﹕ Failed resolving Landroid/support/v4/view/ViewCompatLollipop$1; interface 1754 'Landroid/view/View$OnApplyWindowInsetsListener;'
07-19 14:18:24.847 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/view/ViewCompatLollipop$1;' failed
07-19 14:18:24.867 18930-18930/com.juliushuijnk.tools.ideagrowr I/dalvikvm﹕ Failed resolving Landroid/support/v4/widget/DrawerLayoutCompatApi21$InsetsListener; interface 1754 'Landroid/view/View$OnApplyWindowInsetsListener;'
07-19 14:18:24.867 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Landroid/support/v4/widget/DrawerLayoutCompatApi21$InsetsListener;' failed
07-19 14:18:24.904 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ method Landroid/support/v7/internal/widget/ListViewCompat;.lookForSelectablePosition incorrectly overrides package-private method with same name in Landroid/widget/ListView;
07-19 14:18:25.319 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Unable to resolve superclass of Luk/co/ribot/easyadapter/BaseEasyRecyclerAdapter$RecyclerViewHolder; (1642)
07-19 14:18:25.319 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Luk/co/ribot/easyadapter/BaseEasyRecyclerAdapter$RecyclerViewHolder;' failed
07-19 14:18:25.320 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Unable to resolve superclass of Luk/co/ribot/easyadapter/BaseEasyRecyclerAdapter; (1641)
07-19 14:18:25.320 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Luk/co/ribot/easyadapter/BaseEasyRecyclerAdapter;' failed
07-19 14:18:25.680 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Unable to resolve superclass of Luk/co/ribot/easyadapter/BaseEasyRecyclerAdapter; (1641)
07-19 14:18:25.680 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Luk/co/ribot/easyadapter/BaseEasyRecyclerAdapter;' failed
07-19 14:18:25.680 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Unable to resolve superclass of Luk/co/ribot/easyadapter/EasyRecyclerAdapter; (7387)
07-19 14:18:25.680 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ Link of class 'Luk/co/ribot/easyadapter/EasyRecyclerAdapter;' failed
07-19 14:18:26.240 18930-18930/com.juliushuijnk.tools.ideagrowr V/App﹕ onCreate App - after AA
07-19 14:18:26.471 18930-18930/com.juliushuijnk.tools.ideagrowr V/App﹕ end of onCreate App
07-19 14:18:26.559 18930-18930/com.juliushuijnk.tools.ideagrowr I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
07-19 14:18:26.559 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ VFY: unable to resolve virtual method 630: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
07-19 14:18:26.560 18930-18930/com.juliushuijnk.tools.ideagrowr I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
07-19 14:18:26.560 18930-18930/com.juliushuijnk.tools.ideagrowr W/dalvikvm﹕ VFY: unable to resolve virtual method 652: Landroid/content/res/TypedArray;.getType (I)I
07-19 14:18:26.822 18930-18930/com.juliushuijnk.tools.ideagrowr V/MainActivity﹕ called onCreate MainActivity
因此谷歌分析出现了问题,但这并不是减缓应用启动速度的主要因素。主要问题似乎是这样的界限:
Unable to resolve superclass of Landroid/support/v4/app/ActivityCompat21$SharedElementCallbackImpl; (54)
我不知道如何解决这些问题,因为带有这些类型的日志消息的其他StackOverflow帖子假定它是关于.jar库并且它在Eclipse上。
喜欢这里: Android - Unable to resolve superclass 两者都不适用于我的问题(据我所知)。
在Nexus 7(2013)上,应用程序的启动速度也很慢,但日志文件提供了不同的读数:
07-19 14:48:05.631 26840-26840/com.juliushuijnk.tools.ideagrowr V/App﹕ onCreate App - before GoogleAnalytics.getInstance(this)
07-19 14:48:05.640 26840-26840/com.juliushuijnk.tools.ideagrowr I/GAv4﹕ Google Analytics 7.5.71 is starting up. To enable debug logging on a device run:
adb shell setprop log.tag.GAv4 DEBUG
adb logcat -s GAv4
07-19 14:48:05.645 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.MainActivity
07-19 14:48:05.656 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.AllIdeasActivity
07-19 14:48:05.656 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.AllNotesActivity
07-19 14:48:05.656 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.CreateIdeaActivity
07-19 14:48:05.656 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.CreateNoteActivity
07-19 14:48:05.657 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.DeleteIdeaActivity
07-19 14:48:05.657 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.OverviewActivity
07-19 14:48:05.657 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.InfoActivity
07-19 14:48:05.658 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.EditQsetActivity
07-19 14:48:05.658 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.LikeActivity
07-19 14:48:05.658 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.MigrateDatabaseActivity
07-19 14:48:05.658 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.SettingsActivity
07-19 14:48:05.659 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ String xml configuration name not recognized: com.juliushuijnk.tools.ideagrowr.UpdateCoreActivity
07-19 14:48:05.659 26840-26840/com.juliushuijnk.tools.ideagrowr W/GAv4﹕ Bool xml configuration name not recognized: ga_reportUncaughtExceptions
07-19 14:48:05.689 26840-26840/com.juliushuijnk.tools.ideagrowr V/App﹕ onCreate App - after GA
07-19 14:48:06.082 26840-26840/com.juliushuijnk.tools.ideagrowr W/art﹕ Before Android 4.1, method int android.support.v7.internal.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
07-19 14:48:07.580 26840-26840/com.juliushuijnk.tools.ideagrowr I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<uk.co.ribot.easyadapter.BaseEasyRecyclerAdapter$RecyclerViewHolder>
07-19 14:48:07.580 26840-26840/com.juliushuijnk.tools.ideagrowr I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<uk.co.ribot.easyadapter.BaseEasyRecyclerAdapter$RecyclerViewHolder>
07-19 14:48:07.581 26840-26840/com.juliushuijnk.tools.ideagrowr I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<uk.co.ribot.easyadapter.BaseEasyRecyclerAdapter>
07-19 14:48:07.581 26840-26840/com.juliushuijnk.tools.ideagrowr I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<uk.co.ribot.easyadapter.BaseEasyRecyclerAdapter>
07-19 14:48:07.583 26840-26840/com.juliushuijnk.tools.ideagrowr I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<uk.co.ribot.easyadapter.BaseEasyRecyclerAdapter>
07-19 14:48:07.583 26840-26840/com.juliushuijnk.tools.ideagrowr I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<uk.co.ribot.easyadapter.EasyRecyclerAdapter>
07-19 14:48:07.583 26840-26840/com.juliushuijnk.tools.ideagrowr I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<uk.co.ribot.easyadapter.EasyRecyclerAdapter>
07-19 14:48:07.592 26840-26840/com.juliushuijnk.tools.ideagrowr V/App﹕ onCreate App - after AA
07-19 14:48:07.606 26840-26840/com.juliushuijnk.tools.ideagrowr V/App﹕ end of onCreate App
07-19 14:48:07.690 26840-26840/com.juliushuijnk.tools.ideagrowr V/MainActivity﹕ called onCreate MainActivity
虽然大部分内容我都不完全理解,但我认为这是最奇怪的一句话:
Before Android 4.1, method int android.support.v7.internal.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
如果有帮助,清单文件的开头:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.juliushuijnk.tools.ideagrowr"
android:installLocation="auto" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:name=".App"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.myTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
进一步背景:我不是专业的软件开发人员,这是一个宠物项目。如何处理这样的问题也很棒。
答案 0 :(得分:1)
有些需要解决的问题:
首先,请确保已在项目中导入v4和v7支持库...有关更具体的结果,,请参阅以下内容:
从错误开始:
Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
&lt; - 检查https://stackoverflow.com/a/29276586/928952
警告:
无法识别字符串xml配置名称:com.juliushuijnk.tools.ideagrowr.*
&lt; - check https://stackoverflow.com/a/23418561/928952
似乎很慢:DexOpt: access denied from Lcom/google/android/gms/common/GooglePlayServicesUtil
&lt; - 检查https://stackoverflow.com/a/30052809/928952
班级Landroid/support/v4/*
的链接&lt; - 检查您是否已导入支持v4 jar
VFY: unable to resolve virtual method 630: Landroid/content/res/TypedArray
&lt; - 添加支持v7 jar
修复上述内容应有助于加快启动时间
答案 1 :(得分:1)
我自己想通了。所以最后,这是由于我如何实现ActiveAndroid库。
除非您使用有助于AA快速查找模型的配置,否则它会让您的应用启动非常慢。
我使用此代码修复它: How to disable scanning for model in Activeandroid
这样的代码(但我有不同的型号名称):
Configuration.Builder configurationBuilder = new Configuration.Builder(this);
configurationBuilder.addModelClasses(Test.class);
configurationBuilder.addModelClasses(ShoppingList.class);
configurationBuilder.addModelClasses(ShoppingListItem.class);
configurationBuilder.addModelClasses(ArticleInfoModel.class);
ActiveAndroid.initialize(configurationBuilder.create());
现在几乎是即时的。我仍然不确定为什么我得到所有这些奇怪的logcat条目。所有'无法解析超类'的地方可能是某种间接的AA如何在没有配置的情况下运行。自从我添加配置以来,这些行已经消失了。
这些logcat行混淆了我寻找与gradle和支持库有关的答案,但这不是问题的起源。
所以我应该从一开始就实现了这种配置。但是它在AA上写的方式让人觉得“很高兴”。
https://github.com/pardom/ActiveAndroid/wiki/Creating-your-database-mode
所以我了解到,下次当我看到一些我觉得“很高兴”的东西时,我应该在评论中写下我的假设,所以如果我遇到问题,我可以很快看到我可能需要改变的地方。
感谢Danielson试图提供帮助:)。
答案 2 :(得分:0)
Android应用启动缓慢,但在启动缓慢后工作正常 ,这是因为当您的应用程序销毁时,应用程序缓存会清除(如果您的清算)否则或来自settings-&gt; apps-&gt; yourapp这两个中的任何一个。当再次启动应用程序时,你会发现这个问题。