JavaEar 专注于收集分享传播有价值的技术资料

在" 启动项目" 期间发生内部错误。显示java.lang.NullPointerException (An internal error occurred during: "Launching Project". java.lang.NullPointerException)

问题描述


英文原文

My android project was compiling well but suddenly it stopped launching. Then I tried to launch other projects from Project Explorer and all project threw same exception:

An internal error occurred during: "Launching Project". java.lang.NullPointerException

But console always shows everything is normal.

Android Launch!
adb is running normally.
Performing com.mmcolrev.LoginActivity activity launch

Here's screenshot of error.

enter image description here


中文翻译

My android project was compiling well but suddenly it stopped launching. Then I tried to launch other projects from Project Explorer and all project threw same exception:

An internal error occurred during: "Launching Project". java.lang.NullPointerException

But console always shows everything is normal.

Android Launch!
adb is running normally.
Performing com.mmcolrev.LoginActivity activity launch

Here's screenshot of error.

enter image description here

My android project was compiling well but suddenly it stopped launching. Then I tried to launch other projects from Project Explorer and all project threw same exception:

An internal error occurred during: "Launching Project". java.lang.NullPointerException

But console always shows everything is normal.

Android Launch!
adb is running normally.
Performing com.mmcolrev.LoginActivity activity launch

Here's screenshot of error.

enter image description here

My android project was compiling well but suddenly it stopped launching. Then I tried to launch other projects from Project Explorer and all project threw same exception:

An internal error occurred during: "Launching Project". java.lang.NullPointerException

But console always shows everything is normal.

Android Launch!
adb is running normally.
Performing com.mmcolrev.LoginActivity activity launch

Here's screenshot of error.

enter image description here

7个回答

    最佳答案

  1. 英文原文

    If anyone face this problem, first keep in mind that error is not in your code but due to some internal issue in eclipse ADT. I don't know exact problem but luckily found way to solve it. If you ever encounter this error follow steps below:

    1. Exit Eclipse.
    2. Go to Android workspace.
    3. Locate .metadata folder(make sure you set hidden folder visibility on).
    4. Delete .metedata folder.
    5. Start Eclipse(you will notice project explorer is empty, don't panic) and import all your projects.

    中文翻译

    如果有人遇到此问题,请首先记住错误不在您的代码中,而是由于eclipse ADT中的一些内部问题。我不知道确切的问题,但幸运的是找到了解决问题的方法。如果您遇到此错误,请按照以下步骤操作:

    1. 退出Eclipse。
    2. 转到Android工作区。
    3. 找到.metadata文件夹(确保设置隐藏文件夹可见性)。
    4. 删除.metedata文件夹。
    5. 启动Eclipse(您会注意到项目浏览器为空,不要惊慌)并导入所有项目。

    If anyone face this problem, first keep in mind that error is not in your code but due to some internal issue in eclipse ADT. I don't know exact problem but luckily found way to solve it. If you ever encounter this error follow steps below:

    1. Exit Eclipse.
    2. Go to Android workspace.
    3. Locate .metadata folder(make sure you set hidden folder visibility on).
    4. Delete .metedata folder.
    5. Start Eclipse(you will notice project explorer is empty, don't panic) and import all your projects.

    如果有人遇到此问题,请首先记住错误不在您的代码中,而是由于eclipse ADT中的一些内部问题。我不知道确切的问题,但幸运的是找到了解决问题的方法。如果您遇到此错误,请按照以下步骤操作:

    1. 退出Eclipse。
    2. 转到Android工作区。
    3. 找到.metadata文件夹(确保设置隐藏文件夹可见性)。
    4. 删除.metedata文件夹。
    5. 启动Eclipse(您会注意到项目浏览器为空,不要惊慌)并导入所有项目。
  2. 参考答案2

  3. 英文原文

    Removing Gen/R.java and restarting eclipse, worked for me.


    中文翻译

    Removing Gen/R.java and restarting eclipse, worked for me.

  4. 参考答案3

  5. 英文原文

    This is a cause of AVD is not picked because you might delete it or it is not picked up correctly ... in other words deployment target is not specified or it has some problem in picking up a device.

    To Resolve this:

    • Right click your project and choose "Properties"
    • From "Run/Debug" Settings, Highlight over your application name then hit "Edit..."
    • In "Target" tab, you have to choose a virtual device to be picked automatically under option named "Automatically pick compatible device..."
      • to avoid such prompt you could choose the first option "Always prompt to pick device" that will ask you everytime to choose or pick a device inside which you want to run your app.

    If it still not working restart Eclipse


    中文翻译

    This is a cause of AVD is not picked because you might delete it or it is not picked up correctly ... in other words deployment target is not specified or it has some problem in picking up a device.

    To Resolve this:

    • Right click your project and choose "Properties"
    • From "Run/Debug" Settings, Highlight over your application name then hit "Edit..."
    • In "Target" tab, you have to choose a virtual device to be picked automatically under option named "Automatically pick compatible device..."
      • to avoid such prompt you could choose the first option "Always prompt to pick device" that will ask you everytime to choose or pick a device inside which you want to run your app.

    If it still not working restart Eclipse

  6. 参考答案4

  7. 英文原文

    One cause of this issue for me was that I had been updating my Android Tools with the installer. It was running in the background doing all its updates. I had forgotten about it since I had told it to do the work in the background. Then realized it had finished its work and needed a restart after the installation.

    Once the upgrade / installation was done and the IDE was restarted, the Eclipse environment went back to behaving as normal.


    中文翻译

    One cause of this issue for me was that I had been updating my Android Tools with the installer. It was running in the background doing all its updates. I had forgotten about it since I had told it to do the work in the background. Then realized it had finished its work and needed a restart after the installation.

    Once the upgrade / installation was done and the IDE was restarted, the Eclipse environment went back to behaving as normal.

  8. 参考答案5

  9. 英文原文

    In my case, it was because I was running it with Debug As -> Android Native Application, while the emulator was closed (I debugging on the emulator, not on a real phone).

    I needed to first start the emulator using Debug As -> Android Application, after which Debug As -> Android Native Application will work.

    Close the emulator and the error re-appears. My conclusion is that Debug As -> Android Native Application won't work unless the emulator is already started.


    中文翻译

    In my case, it was because I was running it with Debug As -> Android Native Application, while the emulator was closed (I debugging on the emulator, not on a real phone).

    I needed to first start the emulator using Debug As -> Android Application, after which Debug As -> Android Native Application will work.

    Close the emulator and the error re-appears. My conclusion is that Debug As -> Android Native Application won't work unless the emulator is already started.

  10. 参考答案6

  11. 英文原文

    I had this error with an NDK project (eclipse mars, loaded an ant project) everytime i tried to lauch on the device (google tango yellowstone) using Debug As -> Android Native Application. Note, that i switched the device and changed a dependent library since the last successful build.

    When i tried Debug As -> Android Application i got this message:

    Re-installation failed due to different application signatures. You must perform a full uninstall of the application. WARNING: This will remove the application data!

    Do you want to uninstall?

    clicking OK here solved the issue, so Debug As -> Android Native Application also worked again.


    中文翻译

    I had this error with an NDK project (eclipse mars, loaded an ant project) everytime i tried to lauch on the device (google tango yellowstone) using Debug As -> Android Native Application. Note, that i switched the device and changed a dependent library since the last successful build.

    When i tried Debug As -> Android Application i got this message:

    Re-installation failed due to different application signatures. You must perform a full uninstall of the application. WARNING: This will remove the application data!

    Do you want to uninstall?

    clicking OK here solved the issue, so Debug As -> Android Native Application also worked again.

  12. 参考答案7

  13. 英文原文

    I had the same issue all of a sudden. This only happened when I ran in Debug mode, and for me what fixed it was... Run -> Remove All Breakpoints. Then I could add them back, and it ran in debug mode fine.


    中文翻译

    I had the same issue all of a sudden. This only happened when I ran in Debug mode, and for me what fixed it was... Run -> Remove All Breakpoints. Then I could add them back, and it ran in debug mode fine.