gpt4 book ai didi

java - Android 6.0 应用程序未加载 Activity

转载 作者:行者123 更新时间:2023-12-01 10:02:06 25 4
gpt4 key购买 nike

我最近更新了 Android Studio 和所有关联的支持库,但我的应用程序无法通过第一个屏幕。

第一个屏幕是一个基本的 LoadingActivity,用于检查用户的身份验证状态。如果用户通过身份验证,则会进入应用程序,否则会进入提示注册的 Activity 。

这是我的项目的堆栈跟踪:

  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

加载 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();
}
}
}

构建.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'
}

list :

    <?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>

enter image description here

最佳答案

请发布您的 Android list 副本:

“app:theme 现已弃用。请改为使用 android:theme。”

您的应用程序标签应位于 Android list 中:

<application
android:theme="Theme.AppCompat.Light.NoActionBar"
tools:replace="label">

和/或 Activity 标签应位于 Android Manifest 中:

<activity
android:name=".Name"
android:launchMode="singleTop"
android:theme="Theme.AppCompat.Light.NoActionBar">

重要的是,在使用 AppCompatActivity 时,所有 Activity 都必须具有使用 Theme.AppCompat.* 变体的主题。

关于java - Android 6.0 应用程序未加载 Activity ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36725556/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com