我已经从blog.kerul.net下载了资源。在我的程序启动很多错误之后,但是当我试图在模拟器上启动程序时它会给我这个错误:
应用程序意外停止。请再试一次
这是我的清单
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.kerul.mdictionary"
android:versionCode="2"
android:versionName="1.2" android:installLocation="auto">
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="13" android:maxSdkVersion="13"/><application android:icon="@drawable/icon" android:label="Переводчик">
<activity android:name=".kamusmm" android:label="mDictionary">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".a2m" android:label="a2m" />
<activity android:name=".m2a" android:label="m2a" />
<activity android:name=".e2ma" android:label="e2ma" />
<activity android:name=".aboutus" android:label="about" />
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<meta-data android:value="true" android:name="ADMOB_ALLOW_LOCATION_FOR_ADS" />
</manifest>
这里是我的java文件
package com.kerul.kamusmm;
import android.app.TabActivity;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import android.widget.Toast;
@SuppressWarnings("deprecation")
public class kamusmm extends TabActivity {
protected TabHost tabHost;
protected MyDBHelper myDBHelper;
protected Cursor cursor;
protected SQLiteDatabase db;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//set tab for dictionaries
tabHost = getTabHost();
//setTypeface(Typeface.createFromAsset(getAssets(),"dejavusans.ttf"));
String internetneeded="This app requires Internet connection to download image and pronunciation.";
Toast.makeText(this.getApplicationContext(), internetneeded, Toast.LENGTH_LONG).show();
newTabIntent("Melayu", null, m2a.class);
//newTabIntent(ArabicUtilities.reshape("\u1575\u1604\u1593\u1585\u1576\u1610\u1577"), null, a2m.class);//العربية
newTabIntent("Arab", null, a2m.class);
newTabIntent("English", null, e2ma.class);
tabHost.setCurrentTab(0);
}
protected void newTabIntent(String label, Drawable icon, Class<?> pageClass) {
TabSpec tabSpec = tabHost.newTabSpec(label);
tabSpec.setIndicator(label, icon);
//tabSpec.set
tabSpec.setContent(new Intent(this, pageClass));
tabHost.addTab(tabSpec);
}
}
这是我的日志猫的结尾
android.os.Handler.dispatchMessage(Handler.java:99)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.os.Looper.loop(Looper.java:132)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.app.ActivityThread.main(ActivityThread.java:4123)
04-29 08:36:08.079: E/AndroidRuntime(379): at java.lang.reflect.Method.invokeNative(Native Method)
04-29 08:36:08.079: E/AndroidRuntime(379): at java.lang.reflect.Method.invoke(Method.java:491)
04-29 08:36:08.079: E/AndroidRuntime(379): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
04-29 08:36:08.079: E/AndroidRuntime(379): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
04-29 08:36:08.079: E/AndroidRuntime(379): at dalvik.system.NativeStart.main(Native Method)
04-29 08:36:08.079: E/AndroidRuntime(379): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{net.kerul.mdictionary/net.kerul.mdictionary.m2a}: android.view.InflateException: Binary XML file line #13: Error inflating class com.google.ads.AdView
04-29 08:36:08.079: E/AndroidRuntime(379): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1815)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.app.ActivityThread.startActivityNow(ActivityThread.java:1656)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:135)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:347)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:676)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.widget.TabHost.setCurrentTab(TabHost.java:345)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.widget.TabHost.addTab(TabHost.java:235)
04-29 08:36:08.079: E/AndroidRuntime(379): at net.kerul.mdictionary.kamusmm.newTabIntent(kamusmm.java:47)
04-29 08:36:08.079: E/AndroidRuntime(379): at net.kerul.mdictionary.kamusmm.onCreate(kamusmm.java:34)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.app.Activity.performCreate(Activity.java:4397)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
04-29 08:36:08.079: E/AndroidRuntime(379): ... 11 more
04-29 08:36:08.079: E/AndroidRuntime(379): Caused by: android.view.InflateException: Binary XML file line #13: Error inflating class com.google.ads.AdView
04-29 08:36:08.079: E/AndroidRuntime(379): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:682)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.view.LayoutInflater.rInflate(LayoutInflater.java:724)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.view.LayoutInflater.inflate(LayoutInflater.java:347)
04-29 08:36:08.079: E/AndroidRuntime(379): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:223)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.app.Activity.setContentView(Activity.java:1786)
04-29 08:36:08.079: E/AndroidRuntime(379): at net.kerul.mdictionary.m2a.onCreate(m2a.java:50)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.app.Activity.performCreate(Activity.java:4397)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
04-29 08:36:08.079: E/AndroidRuntime(379): ... 22 more
04-29 08:36:08.079: E/AndroidRuntime(379): Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView in loader dalvik.system.PathClassLoader[/data/app/net.kerul.mdictionary-2.apk]
04-29 08:36:08.079: E/AndroidRuntime(379): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251)
04-29 08:36:08.079: E/AndroidRuntime(379): at java.lang.ClassLoader.loadClass(ClassLoader.java:540)
04-29 08:36:08.079: E/AndroidRuntime(379): at java.lang.ClassLoader.loadClass(ClassLoader.java:500)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.view.LayoutInflater.createView(LayoutInflater.java:542)
04-29 08:36:08.079: E/AndroidRuntime(379): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:671)
04-29 08:36:08.079: E/AndroidRuntime(379): ... 33 more
04-29 08:36:08.109: W/ActivityManager(82): Force finishing activity net.kerul.mdictionary/.kamusmm
04-29 08:36:08.258: D/dalvikvm(82): GC_FOR_ALLOC freed 74K, 23% free 9200K/11911K, paused 70ms
04-29 08:36:08.629: W/ActivityManager(82): Activity pause timeout for ActivityRecord{407f4cb8 net.kerul.mdictionary/.kamusmm}
04-29 08:36:09.198: D/dalvikvm(148): GC_EXPLICIT freed 155K, 6% free 9060K/9543K, paused 157ms+3ms
04-29 08:36:09.989: I/Process(379): Sending signal. PID: 379 SIG: 9
04-29 08:36:10.008: I/ActivityManager(82): Process net.kerul.mdictionary (pid 379) has died.
04-29 08:36:10.098: W/InputManagerService(82): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@407f2fc8
04-29 08:36:10.979: W/NotificationService(82): Object died trying to hide notification android.app.ITransientNotification$Stub$Proxy@40642888 in package net.kerul.mdictionary
04-29 08:36:10.979: W/ActivityManager(82): setProcessForeground called on unknown pid: 379
04-29 08:36:11.508: D/dalvikvm(82): GC_CONCURRENT freed 157K, 19% free 9715K/11911K, paused 6ms+5ms
04-29 08:36:19.419: W/ActivityManager(82): Activity destroy timeout for ActivityRecord{407f4cb8 net.kerul.mdictionary/.kamusmm}
答案 0 :(得分:0)
你得到ClassNotFoundException
引起:java.lang.ClassNotFoundException:com.google.ads.AdView in 装载机 dalvik.system.PathClassLoader [/data/app/net.kerul.mdictionary-2.apk]
我认为您添加了第三方库,尝试清理您的项目并再次构建它。