Android 无法加载 memtrack 模块 Logcat 错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22629568/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 06:16:20  来源:igfitidea点击:

Couldn't load memtrack module Logcat Error

androidlogcatstack-trace

提问by Steve

I am getting an error Couldn't load memtrack module (No such file or directory) failed to load memtrack module: -2at run time.

Couldn't load memtrack module (No such file or directory) failed to load memtrack module: -2在运行时遇到错误。

StackTrace Error:

堆栈跟踪错误:

 E/SoundPool(1280)       : error loading /system/media/audio/ui/Effect_Tick.ogg 
 E/SoundPool(1280)       : error loading /system/media/audio/ui/KeypressStandard.ogg       
 E/SurfaceFlinger(931)   : glCheckFramebufferStatusOES error 733995180
 E/memtrack(1873)        : Couldn't load memtrack module (No such file or directory)
 E/android.os.Debug(1873): failed to load memtrack module: -2
 E/libEGL(931)           : called unimplemented OpenGL ES API
 E/libEGL(931)           : called unimplemented OpenGL ES API
 E/libEGL(931)           : called unimplemented OpenGL ES API
 E/libEGL(931)           : called unimplemented OpenGL ES API
 E/SurfaceFlinger(931)   : glCheckFramebufferStatusOES error 733995180
 E/SurfaceFlinger(931)   : got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
 E/libEGL(931)           : called unimplemented OpenGL ES API
 E/libEGL(931)           : called unimplemented OpenGL ES API

Manifest:

显现:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.hive"
    android:versionCode="1"
    android:versionName="1.0">

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" android:name="com.sit.gems.app.GemsApplication"
        android:theme="@style/AppTheme" >

    <activity
            android:name="com.sit.gems.activity.SplashActivity"
            android:label="@string/app_name" android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="com.sit.gems.activity.HomeActivity" android:screenOrientation="portrait"></activity>
    </application>

</manifest>

SplashActivity.java:

SplashActivity.java:

package com.sit.gems.activity;
import com.example.hive.R;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

public class SplashActivity extends FragmentActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_home);
        startActivity(new Intent(SplashActivity.this,HomeActivity.class));
        SplashActivity.this.finish();
    }

}

layout_home.xml:

layout_home.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TabHost
        android:id="@android:id/tabhost"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >

            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_above="@android:id/tabs" >

                <FrameLayout
                    android:id="@+id/tab_home"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent" />

                <FrameLayout
                    android:id="@+id/tab_video"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent" />

                <FrameLayout
                    android:id="@+id/tab_audio"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent" >
                </FrameLayout>

                <FrameLayout
                    android:id="@+id/tab_blog"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent" >
                </FrameLayout>

                <FrameLayout
                    android:id="@+id/tab_gal"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent" >
                </FrameLayout>

                <FrameLayout
                    android:id="@+id/tab_more"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent" >
                </FrameLayout>
            </FrameLayout>

            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:background="@drawable/bottom_bar"
                android:divider="@null" />

            <!-- android:background="#d8e49c" -->
        </RelativeLayout>
    </TabHost>

</LinearLayout>

Output:

输出:

Finally it displays the blank screen.

最后它显示空白屏幕。

enter image description here

在此处输入图片说明

Anybody know how to solve these errors?

有人知道如何解决这些错误吗?

采纳答案by fllo

This error, as you can read on the question linked in comments above, results to be:

正如您可以在上面评论中链接的问题中阅读的那样,此错误的结果是:

"[...] a problem with loading {some} hardware module. This could be something to do with GPU support, sdcard handling, basically anything."

“[...] 加载 {some} 硬件模块时出现问题。这可能与 GPU 支持、sdcard 处理,基本上任何事情有关。”

The step 1 below should resolve this problem. Also as I can see, you have some strange package names inside your manifest:

下面的步骤 1 应该可以解决此问题。此外,正如我所看到的,您的清单中有一些奇怪的包名:

  • package="com.example.hive"in <manifest>tag,
  • android:name="com.sit.gems.app.GemsApplication"for <application>
  • and android:name="com.sit.gems.activity"in <activity>
  • package="com.example.hive"<manifest>标签中,
  • android:name="com.sit.gems.app.GemsApplication"<application>
  • android:name="com.sit.gems.activity"<activity>

As you know, these things do not prevent your app to be displayed. But I think:

如您所知,这些事情不会阻止您的应用程序显示。但我觉得:

the Couldn't load memtrack module errorcould occur because of emulators configurations problems and, because your project contains many organization problems, it might help to give a fresh redesign.

Couldn't load memtrack module error可能是由于模拟器配置问题而发生的,并且由于您的项目包含许多组织问题,因此重新设计可能会有所帮助。

For better using and with few things, this can be resolved by following these tips:

为了更好地使用并减少一些事情,这可以通过以下提示来解决:



1. Try an other emulator...

1. 尝试其他模拟器...

And even a real device! The memtrack moduleerror seems related to your emulator. So change it into Run configuration, don't forget to change the APItoo.

甚至是真正的设备!该memtrack module错误似乎与您的模拟器有关。所以把它改成Run configuration,别忘了也改成API



2. OpenGL error logs

2.OpenGL错误日志

For OpenGlerrors, as called unimplemented OpenGL ES API, it's not an error but a statement! You should enable it in your manifest (you can read this answerif you're using GLSurfaceView inside HomeActivity.java, it might help you):

对于OpenGl错误,as called unimplemented OpenGL ES API,它不是错误而是声明!你应该在你的清单中启用它(如果你在里面使用 GLSurfaceView ,你可以阅读这个答案HomeActivity.java,它可能对你有帮助):

<uses-feature android:glEsVersion="0x00020000"></uses-feature>  
// or
<uses-feature android:glEsVersion="0x00010001" android:required="true" />


3. Use the same package

3.使用相同的包

Don't declare different package names to all the tags in Manifest. You should have the same for Manifest, Activities, etc. Something like this looks right:

不要为 中的所有标签声明不同的包名Manifest。您应该对Manifest,Activities等具有相同的内容。类似这样的事情看起来是正确的:

<!-- set the general package -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.sit.gems.activity"
    android:versionCode="1"
    android:versionName="1.0" >

    <!-- don't set a package name in <application> -->
    <application ... >

        <!-- then, declare the activities -->
        <activity
            android:name="com.sit.gems.activity.SplashActivity" ... >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <!-- same package here -->
        <activity
            android:name="com.sit.gems.activity.HomeActivity" ... >
        </activity>
    </application>
</manifest>  


4. Don't get lost with layouts:

4. 不要迷失于布局:

You should set another layout for SplashScreenActivity.javabecause you're not using the TabHostfor the splash screen and this is not a safe resource way. Declare a specific layout with something different, like the app name and the logo:

您应该为 设置另一个布局,SplashScreenActivity.java因为您没有将TabHost用于启动画面,这不是一种安全的资源方式。用不同的东西声明一个特定的布局,比如应用程序名称和徽标:

// inside SplashScreen class
setContentView(R.layout.splash_screen);

// layout splash_screen.xml
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent" 
     android:gravity="center"
     android:text="@string/appname" />  

Avoid using a layout in activities which don't use it.

避免在不使用布局的活动中使用布局。



5. Splash Screen?

5. 启动画面?

Finally, I don't understand clearly the purpose of your SplashScreenActivity. It sets a content view and directly finish. This is useless.

最后,我不明白你的SplashScreenActivity. 它设置一个内容视图并直接完成。这是没用的。

As its name is Splash Screen, I assume that you want to display a screen before launching your HomeActivity. Therefore, you should do this and don't use the TabHostlayout ;):

因为它的名字是Splash Screen,我假设你想在启动你的HomeActivity. 因此,您应该这样做并且不要使用TabHost布局 ;)

// FragmentActivity is also useless here! You don't use a Fragment into it, so, use traditional Activity
public class SplashActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // set your splash_screen layout
        setContentView(R.layout.splash_screen);

        // create a new Thread
        new Thread(new Runnable() {
            public void run() {
                try {
                    // sleep during 800ms
                    Thread.sleep(800);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                // start HomeActivity
                startActivity(new Intent(SplashActivity.this, HomeActivity.class));
                SplashActivity.this.finish();
            }
        }).start();
    }
}  

I hope this kind of tips help you to achieve what you want.
If it's not the case, let me know how can I help you.

我希望这种提示可以帮助你实现你想要的。
如果不是这种情况,请告诉我我该如何帮助您。

回答by aysenur

I had the same error. Creating a new AVD with the appropriate API level solved my problem.

我有同样的错误。创建具有适当 API 级别的新 AVD 解决了我的问题。

回答by Pierre

For people using Xamarin

对于使用 Xamarin 的人

I found that setting the linking to Sdk Assemblies Only does the trick: Project -> Properties -> Android Options -> Linker tab -> Linking:

我发现将链接设置为 Sdk 程序集仅能解决问题:项目 -> 属性 -> Android 选项 -> 链接器选项卡 -> 链接:

enter image description here

在此处输入图片说明

回答by Ray

I faced the same problem but When I changed the skin of AVD device to HVGA, it worked.

我遇到了同样的问题,但是当我将 AVD 设备的皮肤更改为 HVGA 时,它起作用了。

回答by baiiu

do you called the ViewTreeObserver and not remove it.

您是否调用了 ViewTreeObserver 而不是将其删除。

    mEtEnterlive.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
         // do nothing here can cause such problem
    });

回答by InquisitiveCrow

I had this issue too, also running on an emulator.. The same message was showing up on Logcat, but it wasn't affecting the functionality of the app. But it was annoying, and I don't like seeing errors on the log that I don't understand.

我也有这个问题,也在模拟器上运行.. Logcat 上显示了相同的消息,但它没有影响应用程序的功能。但这很烦人,而且我不喜欢在日志中看到我不明白的错误。

Anyway, I got rid of the message by increasing the RAMon the emulator.

无论如何,我通过增加模拟器上的RAM摆脱了该消息。