-1

我想得到任何帮助。我在这方面真的很糟糕,我不知道在做什么。

这是日志猫

在此处输入图像描述

这是模拟器中的错误

在此处输入图像描述

编辑

这是AndroidManifest中的代码

<application
    android:allowBackup="true"
    android:icon="@drawable/logo"
    android:label="@string/app_name"
    android:theme="@style/AppTheme"
    android:hardwareAccelerated="true">

    <activity android:name="com.google.ads.AdActivity"
                         android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

    <activity
        android:name="com.example"
        android:label="@string/app_name"
        android:hardwareAccelerated="true"
        android:theme="@android:style/Theme.Black.NoTitleBar"
        android:screenOrientation="portrait">

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

我真的不知道活动名称是什么,但这里有一些代码activity.java

import java.io.IOException;

import android.media.MediaPlayer;
import android.os.Bundle;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.res.AssetFileDescriptor;

import android.util.Log;
import android.view.KeyEvent;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import com.google.analytics.tracking.android.EasyTracker;
import com.google.ads.*;
import com.google.ads.AdRequest.ErrorCode;

@SuppressLint({ "SetJavaScriptEnabled", "JavascriptInterface" })
public class activity extends Activity implements AdListener {
  public  MediaPlayer player = new MediaPlayer();
  public WebView webView;
  AssetFileDescriptor afd = null;
  private InterstitialAd interstitial;

  public void onCreate(Bundle savedInstanceState)
  {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

  this.webView = ((WebView)findViewById(R.id.webView));
        this.webView.getSettings().setJavaScriptEnabled(true);
        this.webView.setWebChromeClient(new WebChromeClient());
        this.webView.addJavascriptInterface(this, "activity");
        this.webView.loadUrl("file:///android_asset/index.html");

非常感谢你的帮助

我变了

<activity android:name="com.google.ads.AdActivity"

<activity android:name="com.example.Activity"

保存,清理并尝试再次运行它,但它仍然给我 appname has stop working

这是logcat

11-08 20:50:48.770: W/dalvikvm(1342): threadid=1: thread exiting with uncaught exception (group=0x41465700)
11-08 20:50:48.810: E/AndroidRuntime(1342): FATAL EXCEPTION: main
11-08 20:50:48.810: E/AndroidRuntime(1342): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example/com.example}: java.lang.ClassNotFoundException: Didn't find class "com.example" on path: DexPathList[[zip file "/data/app/com.example-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example-2, /system/lib]]
11-08 20:50:48.810: E/AndroidRuntime(1342):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
11-08 20:50:48.810: E/AndroidRuntime(1342):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
11-08 20:50:48.810: E/AndroidRuntime(1342):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
11-08 20:50:48.810: E/AndroidRuntime(1342):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
11-08 20:50:48.810: E/AndroidRuntime(1342):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-08 20:50:48.810: E/AndroidRuntime(1342):     at android.os.Looper.loop(Looper.java:137)
11-08 20:50:48.810: E/AndroidRuntime(1342):     at android.app.ActivityThread.main(ActivityThread.java:5103)
11-08 20:50:48.810: E/AndroidRuntime(1342):     at java.lang.reflect.Method.invokeNative(Native Method)
11-08 20:50:48.810: E/AndroidRuntime(1342):     at java.lang.reflect.Method.invoke(Method.java:525)
11-08 20:50:48.810: E/AndroidRuntime(1342):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
11-08 20:50:48.810: E/AndroidRuntime(1342):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-08 20:50:48.810: E/AndroidRuntime(1342):     at dalvik.system.NativeStart.main(Native Method)
11-08 20:50:48.810: E/AndroidRuntime(1342): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example" on path: DexPathList[[zip file "/data/app/com.example-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example-2, /system/lib]]
4

1 回答 1

2

在您的清单中,您指定您的活动名称,com.example因为它实际上应该是您的活动名称:com.example.activity。改变这个:

<activity
    android:name="com.example"

对此:

<activity
    android:name="com.example.activity"
于 2013-11-09T02:24:38.490 回答