Android Studio,Logcat显示无限的“I /art:Enter while loop”,即使在运行空活动时也是如此。

2022-09-01 09:05:50

在 Android Studio 中构建应用。在 logcat 中,我得到了无限的显示:

“I/艺术:在循环时输入。

该应用程序就像一个魅力,但它看起来仍然很奇怪。在Google上,我找不到任何东西,在堆栈上,我找到了一个非常具体的情况和非常具体的解决方案的参考。

问题是,在我的情况下,当我只是在手机上运行“空活动”时,它甚至会出现。

目前使用的是:API 19:Android 4.4(KitKat),但也尝试了更高的API。

如果需要任何其他文件(gradle/manifest),请告诉我,希望有人可以告诉我发生了什么(或者这甚至是正常的?)。

谢谢。

JAVA 文件

package com.example.xxxxxxx.myapplication;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

XML 文件

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.xxxxxxx.myapplication.MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</android.support.constraint.ConstraintLayout>

日志猫

W/System: ClassLoader referenced unknown path: /data/app/com.example.xxxxxxx.myapplication-1/lib/arm
I/InstantRun: starting instant run server: is main process
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
I/art: Enter while loop.
V/PhoneWindow: DecorView setVisiblity: visibility = 4, Parent = null, this = DecorView@a600dae[]
D/WindowClient: Add to mViews: DecorView@a600dae[MainActivity], this = android.view.WindowManagerGlobal@19554c2
D/OpenGLRenderer: Dumper init 2 threads <0xa132b480>
D/OpenGLRenderer: <com.example.xxxxxxx.myapplication> is running.
D/OpenGLRenderer: CanvasContext() 0x9fdc1800
D/GraphicBuffer: register, handle(0x9fd86870) (w:576 h:576 s:576 f:0x1 u:0x000100)
D/ViewRootImpl[MainActivity]: hardware acceleration is enabled, this = ViewRoot{c7462d3 com.example.xxxxxxx.myapplication/com.example.xxxxxxx.myapplication.MainActivity,ident = 0}
V/PhoneWindow: DecorView setVisiblity: visibility = 0, Parent = ViewRoot{c7462d3 com.example.xxxxxxx.myapplication/com.example.xxxxxxx.myapplication.MainActivity,ident = 0}, this = DecorView@a600dae[MainActivity]
D/Surface: Surface::allocateBuffers(this=0x94d6d700)
D/OpenGLRenderer: CanvasContext() 0x9fdc1800 initialize window=0x94d6d700, title=com.example.xxxxxxx.myapplication/com.example.xxxxxxx.myapplication.MainActivity
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
D/OpenGLRenderer: Created EGL context (0xaa2bdb80)
D/OpenGLRenderer: ProgramCache.init: enable enhancement 1
I/OpenGLRenderer: Get disable program binary service property (0)
I/OpenGLRenderer: Initializing program atlas...
I/ProgramBinary/Service: ProgramBinaryService client side disable debugging.
I/ProgramBinary/Service: ProgramBinaryService client side disable binary content debugging.
D/ProgramBinary/Service: BpProgramBinaryService.getReady
D/ProgramBinary/Service: BpProgramBinaryService.getProgramBinaryData
I/OpenGLRenderer: Program binary detail: Binary length is 91876, program map length is 124.
I/OpenGLRenderer: Succeeded to mmap program binaries. File descriptor is 65, and path is /dev/ashmem.
I/OpenGLRenderer: No need to use file discriptor anymore, close fd(65).
D/OpenGLRenderer: Initializing program cache from 0x0, size = -1
I/[MALI][Gralloc]: dlopen libsec_mem.so fail
D/Surface: Surface::connect(this=0x94d6d700,api=1)
W/libEGL: [ANDROID_RECORDABLE] format: 1
D/Surface: Surface::setBufferCount(this=0x94d6d700,bufferCount=4)
W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
V/InputMethodManager: onWindowFocus: null softInputMode=288 first=true flags=#81810100
D/GraphicBuffer: register, handle(0x9fd86bf0) (w:480 h:800 s:480 f:0x1 u:0x000f02)
D/OpenGLRenderer: CacheTexture 3 upload: x, y, width height = 0, 0, 1024, 155
D/OpenGLRenderer: ProgramCache.generateProgram: 0
D/OpenGLRenderer: ProgramCache.generateProgram: 34359738371
D/OpenGLRenderer: ProgramCache.generateProgram: 240518168576
I/art: Enter while loop.
I/art: Enter while loop.
I/art: Enter while loop.
I/art: Enter while loop.
I/art: Enter while loop.
I/art: Enter while loop.
I/art: Enter while loop.
I/art: Enter while loop.
I/art: Enter while loop.
I/art: Enter while loop.
I/art: Enter while loop.
I/art: Enter while loop.
.... etc.

清单

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

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

格拉德尔

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "com.example.xxxxxxx.myapplication"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
}

答案 1

虽然我没有看到你的空活动出现问题的明显原因,但在我的情况下,这是一些逻辑过度重复多次,并使Android运行时过载,使屏幕保持一段时间,并在控制台日志中显示消息。I/art: Enter while loop.

通过将逻辑减少到只有一次通过,问题得到了解决。您也可以尝试在单独的线程上执行此操作。


答案 2

它看起来像是Android Studio中留下的某种调试消息,或者您的软件具有的某些依赖项。

您应该尝试将每个库,Android Studio及其组件更新到最新版本,这将解决问题。


推荐