Error in registerActivity

Forum / MIFARE SDK / Error in registerActivity

  • 25. February 2016 at 8:44

    C C
    When I try to use advance sdk, I got the following error. It comes from registerActivity. I have no idea about what's wrong with the code, since it is the second line when initializing lib. Does anyone know any clue about this? Thanks.

    Error message:

    E/AndroidRuntime( 733): FATAL EXCEPTION: main
    E/AndroidRuntime( 733): java.lang.NoClassDefFoundError: com.nxp.nfclib.ˊ
    E/AndroidRuntime( 733): at com.nxp.nfclib.NxpNfcLib.registerActivity(:1412)
    E/AndroidRuntime( 733): at com.android.settings.CryptKeeper.initializeLib(CryptKeeper.java:631)
    E/AndroidRuntime( 733): at com.android.settings.CryptKeeper.onCreate(CryptKeeper.java:434)


    public void initializeLib()
    {
    libInstance = NxpNfcLib.getInstance();
    libInstance.registerActivity(this, Constant.packageKey);
    ....
    }

    + 0  |  - 0

    Re: Error in registerActivity

    26. February 2016 at 14:02
    Hi,

    It seems that you have not included the library!

    Please put the file nxpnfclib.jar in the directory libs. It will be found by Eclipse or Android Studio. Rebuild your project. It should works now.

    Regards,
    The MIFARE Team
    + 0  |  - 0

    Re: Error in registerActivity

    29. February 2016 at 10:00

    C C
    Hi,

    I've included the jar file into the project. It seems that some file names causing warnings.

    Reading program jar [/home/chang/mako/out/target/common/obj/APPS/Settings_intermediates/classes.jar]
    Warning: class [com/nxp/nfclib/plus/╦К.class] unexpectedly contains class [com.nxp.nfclib.plus.ˊ]
    Warning: class [com/nxp/nfclib/╦К$2.class] unexpectedly contains class [com.nxp.nfclib.ˊ$2]
    Warning: class [com/nxp/nfclib/╦К$1.class] unexpectedly contains class [com.nxp.nfclib.ˊ$1]
    Warning: class [com/nxp/nfclib/╦К$if$1.class] unexpectedly contains class [com.nxp.nfclib.ˊ$if$1]
    Warning: class [com/nxp/nfclib/desfire/╦Л$1.class] unexpectedly contains class [com.nxp.nfclib.desfire.ˋ$1]
    Warning: class [com/nxp/nfclib/desfire/DESFireFile$╦К.class] unexpectedly contains class [com.nxp.nfclib.desfire.DESFireFile$ˊ]
    Warning: class [com/nxp/nfclib/desfire/╦О.class] unexpectedly contains class [com.nxp.nfclib.desfire.?]
    Warning: class [com/nxp/nfclib/desfire/╦Л.class] unexpectedly contains class [com.nxp.nfclib.desfire.ˋ]
    Warning: class [com/nxp/nfclib/desfire/╦К.class] unexpectedly contains class [com.nxp.nfclib.desfire.ˊ]
    Warning: class [com/nxp/nfclib/ndef/Uri$╦П.class] unexpectedly contains class [com.nxp.nfclib.ndef.Uri$?]
    Warning: class [com/nxp/nfclib/ndef/Uri$╦Л.class] unexpectedly contains class [com.nxp.nfclib.ndef.Uri$ˋ]
    Warning: class [com/nxp/nfclib/ndef/Uri$╦О.class] unexpectedly contains class [com.nxp.nfclib.ndef.Uri$?]
    Warning: class [com/nxp/nfclib/ndef/Uri$╦К.class] unexpectedly contains class [com.nxp.nfclib.ndef.Uri$ˊ]
    Warning: class [com/nxp/nfclib/icode/╩╗.class] unexpectedly contains class [com.nxp.nfclib.icode.?]
    Warning: class [com/nxp/nfclib/icode/╩╝.class] unexpectedly contains class [com.nxp.nfclib.icode.?]
    Warning: class [com/nxp/nfclib/icode/╦П.class] unexpectedly contains class [com.nxp.nfclib.icode.?]
    Warning: class [com/nxp/nfclib/icode/╦О.class] unexpectedly contains class [com.nxp.nfclib.icode.?]
    Warning: class [com/nxp/nfclib/icode/сРЭ.class] unexpectedly contains class [com.nxp.nfclib.icode.?]
    Warning: class [com/nxp/nfclib/icode/╦Л.class] unexpectedly contains class [com.nxp.nfclib.icode.ˋ]
    Warning: class [com/nxp/nfclib/icode/╦К.class] unexpectedly contains class [com.nxp.nfclib.icode.ˊ]
    Warning: class [com/nxp/nfclib/keystore/hardware/╦Л$if.class] unexpectedly contains class [com.nxp.nfclib.keystore.hardware.ˋ$if]
    Warning: class [com/nxp/nfclib/keystore/hardware/╦Л$1.class] unexpectedly contains class [com.nxp.nfclib.keystore.hardware.ˋ$1]
    Warning: class [com/nxp/nfclib/keystore/hardware/╦Л$If.class] unexpectedly contains class [com.nxp.nfclib.keystore.hardware.ˋ$If]
    Warning: class [com/nxp/nfclib/keystore/hardware/╦О.class] unexpectedly contains class [com.nxp.nfclib.keystore.hardware.?]
    Warning: class [com/nxp/nfclib/keystore/hardware/╦Л$╦К.class] unexpectedly contains class [com.nxp.nfclib.keystore.hardware.ˋ$ˊ]
    Warning: class [com/nxp/nfclib/keystore/hardware/╦Л.class] unexpectedly contains class [com.nxp.nfclib.keystore.hardware.ˋ]
    Warning: class [com/nxp/nfclib/keystore/hardware/╦К.class] unexpectedly contains class [com.nxp.nfclib.keystore.hardware.ˊ]
    Warning: class [com/nxp/nfclib/╦К$if.class] unexpectedly contains class [com.nxp.nfclib.ˊ$if]
    Warning: class [com/nxp/nfclib/ntag/╦К.class] unexpectedly contains class [com.nxp.nfclib.ntag.ˊ]
    Warning: class [com/nxp/nfclib/╦К.class] unexpectedly contains class [com.nxp.nfclib.ˊ]
    Reading library jar [/home/chang/mako/out/target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates/classes.jar]
    Reading library jar [/home/chang/mako/out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar]
    Reading library jar [/home/chang/mako/out/target/common/obj/JAVA_LIBRARIES/core-junit_intermediates/classes.jar]
    Reading library jar [/home/chang/mako/out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar]
    Reading library jar [/home/chang/mako/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar]
    Reading library jar [/home/chang/mako/out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/classes.jar]
    Warning: there were 30 classes in incorrectly named files.
    You should make sure all file names correspond to their class names.
    The directory hierarchies must correspond to the package hierarchies.
    If you don't mind the mentioned classes not being written out,
    you could try your luck using the '-ignorewarnings' option.
    Error: Please correct the above warnings first.
    + 0  |  - 0

    Re: Error in registerActivity

    29. February 2016 at 16:05
    Hi,

    It seems that something with your project settings are wrong. The SDK has an enclosed sample project with runs out of the box. Did you try to build the sample app?
    You can check how the library is included into the sample project.

    Regards,
    The MIFARE Team

    + 0  |  - 0

    Re: Error in registerActivity

    2. March 2016 at 9:44

    C C
    Hi,

    The sample app can work. I'm building my own app according to the sample app. The difference is that my app is a system app on Android. The error below shows that NxpLogUtils is trying to access external storage. I'm wondering what it tries to log to external storage? It seems that a system app cannot write to external storage. Can I forbid it from logging to external storage? Thanks.

    F/Environment( 732): Static storage paths aren't available from AID_SYSTEM
    F/Environment( 732): java.lang.Throwable
    F/Environment( 732): at android.os.Environment.throwIfSystem(Environment.java:637)
    F/Environment( 732): at android.os.Environment.getExternalStorageDirectory(Environment.java:316)
    F/Environment( 732): at com.nxp.nfclib.utils.NxpLogUtils.(:68)
    F/Environment( 732): at com.nxp.nfclib.NxpNfcLib.registerActivity(:1408)
    F/Environment( 732): at com.android.settings.CryptKeeper.initializeLib(CryptKeeper.java:631)
    F/Environment( 732): at com.android.settings.CryptKeeper.onCreate(CryptKeeper.java:434)

    + 0  |  - 0

    Re: Error in registerActivity

    3. March 2016 at 14:01
    Hi CC,

    The external path is a standard source for logging. Typically the external storage is provided for Android software apps. Your particular case where you want to implement your application as system software was not anticipated and handled in the current releases so far.

    I had a conversation with the development team and they have signalized that they want to provide a special release with switched off logging for you. The team expect that you test this release and give feedback to the team.

    If you are interested, please let me know and use our address:
    mifaresdk@nxp.com

    The MIFARE Team

    + 0  |  - 0

    Re: Error in registerActivity

    8. March 2016 at 2:14

    C C
    Hi,

    It is really nice to know that a special release is possible. I've contacted you via your email. I'm not sure whether you have received my email, since I have not received any response yet. I use the same email address as I registered in this forum. I suspect my email address might be blocked...?

    Hope to hear from you soon.
    CC
    + 0  |  - 0
Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.