Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
java.lang.RuntimeException:无法实例化活动_Java_Android_Eclipse - Fatal编程技术网

java.lang.RuntimeException:无法实例化活动

java.lang.RuntimeException:无法实例化活动,java,android,eclipse,Java,Android,Eclipse,很抱歉,我看到过类似的帖子,但它们对我找到的所有帖子都没有帮助。当我重新格式化我的笔记本电脑并使用多种工具来恢复代码时,我丢失了我的项目,但这并不是我所拥有的方式。在再次修复之后,我不断遇到这些错误,我对java有点陌生,所以请解释一下 11-23 00:36:53.805: ERROR/Zygote(33): setreuid() failed. errno: 2 11-23 00:37:01.734: ERROR/Zygote(33): setreuid() failed. errn

很抱歉,我看到过类似的帖子,但它们对我找到的所有帖子都没有帮助。当我重新格式化我的笔记本电脑并使用多种工具来恢复代码时,我丢失了我的项目,但这并不是我所拥有的方式。在再次修复之后,我不断遇到这些错误,我对java有点陌生,所以请解释一下

    11-23 00:36:53.805: ERROR/Zygote(33): setreuid() failed. errno: 2
11-23 00:37:01.734: ERROR/Zygote(33): setreuid() failed. errno: 17
11-23 00:37:03.025: ERROR/BatteryService(59): usbOnlinePath not found
11-23 00:37:03.025: ERROR/BatteryService(59): batteryVoltagePath not found
11-23 00:37:03.025: ERROR/BatteryService(59): batteryTemperaturePath not found
11-23 00:37:03.054: ERROR/SurfaceFlinger(59): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
11-23 00:37:09.384: ERROR/EventHub(59): could not get driver version for /dev/input/mouse0, Not a typewriter
11-23 00:37:09.384: ERROR/EventHub(59): could not get driver version for /dev/input/mice, Not a typewriter
11-23 00:37:09.654: ERROR/System(59): Failure starting core service
11-23 00:37:09.654: ERROR/System(59): java.lang.SecurityException
11-23 00:37:09.654: ERROR/System(59):     at android.os.BinderProxy.transact(Native Method)
11-23 00:37:09.654: ERROR/System(59):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
11-23 00:37:09.654: ERROR/System(59):     at android.os.ServiceManager.addService(ServiceManager.java:72)
11-23 00:37:09.654: ERROR/System(59):     at com.android.server.ServerThread.run(SystemServer.java:184)
11-23 00:37:10.406: ERROR/SoundPool(59): error loading /system/media/audio/ui/Effect_Tick.ogg
11-23 00:37:10.414: ERROR/SoundPool(59): error loading /system/media/audio/ui/KeypressStandard.ogg
11-23 00:37:10.414: ERROR/SoundPool(59): error loading /system/media/audio/ui/KeypressSpacebar.ogg
11-23 00:37:10.414: ERROR/SoundPool(59): error loading /system/media/audio/ui/KeypressDelete.ogg
11-23 00:37:10.414: ERROR/SoundPool(59): error loading /system/media/audio/ui/KeypressReturn.ogg
11-23 00:37:12.275: ERROR/ThrottleService(59): Could not open GPS configuration file /etc/gps.conf
11-23 00:37:13.605: ERROR/logwrapper(150): executing /system/bin/tc failed: No such file or directory
11-23 00:37:13.635: ERROR/logwrapper(151): executing /system/bin/tc failed: No such file or directory
11-23 00:37:13.685: ERROR/logwrapper(152): executing /system/bin/tc failed: No such file or directory
11-23 00:37:24.969: ERROR/HierarchicalStateMachine(59): TetherMaster - unhandledMessage: msg.what=3
11-23 00:37:39.699: ERROR/AndroidRuntime(293): FATAL EXCEPTION: main
11-23 00:37:39.699: ERROR/AndroidRuntime(293): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.sundaypsalmdoy/com.sundaypsalmdoy.SundayPsalmody}: java.lang.ClassNotFoundException: com.sundaypsalmdoy.SundayPsalmody in loader dalvik.system.PathClassLoader[/data/app/com.sundaypsalmdoy-1.apk]
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at android.os.Looper.loop(Looper.java:123)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at android.app.ActivityThread.main(ActivityThread.java:4627)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at java.lang.reflect.Method.invokeNative(Native Method)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at java.lang.reflect.Method.invoke(Method.java:521)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at dalvik.system.NativeStart.main(Native Method)
11-23 00:37:39.699: ERROR/AndroidRuntime(293): Caused by: java.lang.ClassNotFoundException: com.sundaypsalmdoy.SundayPsalmody in loader dalvik.system.PathClassLoader[/data/app/com.sundaypsalmdoy-1.apk]
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
11-23 00:37:39.699: ERROR/AndroidRuntime(293):     ... 11 more




package com.sundaypsalmody;

import com.sundaypsalmdoy.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.view.View.OnClickListener;

public class SundayPsalmody extends Activity implements OnClickListener {
    Button commemoration;
    Button conclusionadam;
    Button conclusionbatos;
    Button first;
    Button fourth;
    Button friday;
    Button glossory;
    Button intro;
    Button midnightdoxology;
    Button monday;
    Button morningdoxology;
    Button praiseofangels;
    Button psalies;
    Button resurrectionhymn;
    Button saturday;
    Button seasonalDoxology;
    Button second;
    Button stDoxology;
    Button sundaypsali;
    Button sundaytheotokia;
    Button sundaytheotokiaGospel;
    Button third;
    Button thursday;
    Button tuesday;
    Button verses;
    Button wednesday;

    public void onCreate(Bundle paramBundle) {
        super.onCreate(paramBundle);
        setContentView(R.layout.main);

        intro = (Button) findViewById(R.id.btnIntro);
        first = (Button) findViewById(R.id.btnFirstHoos);
        second = (Button) findViewById(R.id.btnSeconHoos);
        third = (Button) findViewById(R.id.btnThirdHoos);
        fourth = (Button) findViewById(R.id.btnFirstHoos);
        commemoration = (Button) findViewById(R.id.btnCommemoration);
        sundaypsali = (Button) findViewById(R.id.btnSundayPsaliforvirgin);
        sundaytheotokia = (Button) findViewById(R.id.btnSundayTheotokia);
        sundaytheotokiaGospel = (Button) findViewById(R.id.btnSundayTheotokia2);
        conclusionadam = (Button) findViewById(R.id.btnConclusionAdam);
        monday = (Button) findViewById(R.id.btnMonday);
        tuesday = (Button) findViewById(R.id.btnTuesday);
        thursday = (Button) findViewById(R.id.btnWednesday);
        thursday = (Button) findViewById(R.id.btnThursday);
        friday = (Button) findViewById(R.id.btnFriday);
        saturday = (Button) findViewById(R.id.btnSaturday);
        conclusionbatos = (Button) findViewById(R.id.btnConclusionBatos);
        morningdoxology = (Button) findViewById(R.id.btnMorningDoxology);
        praiseofangels = (Button) findViewById(R.id.btnPraiseofAngel);
        verses = (Button) findViewById(R.id.btnVerses);
        stDoxology = (Button) findViewById(R.id.btnDoxologySaints);
        seasonalDoxology = (Button) findViewById(R.id.btnDoxologySeason);
        psalies = (Button) findViewById(R.id.btnPsali);
        glossory = (Button) findViewById(R.id.btnGlossory);
        resurrectionhymn = (Button) findViewById(R.id.btnHymnofResurrection);

        intro.setOnClickListener(this);
        first.setOnClickListener(this);
        second.setOnClickListener(this);
        third.setOnClickListener(this);
        fourth.setOnClickListener(this);
        commemoration.setOnClickListener(this);
        sundaypsali.setOnClickListener(this);
        sundaytheotokia.setOnClickListener(this);
        sundaytheotokiaGospel.setOnClickListener(this);
        conclusionadam.setOnClickListener(this);
        monday.setOnClickListener(this);
        tuesday.setOnClickListener(this);
        wednesday.setOnClickListener(this);
        thursday.setOnClickListener(this);
        friday.setOnClickListener(this);
        saturday.setOnClickListener(this);
        conclusionbatos.setOnClickListener(this);
        morningdoxology.setOnClickListener(this);
        praiseofangels.setOnClickListener(this);
        verses.setOnClickListener(this);
        stDoxology.setOnClickListener(this);
        seasonalDoxology.setOnClickListener(this);
        psalies.setOnClickListener(this);
        glossory.setOnClickListener(this);
        resurrectionhymn.setOnClickListener(this);

    }

    public void onClick(View v) {
        switch (v.getId()) {
        case R.id.btnIntro:
            startActivity(new Intent(this, Intro.class));
            break;
        case R.id.btnFirstHoos:
            startActivity(new Intent(this, First.class));
            break;
        case R.id.btnSeconHoos:
            startActivity(new Intent(this, Second.class));
            break;
        case R.id.btnThirdHoos:
            startActivity(new Intent(this, Third.class));
            break;
        case R.id.btnFourthHoos:
            startActivity(new Intent(this, Fourth.class));
            break;
        case R.id.btnCommemoration:
            startActivity(new Intent(this, Commemoration.class));
            break;
        case R.id.btnSundayPsaliforvirgin:
            startActivity(new Intent(this, SundayPsali.class));
            break;
        case R.id.btnSundayTheotokia:
            startActivity(new Intent(this, SundayTheotokia.class));
            break;
        case R.id.btnSundayTheotokia2:
            startActivity(new Intent(this, SundayTheotokiaGospel.class));
            break;
        case R.id.btnConclusionAdam:
            startActivity(new Intent(this, ConclusionAdam.class));
            break;
        case R.id.btnMonday:
            startActivity(new Intent(this, Monday.class));
            break;
        case R.id.btnTuesday:
            startActivity(new Intent(this, Tuesday.class));
            break;
        case R.id.btnWednesday:
            startActivity(new Intent(this, Wednesday.class));
            break;
        case R.id.btnThursday:
            startActivity(new Intent(this, Thursday.class));
            break;
        case R.id.btnFriday:
            startActivity(new Intent(this, Friday.class));
            break;
        case R.id.btnSaturday:
            startActivity(new Intent(this, Saturday.class));
            break;
        case R.id.btnConclusionBatos:
            startActivity(new Intent(this, ConclusionBatos.class));
            break;
        case R.id.btnMorningDoxology:
            startActivity(new Intent(this, MorningDoxology.class));
            break;
        case R.id.btnPraiseofAngel:
            startActivity(new Intent(this, PraiseOfAngels.class));
            break;
        case R.id.btnVerses:
            startActivity(new Intent(this, VersesOfCymbals.class));
            break;
        case R.id.btnDoxologySaints:
            startActivity(new Intent(this, SaintsDoxology.class));
            break;
        case R.id.btnDoxologySeason:
            startActivity(new Intent(this, SeasonalDoxology.class));
            break;
        case R.id.btnPsali:
            startActivity(new Intent(this, Psalis.class));
            break;
        case R.id.btnGlossory:
            startActivity(new Intent(this, Glossary.class));
            break;
        case R.id.btnHymnofResurrection:
            startActivity(new Intent(this, ResurrectionHymn.class));
            break;
        }
    }
}
以防有人看到舱单上有我看不到的错误

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.sundaypsalmdoy" android:versionCode="4"
    android:versionName="2.2" android:installLocation="preferExternal">
    <application android:label="@string/app_name" android:icon="@drawable/icon"
        android:debuggable="true" android:restoreNeedsApplication="true">
        <activity android:label="@string/app_name" android:name=".SundayPsalmody">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".AbbaKirDoxology" />
        <activity android:name=".AbbaSarapamonDoxology" />
        <activity android:name=".AnnunciationAdamPsali" />
        <activity android:name=".AnnunciationBatosPsali" />
        <activity android:name=".Wednesday" />

                About 144 more activities with the same style

    </application>
    <uses-sdk android:minSdkVersion="8" />
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>

同一风格的活动约有144项
试试:


  • 删除
    导入com.sundaysalmody.R从您的
    SundayPsalmody
    活动中的导入列表
  • 检查是否在
    Manifest.xml
    文件中正确声明了所有
    活动
  • 清理并构建您的项目
  • 运行应用程序

  • 请清理这个项目。运行新的构建。删除
    import com.sundaypsalmdoy.R从导入列表中,检查是否在清单文件中正确声明了所有活动文件然后尝试清理并构建项目。然后尝试运行应用程序..当我删除import com.sundaypsalmdoy.R时;它抱怨所有的R.id和R.layout,这就是我感到困惑的地方。我知道它不应该在那里。当你清理你的项目并再次构建时,R.java会自动生成。我一直删除com.sundaypsalmody.R,但它会抱怨R.id.[任何控制]。当我重新添加任何控件时,它会再次添加com.sundaypsalmody.R。。。我真的很想继续这个项目,而不是开始一个新的副本,因为我想更新已经上市的应用程序,而不是添加一个新的。问题在于清单中没有正确地声明活动,而不是我需要非常感谢你帮助我回答你的#2!