Android 6.0 App未加载活动 [英] Android 6.0 App Not Loading Activity
问题描述
我最近更新了Android Studio和所有关联的支持库,并且我的应用程序没有通过第一个屏幕。第一个屏幕是一个基本的LoadActivity,用户的认证状态。如果用户通过身份验证,则进入应用程序,否则会进入活动,提示注册。
以下是我的项目的堆栈跟踪:
04-19 12:29:41.707 16877-16877 / com.sourcey.materialloginexample I / art:延迟启用-Xcheck:jni
04-19 12:29:41.752 16877-16877 / com.sourcey.materialloginexample I / HyLog:I:openReadStream,/data/font/config/sfconfig.dat,case(2)
04-19 12:29:41.752 16877-16877 / com.sourcey.materialloginexample D / HyLog:D:错误标记(927:loadPreData():frameworks / base / core / jni / android / graphics / TypefaceHyFontManager.cpp)
04 -19 12:29:41.752 16877-16877 / com.sourcey.materialloginexample I / HyLog:I:openReadStream,/data/font/config/sfconfig.dat,case(2)
04-19 12:29: 41.754 16877-16887 / com.sourcey.materialloginexample I / art:调试器不再有效
04-19 12:29:41.777 16877-16877 / com.sourcey.materialloginexample W / System:ClassLoader引用未知路径:/数据/应用/ com.so urcey.materialloginexample-1 / lib / arm
04-19 12:29:41.949 16877-16877 / com.sourcey.materialloginexample D / PhoneWindowEx:[PWEx] [generateLayout] setLGNavigationBarColor:colors = 0xff000000
04 -19 12:29:41.949 16877-16877 / com.sourcey.materialloginexample I / PhoneWindow:[setLGNavigationBarColor] color = 0x ff000000
04-19 12:29:42.104 16877-16877 / com.sourcey.materialloginexample I / Timeline:Timeline:Activity_launch_request id:com.sourcey.materialloginexample time:167295
04-19 12:29:42.144 16877-16939 / com.sourcey.materialloginexample D / OpenGLRenderer:Use EGL_SWAP_BEHAVIOR_PRESERVED:true
04- 19 12:29:42.171 16877-16877 / com.sourcey.materialloginexample D / PhoneWindow:notifyNavigationBarColor,color = 0x:ff000000,token:android.view.ViewRootImplAO$WEx@3ec1bc9
04-19 12:29:42.225 16877-16877 / com.sourcey.materialloginexample D / PhoneWindowEx:[PWEx] [generateLayout] setLGNavigationBarColor:colors = 0xff000000
04-19 12:29:42.225 16877-16877 / com.sourcey.materialloginexa mple I / PhoneWindow:[setLGNavigationBarColor] color = 0x ff000000
04-19 12:29:42.231 16877-16877 / com.sourcey.materialloginexample I / AppCompatViewInflater:app:theme现在已被弃用。请改为使用android:主题。
04-19 12:29:42.411 16877-16877 / com.sourcey.materialloginexample I / Timeline:Timeline:Activity_launch_request id:com.sourcey.materialloginexample time:167603
04-19 12:29:42.476 16877-16939 / com.sourcey.materialloginexample I / Adreno-EGL:< qeglDrvAPI_eglInitialize:379>:EGL 1.4 QUALCOMM build:Nondeterministic_AU_msm8916_32_LA.BR.1.2.6_RB1__release_AU(I3193f6e94a)
OpenGL ES Shader编译器版本:XE031.06.00 .00
生成日期:10/07/15星期三
本地分支:
远程分支:quic / LA.BR.1.2.6_rb1.1
本地修补程序:无
重构分支:NOTHING
04-19 12:29:42.480 16877-16939 / com.sourcey.materialloginexample I / OpenGLRenderer:初始化EGL,版本1.4
04-19 12:29:42.573 16877-16877 / com.sourcey.materialloginexample I / Timeline:Timeline:Activity_idle id:android.os.BinderProxy@8611fd0 time:167764
04-19 12:29:42.573 16877-16877 / com.sourcey.materialloginexample I / Timeline:Timeline :Activity_idle id:android.os.BinderProxy@8611fd0 time:167765
04-19 12:30:07.510 16877-16877 / com.sourcey.materialloginexample I / ViewRootImpl:ViewRoot的Touch事件:ACTION_DOWN
04- 19 12:30:07.611 16877-16877 / com.sourcey.materialloginexample I / ViewRootImpl:ViewRoot的Touch事件:ACTION_UP
加载活动:
public class LoadingActivity extends AppCompatActivity {
@Override
public void onCreate Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_loading);
Firebase.setAndroidContext(this);
最终Firebase userRef = FirebaseUtil.FIREBASE.child(用户);
final AuthData authData = userRef.getAuth();
if(authData!= null){
startActivity(new Intent(LoadingActivity.this,MainActivity.class));
} else {
startActivity(new Intent(LoadingActivity.this,SignupActivity.class));
finish();
$ / code>
Build.Gradle: p>
apply plugin:'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23 .0.3'
defaultConfig {
applicationIdcom.sourcey.materialloginexample
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName1.0
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'' proguard-rules.pro'
}
}
packagingOptions {
不包括'META-INF / LICENSE'
不包括'META-INF / LICENSE- FIREBASE.txt'
exclude'META-INF / NOTICE'
}
}
存储库{
maven {urlhttps://jitpack.io}
}
依赖关系{
编译fileTree(dir:'libs',include:['* .jar'])
compile('com.mikepenz:materialdrawer:5.2.0@aar'){
transitive = true
}
编译'com.github.clans:fab:1.6.2'
编译'de.hdodenhof:circleimageview:2.0.0'
编译'com.android。支持: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'
编译'com.android.support:support-v4:23.3.0'
编译'com.squareup.picasso:picasso:2.5.2'
compile'com.squareup.okhttp3:okhttp:3.1。 2'
编译'com.github.PhilJay:MPAndroi dChart:v2.2.2'
}
清单:
<?xml version =1.0encoding =utf-8?>
< manifest xmlns:android =http://schemas.android.com/apk/res/android
package =com.troychuinard.fanpolls>
<使用权限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/>
<解决方案
请发布您的Android Manifest的副本:
app:theme is now deprecated。Please move
您的应用程序标签应该位于Android Manifest中:
< application
android:theme =Theme.AppCompat.Light.NoActionBar
tools:replace =label>
< activity
android:name =。Name
android:launchMode =singleTop
android:theme =主题.AppCompat.Light.NoActionBar>
重要的是,使用AppCompatActivity时,所有活动必须使用Theme.AppCompat。*变体的主题。
I recently updated Android Studio and all associated support libraries, and my application is not progressing passed the first screen.
The first screen is a basic LoadingActivity that checks the authentication state of the user. If the user is authenticated, it progresses to the application, otherwise it goes to an activity prompting a sign up.
Here is the stack trace for my project:
04-19 12:29:41.707 16877-16877/com.sourcey.materialloginexample I/art: Late-enabling -Xcheck:jni
04-19 12:29:41.752 16877-16877/com.sourcey.materialloginexample I/HyLog: I : openReadStream, /data/font/config/sfconfig.dat, case (2)
04-19 12:29:41.752 16877-16877/com.sourcey.materialloginexample D/HyLog: D: Wrong tag (927 : loadPreData() : frameworks/base/core/jni/android/graphics/TypefaceHyFontManager.cpp)
04-19 12:29:41.752 16877-16877/com.sourcey.materialloginexample I/HyLog: I : openReadStream, /data/font/config/sfconfig.dat, case (2)
04-19 12:29:41.754 16877-16887/com.sourcey.materialloginexample I/art: Debugger is no longer active
04-19 12:29:41.777 16877-16877/com.sourcey.materialloginexample W/System: ClassLoader referenced unknown path: /data/app/com.sourcey.materialloginexample-1/lib/arm
04-19 12:29:41.949 16877-16877/com.sourcey.materialloginexample D/PhoneWindowEx: [PWEx][generateLayout] setLGNavigationBarColor : colors=0xff000000
04-19 12:29:41.949 16877-16877/com.sourcey.materialloginexample I/PhoneWindow: [setLGNavigationBarColor] color=0x ff000000
04-19 12:29:42.104 16877-16877/com.sourcey.materialloginexample I/Timeline: Timeline: Activity_launch_request id:com.sourcey.materialloginexample time:167295
04-19 12:29:42.144 16877-16939/com.sourcey.materialloginexample D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
04-19 12:29:42.171 16877-16877/com.sourcey.materialloginexample D/PhoneWindow: notifyNavigationBarColor, color=0x: ff000000, token: android.view.ViewRootImplAO$WEx@3ec1bc9
04-19 12:29:42.225 16877-16877/com.sourcey.materialloginexample D/PhoneWindowEx: [PWEx][generateLayout] setLGNavigationBarColor : colors=0xff000000
04-19 12:29:42.225 16877-16877/com.sourcey.materialloginexample I/PhoneWindow: [setLGNavigationBarColor] color=0x ff000000
04-19 12:29:42.231 16877-16877/com.sourcey.materialloginexample I/AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
04-19 12:29:42.411 16877-16877/com.sourcey.materialloginexample I/Timeline: Timeline: Activity_launch_request id:com.sourcey.materialloginexample time:167603
04-19 12:29:42.476 16877-16939/com.sourcey.materialloginexample I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8916_32_LA.BR.1.2.6_RB1__release_AU (I3193f6e94a)
OpenGL ES Shader Compiler Version: XE031.06.00.00
Build Date: 10/07/15 Wed
Local Branch:
Remote Branch: quic/LA.BR.1.2.6_rb1.1
Local Patches: NONE
Reconstruct Branch: NOTHING
04-19 12:29:42.480 16877-16939/com.sourcey.materialloginexample I/OpenGLRenderer: Initialized EGL, version 1.4
04-19 12:29:42.573 16877-16877/com.sourcey.materialloginexample I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@8611fd0 time:167764
04-19 12:29:42.573 16877-16877/com.sourcey.materialloginexample I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@8611fd0 time:167765
04-19 12:30:07.510 16877-16877/com.sourcey.materialloginexample I/ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
04-19 12:30:07.611 16877-16877/com.sourcey.materialloginexample I/ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
Loading Activity:
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();
}
}
}
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'
}
Manifest:
<?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>
</manifest>
Please post a copy of your Android Manifest:
"app:theme is now deprecated. Please move to using android:theme instead."
Your Application Tag should be in Android Manifest:
<application
android:theme="Theme.AppCompat.Light.NoActionBar"
tools:replace="label">
and / or Activity Tag should be in Android Manifest:
<activity
android:name=".Name"
android:launchMode="singleTop"
android:theme="Theme.AppCompat.Light.NoActionBar">
The important thing is all activities must have themes using a variant of Theme.AppCompat.* when using AppCompatActivity.
这篇关于Android 6.0 App未加载活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!