android: no class def found error from library project

前端 未结 4 1987
庸人自扰
庸人自扰 2021-01-18 18:32

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

@Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCre         


        
相关标签:
4条回答
  • 2021-01-18 18:57

    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] Installing TicTacToe.apk...

    [2011-04-19 16:41:12 - TicTacToe] Success!

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

    This is what i did,

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

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

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

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

    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] 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!

    0 讨论(0)
  • 2021-01-18 19:04

    I think you should use

     Intent myScreen = new Intent();
        myScreen.setClassName(YourCurrentScreen.this,
    fullpackagename.yourclassName.class.getName());
        startActivityForResult(myScreen, 0);
    

    This would definitely work

    0 讨论(0)
  • 2021-01-18 19:12

    have you add this class in your Manifest?

    <activity android:name="ActivityTable"></activity>

    0 讨论(0)
  • 2021-01-18 19:20

    The problem is that you haven't defined any intent-filters for your "ActivityTable" as well...

    <activity android:name=".ActivityTable" 
                      android:label="ActivityTable">
                <intent-filter>
                    <action android:name="android.intent.action.VIEW" />
                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
            </activity>
    

    This should help..

    0 讨论(0)
提交回复
热议问题