3

I have seen a number of questions similar to this one, but they seem to be specific to the classes and packages that they use. I tried some of the solutions, but did not help me. I get the following error:

03-27 14:30:08.604: D/AndroidRuntime(8057): Shutting down VM
03-27 14:30:08.604: W/dalvikvm(8057): threadid=1: thread exiting with uncaught exception (group=0x41c02c80)
03-27 14:30:08.604: E/AndroidRuntime(8057): FATAL EXCEPTION: main
03-27 14:30:08.604: E/AndroidRuntime(8057): Process: org.nick.nfc.seaccess, PID: 8057
03-27 14:30:08.604: E/AndroidRuntime(8057): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.nick.nfc.seaccess/org.nick.nfc.seaccess.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "org.nick.nfc.seaccess.MainActivity" on path: DexPathList[[zip file "/system/framework/com.android.nfc_extras.jar", zip file 

Any idea, how I should address it?

Here is the beginning of the main activity:

public class MainActivity extends Activity implements OnClickListener {

    private static final String TAG = MainActivity.class.getSimpleName();

    private Button gpInfoButton;
    private Button emvInfoButton;
    private Button walletInfoButton;

    private TextView infoText;

    private Terminal terminal;
    private CardConnection seConn;

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

Here is my activity tag from my manifest. I have seem sometimes folks add the full package name to the manifest. Shall I do this and see what happens?

    <activity
            android:name=".MainActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|s    mallestScreenSize"
            android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

I found a link that states the issue may be with how I have edited an xml file, which holds certificates. I have pasted the file below; removed the certs. Do you see any issue with it?

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Applications granted NFCEE access on user builds
    See packages/apps/Nfc/etc/sample_nfcee_access.xml for full documentation.
 -->
    <!--  Google wallet release signature -->
    <signer android:signature="308205bd852e" />

<!-- Sequent Wallet signature -->
<signer android:signature="30820243badc1df9d"/>
<!-- android-se-access signature-->
    <signer
android:signature="3082044cbd852e">
<package android:name="org.nic.nfc.seaccess"/>

</signer>
</resources>

Here is a view of the project workspace

workspace

I just saw something in the logs, which I wanted to add to this thread. Seems like the is a "-1", and "-2" next to the package name. Is that supposed to be there, or is that the cause of my issue? Here are the log messages I am talking about:

03-27 22:55:10.884: E/AndroidRuntime(9436): Caused by:     java.lang.ClassNotFoundException: Didn't find class "org.nick.nfc.seaccess.MainActivity"     on path: DexPathList[[zip file "/system/framework    /com.android.nfc_extras.jar", zip file "/data/app/org.nick.nfc.seaccess-    1.apk"],nativeLibraryDirectories=[/data/app-lib/org.nick.nfc.seaccess-1, /vendor/lib,     /system/lib]]
03-27 22:58:02.104: E/AndroidRuntime(9880): Caused by:     java.lang.ClassNotFoundException: Didn't find class "org.nick.nfc.seaccess.MainActivity"     on path: DexPathList[[zip file "/system/framework    /com.android.nfc_extras.jar", zip file "/data/app/org.nick.nfc.seaccess-    2.apk"],nativeLibraryDirectories=[/data/app-lib/org.nick.nfc.seaccess-2, /vendor/lib,         /system/lib]]
6
  • Could it be that you accidentally put the MainActivity class in a package other than org.nick.nfc.seaccess? Commented Mar 27, 2014 at 20:41
  • Nahhh; I'll post a picture of the workspace projects. Commented Mar 27, 2014 at 22:14
  • This project does reference a jar file, and JAVA code from another project. You can not see it in the picture because the all the way down the list of projects. Could I be getting this error because that project can not find the MainActivity of this one? Commented Mar 27, 2014 at 22:27
  • If that JAR file is only com.android.nfc_extras.jar that should not be a problem. Which package names are used in those other project(s)? Commented Mar 28, 2014 at 6:39
  • The other project is from SVN. The names are: src/main/java, src/main/resources, and src/test/java Commented Mar 29, 2014 at 19:39

1 Answer 1

0

From the trace: java.lang.ClassNotFoundException: Didn't find class "org.nick.nfc.seaccess.MainActivity"

This means the class org.nick.nfc.seaccess.MainActivity is undefined or can't be loaded.

Do you have a class org.nick.nfc.seaccess.MainActivity? What is the code? Does it have a default constructor? Is it declared in the manifest?

Sign up to request clarification or add additional context in comments.

6 Comments

I don't see a default constructor for the main activity. I am adding the beginning of the file to the start of this thread.
You mean <category android:name="android.intent.category.LAUNCHER" />? The LAUNCHER category defines whether the app can be launched. It should stay like that.
What is the package in the manifest, and what is the package in MainActivity.java? E.g. are they the same?
They all seem to be org.nick.nfc.seaccess.
Here's a long list of things to verify: stackoverflow.com/questions/4688277/…
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.