简体   繁体   English

Android:SplashScreen启动后,应用程序将无法启动-错误在哪里?

[英]Android: App won't start after SplashScreen launch - Where is the bug?

Introduction of the problem 问题介绍

I'm trying to launch my android application but I can't start my app with SplashScreen & WebView. 我正在尝试启动我的android应用程序,但无法使用SplashScreen和WebView启动我的应用程序。

The Code 编码

You can find my source code on GitHub. 您可以在GitHub上找到我的源代码

This is the code my AndroidManifest.xml file: 这是我的AndroidManifest.xml文件的代码:

<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2014-present iSC Apps & The Android Open Source Project
  All rights reserved.

  This material may not be reproduced, displayed, modified or distributed
  without the express prior written permission of the copyright holder.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="isc.apps.android.suriyaa" >

<!-- Set app permissions on a android device -->
<uses-permission android:name="android.permission.INTERNET" />

<!-- App permissions for Parse -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:protectionLevel="signature"
    android:name="isc.apps.android.suriyaa.permission.C2D_MESSAGE" />
<uses-permission android:name="isc.apps.android.suriyaa.permission.C2D_MESSAGE" />

<!-- Set icon -->
<application
    android:allowBackup="false"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name">

    <!-- SplashScreen activity -->
    <activity
        android:name="SplashScreen"
        android:theme="@style/Theme.Transparent">
        <intent-filter>
                    <action android:name="android.intent.action.MAIN"></action>
                    <category android:name="android.intent.category.LAUNCHER"></category>
                </intent-filter>
    </activity>

    <!-- Main activity -->
    <activity
        android:name="MainActivity"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>

        <!-- Parse Push Service -->
        <!--
        <service android:name="com.parse.PushService" />
        <receiver android:name="com.parse.ParsePushBroadcastReceiver"
            android:exported="false">
          <intent-filter>
            <action android:name="com.parse.push.intent.RECEIVE" />
            <action android:name="com.parse.push.intent.DELETE" />
            <action android:name="com.parse.push.intent.OPEN" />
            </intent-filter>
        </receiver>
        <receiver android:name="com.parse.GcmBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND">
          <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

            <category android:name="isc.apps.android.suriyaa" />
          </intent-filter>
        </receiver>
        -->

    </activity>
</application>

    <!-- DISABLED
    <uses-sdk android:minSdkVersion="7" />
    -->

</manifest>
<!-- Build the <> with <3 by iSC Apps Team -->

Debug Output 调试输出

After debugging my project. 在调试我的项目之后。 These following Debug Console outputs came out: 以下是这些调试控制台的输出:

Waiting for device.
Device connected: emulator-5554
Device AVD_for_Nexus_S_by_Google [emulator-5554] is online, waiting for processes to start up..
Device is ready: AVD_for_Nexus_S_by_Google [emulator-5554]
Target device: AVD_for_Nexus_S_by_Google [emulator-5554]
Uploading file
    local path: C:\Users\Suriyaa\Documents\GitHub\isc.apps.android.suriyaa\app\build\outputs\apk\app-debug.apk
    remote path: /data/local/tmp/isc.apps.android.suriyaa
Installing isc.apps.android.suriyaa
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/isc.apps.android.suriyaa"
    pkg: /data/local/tmp/isc.apps.android.suriyaa
Success

Launching application: isc.apps.android.suriyaa/isc.apps.android.suriyaa.SplashScreen.
DEVICE SHELL COMMAND: am start -D -n "isc.apps.android.suriyaa/isc.apps.android.suriyaa.SplashScreen" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=isc.apps.android.suriyaa/.SplashScreen }

Waiting for process: isc.apps.android.suriyaa
Client not ready yet.
Connected to the target VM, address: 'localhost:8605', transport: 'socket'
Disconnected from the target VM, address: 'localhost:8605', transport: 'socket'

The debugger in Android Studio stopped automatically. Android Studio中的调试器会自动停止。

In any case, is there any way to get around this error? 无论如何,有什么办法可以解决这个错误?

Remove intent-filter from MainActivity of manifest.xml 从manifest.xml的MainActivity中删除意图过滤器

Change 更改

 <activity
    android:name="MainActivity"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>
 </activity>

to

 <activity
    android:name="MainActivity"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
    <intent-filter>           
        <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>
 </activity>

Restart your Android Studio . 重新启动Android Studio

if this doesn´t solve your problem try with: 如果这不能解决您的问题,请尝试:

open your terminal and execute: 打开您的终端并执行:

> adb get-state

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM