无法加载 memtrack 模块 Logcat 错误 [英] Couldn't load memtrack module Logcat Error

查看:27
本文介绍了无法加载 memtrack 模块 Logcat 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一个错误 无法加载 memtrack 模块(没有这样的文件或目录)未能在运行时加载 memtrack 模块:-2.

堆栈跟踪错误:

 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

清单:

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

输出:

最后显示空白屏幕.

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

Anybody know how to solve these errors?

推荐答案

这个错误,你可以在 上面评论中链接的问题,结果为:

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

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

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

下面的第 1 步应该可以解决这个问题.另外正如我所看到的,你的清单中有一些奇怪的包名:

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

  • package="com.example.hive" 标签中,
  • android:name="com.sit.gems.app.GemsApplication" 用于
  • android:name="com.sit.gems.activity"
  • 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>

如您所知,这些事情不会阻止您的应用显示.但我认为:

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

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

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.

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

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

甚至是真机!memtrack module 错误似乎与您的模拟器有关.所以把它改成Run configuration,不要忘记把API也改一下.

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

对于OpenGl 错误,正如称为未实现的OpenGL ES API,它不是错误而是声明!您应该在清单中启用它(如果您在 HomeActivity.java 中使用 GLSurfaceView,您可以阅读这个答案,它可能会帮助你):

For OpenGl errors, 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 answer if you're using GLSurfaceView inside HomeActivity.java, it might help you):

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

<小时>

3.使用同一个包

不要为Manifest 中的所有标签声明不同的包名.您应该对 ManifestActivity 等具有相同的内容.如下所示:


3. Use the same package

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:

<!-- 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 用于启动画面,这不是一种安全的资源方式.使用不同的内容声明特定的布局,例如应用程序名称和徽标:


4. Don't get lost with layouts:

You should set another layout for SplashScreenActivity.java because you're not using the TabHost for 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:

// 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.

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

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

因为它的名字是Splash Screen,我假设你想在启动你的HomeActivity之前显示一个屏幕.因此,你应该这样做并且不要使用TabHost布局;):

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 TabHost layout ;):

// 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.

这篇关于无法加载 memtrack 模块 Logcat 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆