android - 无法加载 memtrack 模块 Logcat 错误

标签 android logcat stack-trace

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

StackTrace 错误:

 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

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

输出:

最后它显示空白屏幕。

enter image description here

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

最佳答案

此错误,您可以在 the question linked in comments above 上阅读,结果为:

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



下面的步骤 1 应该可以解决此问题。另外,正如我所见,您的 list 中有一些奇怪的包名称:
  • <manifest> 中的 package="com.example.hive"标签,
  • android:name="com.sit.gems.app.GemsApplication"为 <application>
  • 和 android:name="com.sit.gems.activity"在 <activity>

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

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



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

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

    甚至是真正的设备! memtrack module错误似乎与您的模拟器有关。所以改成Run configuration ,不要忘记更改 API也。

    2.OpenGL错误日志

    对于 OpenGl错误,如 called unimplemented OpenGL ES API ,这不是错误,而是声明!您应该在 list 中启用它(如果您在 HomeActivity.java 中使用 GLSurfaceView,可以阅读 this answer,它可能会对您有所帮助):
    <uses-feature android:glEsVersion="0x00020000"></uses-feature>  
    // or
    <uses-feature android:glEsVersion="0x00010001" android:required="true" />
    

    3.使用同一个包

    不要为 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.不要迷失布局:

    您应该为 SplashScreenActivity.java 设置另一个布局因为你没有使用 TabHost对于启动画面,这不是一种安全的资源方式。用不同的东西声明一个特定的布局,比如应用程序名称和 Logo :
    // 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" />  
    

    避免在不使用布局的 Activity 中使用布局。

    5. 启动画面?

    最后,我不太清楚你的SplashScreenActivity的目的。 .它设置一个内容 View 并直接完成。这是没用的。

    因为它的名字是启动画面,我假设你想在启动你的 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();
        }
    }  
    

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

    关于android - 无法加载 memtrack 模块 Logcat 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30643695/

    相关文章:

    Android:AirDroid 应用程序如何工作?

    android - Firebase 仪表板不显示价格值

    java - android程序中的ClassNotFoundException

    android - 在 Eclipse 中观察很长的 String 内容

    python - 这些函数名称中的点是什么原因造成的

    Android R 命名空间资源

    java - 无法在 android 中创建 AndroidViewModel 类的实例

    android - logcat过滤和行数

    javascript - 将异步函数作为回调传递会导致错误堆栈跟踪丢失

    c# - 如何在堆栈跟踪转储中获取变量值?