Luf*_*ffy 77 android stack-trace logcat
我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
Run Code Online (Sandbox Code Playgroud)
表现:
<?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>
Run Code Online (Sandbox Code Playgroud)
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();
}
}
Run Code Online (Sandbox Code Playgroud)
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>
Run Code Online (Sandbox Code Playgroud)
输出:
最后它显示空白屏幕.

有谁知道如何解决这些错误?
fll*_*llo 46
您可以阅读上述评论中链接的问题,这个错误导致:
"[...]加载{some}硬件模块的问题.这可能与GPU支持,SD卡处理,基本上任何事情有关."
下面的步骤1应该可以解决此问题.另外,正如我所看到的,您的清单中有一些奇怪的包名称:
<manifest>标签,<application><activity> 如您所知,这些内容并不会阻止您的应用显示.但我觉得:
在
Couldn't load memtrack module error可能因为模拟器配置的问题发生,因为你的项目中包含许多组织的问题,它可能有助于给人耳目一新的重新设计.
为了更好地使用和少量使用,可以通过以下提示解决此问题:
甚至是真正的设备!该memtrack module错误似乎与您的模拟器有关.所以改成它Run configuration,别忘了改变它API.
对于OpenGl错误,因为called unimplemented OpenGL ES API它不是错误而是声明!您应该在清单中启用它(如果您在里面使用GLSurfaceView ,可以阅读此答案HomeActivity.java,它可能对您有帮助):
<uses-feature android:glEsVersion="0x00020000"></uses-feature>
// or
<uses-feature android:glEsVersion="0x00010001" android:required="true" />
Run Code Online (Sandbox Code Playgroud)
不要为其中的所有标记声明不同的包名称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>
Run Code Online (Sandbox Code Playgroud)
您应该设置另一个布局,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" />
Run Code Online (Sandbox Code Playgroud)
避免在不使用它的活动中使用布局.
最后,我不明白你的目的SplashScreenActivity.它设置内容视图并直接完成.这没用.
正如它的名字是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();
}
}
Run Code Online (Sandbox Code Playgroud)
我希望这种技巧能帮助你实现自己想要的目标.
如果不是这样,请告诉我如何为您提供帮助.
| 归档时间: |
|
| 查看次数: |
162531 次 |
| 最近记录: |