Android 6.0 - 坚持第一个活动

时间:2016-04-19 16:53:03

标签: java android android-studio android-activity android-6.0-marshmallow

我有一个使用LoadingActivity打开的应用程序,然后根据用户是否经过身份验证将用户引导到相应的活动。

该应用程序运行良好,但最近我更新了Android Studio和build.gradle中的所有库。我的应用程序现在处于不通过LoadingActivity的状态。我使用Firebase来确定身份验证。

LoadingActivity

public class LoadingActivity extends AppCompatActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_loading);
    Firebase.setAndroidContext(this);

    final Firebase userRef = FirebaseUtil.FIREBASE.child("Users");
    final AuthData authData = userRef.getAuth();

    if (authData != null) {
        startActivity(new Intent(LoadingActivity.this, MainActivity.class));
    } else {
        startActivity(new Intent(LoadingActivity.this, SignupActivity.class));
        finish();
    }
  }
}

堆栈跟踪:

    04-19 12:46:56.919 1316-1316/com.sourcey.materialloginexample W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)
04-19 12:46:56.923 1316-1316/com.sourcey.materialloginexample I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested
04-19 12:46:56.923 1316-1316/com.sourcey.materialloginexample W/dalvikvm: VFY: unable to resolve interface method 19395: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z
04-19 12:46:56.923 1316-1316/com.sourcey.materialloginexample D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
04-19 12:46:56.923 1316-1316/com.sourcey.materialloginexample I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode
04-19 12:46:56.923 1316-1316/com.sourcey.materialloginexample W/dalvikvm: VFY: unable to resolve interface method 19399: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
04-19 12:46:56.923 1316-1316/com.sourcey.materialloginexample D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
04-19 12:46:57.043 1316-1316/com.sourcey.materialloginexample I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable
04-19 12:46:57.043 1316-1316/com.sourcey.materialloginexample W/dalvikvm: VFY: unable to resolve virtual method 563: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
04-19 12:46:57.047 1316-1316/com.sourcey.materialloginexample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
04-19 12:46:57.055 1316-1316/com.sourcey.materialloginexample I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity
04-19 12:46:57.055 1316-1316/com.sourcey.materialloginexample W/dalvikvm: VFY: unable to resolve virtual method 565: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
04-19 12:46:57.059 1316-1316/com.sourcey.materialloginexample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
04-19 12:46:57.079 1316-1316/com.sourcey.materialloginexample D/dalvikvm: GC_FOR_ALLOC freed 125K, 25% free 2553K/3392K, paused 10ms, total 18ms
04-19 12:46:57.083 1316-1316/com.sourcey.materialloginexample I/dalvikvm-heap: Grow heap (frag case) to 5.436MB for 2359308-byte allocation
04-19 12:46:57.087 1316-1322/com.sourcey.materialloginexample D/dalvikvm: GC_FOR_ALLOC freed 0K, 15% free 4857K/5700K, paused 2ms, total 2ms
04-19 12:46:57.395 1316-1316/com.sourcey.materialloginexample I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations
04-19 12:46:57.395 1316-1316/com.sourcey.materialloginexample W/dalvikvm: VFY: unable to resolve virtual method 600: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
04-19 12:46:57.395 1316-1316/com.sourcey.materialloginexample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
04-19 12:46:57.395 1316-1316/com.sourcey.materialloginexample I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
04-19 12:46:57.395 1316-1316/com.sourcey.materialloginexample W/dalvikvm: VFY: unable to resolve virtual method 622: Landroid/content/res/TypedArray;.getType (I)I
04-19 12:46:57.395 1316-1316/com.sourcey.materialloginexample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
04-19 12:46:57.511 1316-1334/com.sourcey.materialloginexample D/dalvikvm: GC_FOR_ALLOC freed 446K, 19% free 5211K/6368K, paused 2ms, total 2ms
04-19 12:46:57.523 1316-1316/com.sourcey.materialloginexample I/AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
04-19 12:46:57.535 1316-1316/com.sourcey.materialloginexample D/dalvikvm: GC_FOR_ALLOC freed 206K, 18% free 5533K/6692K, paused 3ms, total 4ms
04-19 12:46:57.535 1316-1316/com.sourcey.materialloginexample I/dalvikvm-heap: Grow heap (frag case) to 7.171MB for 1127532-byte allocation
04-19 12:46:57.543 1316-1334/com.sourcey.materialloginexample D/dalvikvm: GC_FOR_ALLOC freed 1K, 15% free 6633K/7796K, paused 6ms, total 6ms
04-19 12:46:57.547 1316-1316/com.sourcey.materialloginexample D/dalvikvm: GC_FOR_ALLOC freed 1K, 15% free 6632K/7796K, paused 3ms, total 3ms
04-19 12:46:57.547 1316-1316/com.sourcey.materialloginexample I/dalvikvm-heap: Grow heap (frag case) to 9.588MB for 2536932-byte allocation
04-19 12:46:57.559 1316-1334/com.sourcey.materialloginexample D/dalvikvm: GC_FOR_ALLOC freed <1K, 12% free 9109K/10276K, paused 10ms, total 10ms
04-19 12:46:57.579 1316-1316/com.sourcey.materialloginexample D/dalvikvm: GC_FOR_ALLOC freed 1146K, 21% free 8394K/10592K, paused 1ms, total 4ms
04-19 12:46:57.583 1316-1316/com.sourcey.materialloginexample I/dalvikvm-heap: Grow heap (frag case) to 11.636MB for 2880012-byte allocation
04-19 12:46:57.591 1316-1322/com.sourcey.materialloginexample D/dalvikvm: GC_FOR_ALLOC freed 1K, 17% free 11205K/13408K, paused 5ms, total 5ms
04-19 12:46:57.615 1316-1316/com.sourcey.materialloginexample W/dalvikvm: Unable to resolve superclass of Lcom/mikepenz/materialdrawer/view/BezelImageView$CustomOutline; (2232)
04-19 12:46:57.615 1316-1316/com.sourcey.materialloginexample W/dalvikvm: Link of class 'Lcom/mikepenz/materialdrawer/view/BezelImageView$CustomOutline;' failed
04-19 12:46:57.615 1316-1316/com.sourcey.materialloginexample E/dalvikvm: Could not find class 'com.mikepenz.materialdrawer.view.BezelImageView$CustomOutline', referenced from method com.mikepenz.materialdrawer.view.BezelImageView.onSizeChanged
04-19 12:46:57.615 1316-1316/com.sourcey.materialloginexample W/dalvikvm: VFY: unable to resolve new-instance 5293 (Lcom/mikepenz/materialdrawer/view/BezelImageView$CustomOutline;) in Lcom/mikepenz/materialdrawer/view/BezelImageView;
04-19 12:46:57.615 1316-1316/com.sourcey.materialloginexample D/dalvikvm: VFY: replacing opcode 0x22 at 0x000a
04-19 12:46:57.615 1316-1316/com.sourcey.materialloginexample W/dalvikvm: Unable to resolve superclass of Lcom/mikepenz/materialdrawer/view/BezelImageView$CustomOutline; (2232)
04-19 12:46:57.615 1316-1316/com.sourcey.materialloginexample W/dalvikvm: Link of class 'Lcom/mikepenz/materialdrawer/view/BezelImageView$CustomOutline;' failed
04-19 12:46:57.615 1316-1316/com.sourcey.materialloginexample D/dalvikvm: DexOpt: unable to opt direct call 0xaaec at 0x0c in Lcom/mikepenz/materialdrawer/view/BezelImageView;.onSizeChanged
04-19 12:46:57.619 1316-1316/com.sourcey.materialloginexample I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method com.mikepenz.materialize.util.UIUtils.getCompatDrawable
04-19 12:46:57.619 1316-1316/com.sourcey.materialloginexample W/dalvikvm: VFY: unable to resolve virtual method 563: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
04-19 12:46:57.619 1316-1316/com.sourcey.materialloginexample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0018
04-19 12:46:57.631 1316-1316/com.sourcey.materialloginexample I/dalvikvm: Could not find method android.view.Window.setStatusBarColor, referenced from method com.mikepenz.materialize.MaterializeBuilder.build
04-19 12:46:57.631 1316-1316/com.sourcey.materialloginexample W/dalvikvm: VFY: unable to resolve virtual method 19416: Landroid/view/Window;.setStatusBarColor (I)V
04-19 12:46:57.631 1316-1316/com.sourcey.materialloginexample D/dalvikvm: VFY: replacing opcode 0x6e at 0x012c
04-19 12:46:57.631 1316-1316/com.sourcey.materialloginexample I/dalvikvm: Could not find method android.view.Window.setNavigationBarColor, referenced from method com.mikepenz.materialize.MaterializeBuilder.build
04-19 12:46:57.631 1316-1316/com.sourcey.materialloginexample W/dalvikvm: VFY: unable to resolve virtual method 19414: Landroid/view/Window;.setNavigationBarColor (I)V
04-19 12:46:57.631 1316-1316/com.sourcey.materialloginexample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0142
04-19 12:46:57.647 1316-1316/com.sourcey.materialloginexample I/dalvikvm: Could not find method android.view.View.setElevation, referenced from method com.mikepenz.materialdrawer.DrawerUtils.handleHeaderView
04-19 12:46:57.651 1316-1316/com.sourcey.materialloginexample W/dalvikvm: VFY: unable to resolve virtual method 19152: Landroid/view/View;.setElevation (F)V
04-19 12:46:57.651 1316-1316/com.sourcey.materialloginexample D/dalvikvm: VFY: replacing opcode 0x6e at 0x0062
04-19 12:46:57.987 1316-1316/com.sourcey.materialloginexample D/libEGL: loaded /system/lib/egl/libEGL_genymotion.so

                                                                        [ 04-19 12:46:57.987  1316: 1316 D/         ]
                                                                        HostConnection::get() New Host Connection established 0xb8953fe8, tid 1316
04-19 12:46:57.999 1316-1316/com.sourcey.materialloginexample D/libEGL: loaded /system/lib/egl/libGLESv1_CM_genymotion.so
04-19 12:46:57.999 1316-1316/com.sourcey.materialloginexample D/libEGL: loaded /system/lib/egl/libGLESv2_genymotion.so
04-19 12:46:58.027 1316-1316/com.sourcey.materialloginexample W/EGL_genymotion: eglSurfaceAttrib not implemented
04-19 12:46:58.027 1316-1316/com.sourcey.materialloginexample E/OpenGLRenderer: Getting MAX_TEXTURE_SIZE from GradienCache
04-19 12:46:58.031 1316-1316/com.sourcey.materialloginexample E/OpenGLRenderer: Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
04-19 12:46:58.035 1316-1316/com.sourcey.materialloginexample D/OpenGLRenderer: Enabling debug mode 0

清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.troychuinard.fanpolls">

<uses-permission android:name="android.permission.INTERNET" />

<application
    android:name=".FanPollsApplication"
    android:allowBackup="true"
    android:icon="@drawable/fan_polls_logo"
    android:label="@string/app_name"
    android:theme="@style/AppTheme">
    <activity
        android:name=".SignupActivity"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.Dark"
        android:windowSoftInputMode="stateHidden|adjustResize" />
    <activity
        android:name="com.facebook.FacebookActivity"
        android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" />

    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/facebook_app_id" />
    <meta-data
        android:name="com.firebase.ui.GoogleClientId"
        android:value="@string/google_client_id" />

    <activity android:name="com.firebase.ui.auth.twitter.TwitterPromptActivity" />

    <meta-data
        android:name="com.firebase.ui.TwitterKey"
        android:value="@string/twitter_app_key" />
    <meta-data
        android:name="com.firebase.ui.TwitterSecret"
        android:value="@string/twitter_app_secret" />

    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_poll"
        android:launchMode="singleTask"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar" />
    <activity
        android:name=".LoadingActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".Discussion_Activity"
        android:label="@string/title_activity_discussion_"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar" />
    <activity
        android:name=".PreviousActivity"
        android:label="@string/title_activity_previous"
        android:theme="@style/AppTheme.NoActionBar">
    </activity>
</application>

的build.gradle:

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'


    defaultConfig {
        applicationId "com.sourcey.materialloginexample"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
}
repositories {
    maven { url "https://jitpack.io" }
}


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile('com.mikepenz:materialdrawer:5.2.0@aar') {
        transitive = true
    }

    compile 'com.github.clans:fab:1.6.2'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support:design:23.3.0'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.firebase:firebase-client-android:2.5.0'
    compile 'com.facebook.android:facebook-android-sdk:4.6.0'
    compile 'com.google.android.gms:play-services-auth:8.4.0'
    compile 'org.twitter4j:twitter4j-core:4.0.2'
    compile 'com.firebaseui:firebase-ui:0.3.0'
    compile 'com.android.support:support-v4:23.3.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.squareup.okhttp3:okhttp:3.1.2'
    compile 'com.github.PhilJay:MPAndroidChart:v2.2.2'
}

0 个答案:

没有答案