机器人:无级高清从库项目中找到错误 [英] android: no class def found error from library project

查看:132
本文介绍了机器人:无级高清从库项目中找到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到一个noclassdeffound例外,我跑与模拟器的应用程序时:

i am getting a noclassdeffound exception, when running my app with the emulator:

@Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    Intent myIntent = new Intent(ActivityPano.this, ActivityTable.class);
    startActivity(myIntent);
}

在ActivityTable导致了异常。

the ActivityTable is causing the exception.

它是在一个Android库项目,我已经包含在Java构建路径,以及在Android引用对话框中定义。有在eclipse中没有错误,但是当在模拟器开始崩溃。

it is defined in an android-library project, which i have included in the java build path as well as in the android references dialog. there are no errors in eclipse, but when started in the emulator it crashes.

这是我的清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.mypackage"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar" android:debuggable="false" android:description="@string/description">
        <activity android:name=".ActivityHPanorama"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>


        <activity android:name="com.mypackage.ActivityTable"></activity>

    </application>


<uses-sdk android:minSdkVersion="3"></uses-sdk>
</manifest> 

这是从logcat的错误:

this is the error from the logcat:

04-18 11:32:07.767: ERROR/dalvikvm(483): Could not find class com.mypackage.ActivityTable', referenced from method com.mypackage.ActivityHPanorama.onCreate

是什么让我有点怀疑是这条线从控制台(而不是logcat中):

what makes me a bit suspicious is this line from the console (not the logcat):

[2011-04-18 14:55:59 - panorama] Could not find panorama.apk!

全景是库项目的名称。

panorama is the name of the library project.

推荐答案

如果你是depenedencies是正确的,当你安装的应用程序,你应该可以看到在控制台日志以下

If you are depenedencies are correct when you are installing the app you should see following in console logs

[2011-04-19 16点41分10秒 - 井字游戏]安装TicTacToe.apk ... [2011-04-19 16点41分12秒 - 井字游戏]!成功

[2011-04-19 16:41:10 - TicTacToe] Installing TicTacToe.apk... [2011-04-19 16:41:12 - TicTacToe] Success!

不过既然你提的是,找不到panorama.apk!我试图复制这种行为利用井字棋sameple库。

But since you were mentioning that Could not find panorama.apk! I tried replicating such behaviour using tic-tac-toe sameple library..

这是我做的,

新增井字游戏库偏食,新增井字游戏应用程序还偏食。

Added TicTacToe Library to eclipse, Added TicTacToe app also to eclipse.

右键点击Library项目,去到Android选项卡,并取消IsLibrary检查

Right clicked on Library project, went to android tab and removed the IsLibrary check

右键点击主应用程序的项目,去到Android选项卡中删除相关

Right clicked on Main app project, went to android tab removed dependency

在去主要的应用程序项目的Java构建路径,并添加库项目所需项目

The went to java build path of Main app project and added Library project as required project

编纂了罚款,但安装该应用程序是检查library.apk我猜如果你正在做类似的话达可能是这个问题的时候。

Compilation went fine, but when installing the app it is checking for library.apk I am guessing if you are doing anything similar tat might be the issue.

[2011-04-19 16点42分16秒 - 井字游戏]安装TicTacToe.apk ... [2011-04-19十六点42分20秒 - 井字游戏]成功! [2011-04-19十六点42分20秒 - 井字游戏]项目依赖发现,安装:TicTacToeLib [2011-04-19十六点42分20秒 - TicTacToeLib]上传TicTacToeLib.apk到设备SH0A5PL08769 [2011-04-19十六点42分20秒 - TicTacToeLib]安装TicTacToeLib.apk ... [2011-04-19 16点42分24秒 - TicTacToeLib]!成功

[2011-04-19 16:42:16 - TicTacToe] Installing TicTacToe.apk... [2011-04-19 16:42:20 - TicTacToe] Success! [2011-04-19 16:42:20 - TicTacToe] Project dependency found, installing: TicTacToeLib [2011-04-19 16:42:20 - TicTacToeLib] Uploading TicTacToeLib.apk onto device 'SH0A5PL08769' [2011-04-19 16:42:20 - TicTacToeLib] Installing TicTacToeLib.apk... [2011-04-19 16:42:24 - TicTacToeLib] Success!

这篇关于机器人:无级高清从库项目中找到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆