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]]
user3326293
  • 817
  • 1
  • 14
  • 37
  • Could it be that you accidentally put the `MainActivity` class in a package other than `org.nick.nfc.seaccess`? – Michael Roland Mar 27 '14 at 20:41
  • Nahhh; I'll post a picture of the workspace projects. – user3326293 Mar 27 '14 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? – user3326293 Mar 27 '14 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)*? – Michael Roland Mar 28 '14 at 06:39
  • The other project is from SVN. The names are: src/main/java, src/main/resources, and src/test/java – user3326293 Mar 29 '14 at 19:39
  • Do you think this is related to use of reflection in this app? I say this because this is what I see in the logs: Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException – user3326293 Mar 30 '14 at 18:42

1 Answers1

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?

Sofi Software LLC
  • 3,879
  • 1
  • 36
  • 34
  • 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. – user3326293 Mar 27 '14 at 19:23
  • You mean ? The LAUNCHER category defines whether the app can be launched. It should stay like that. – Sofi Software LLC Mar 27 '14 at 23:43
  • What is the package in the manifest, and what is the package in MainActivity.java? E.g. are they the same? – Sofi Software LLC Mar 27 '14 at 23:43
  • They all seem to be org.nick.nfc.seaccess. – user3326293 Mar 28 '14 at 01:12
  • Here's a long list of things to verify: http://stackoverflow.com/questions/4688277/java-lang-runtimeexception-unable-to-instantiate-activity-componentinfo – Sofi Software LLC Mar 28 '14 at 16:56
  • Thank. I am looking at the items in the list, and other possible issues. I think I need to validate that I have all of my project dependencies in the right place. I'll document the solution as soon as I find out something. Thank you so much for the help. – user3326293 Mar 29 '14 at 19:23