NoClassDefFoundError: android/support/v4/content/LocalBroadcastManager

前端 未结 7 1711
甜味超标
甜味超标 2020-12-18 17:37
  • Platform: MonoDroid v4.2.4
  • IDE: Visual Studio 2012
  • Minimum SDK version: API 12

I\'m having runtime issues when trying to utilize th

7条回答
  •  天命终不由人
    2020-12-18 17:39

    This problem was hounding me for almost six months now and no solution was helping me but today I have managed to find the correct solution on my own.

    When you select your project target version to be greater than or equal to Android 4.0, Android SDK includes "android-support-v4.jar" file in your projects "libs" folder. This jar contains all the classes and methods related Android 4.0 or later.

    Android is trying to find the class definition which is in "android-support-v4.jar" so that means you have not configured the build path to the "android-support-v4.jar" file. To do this, follow these steps:

    1. Open your project properties
    2. Select "Java Build Path" from left side menu
    3. Select "Libraries" tab
    4. Press "Add External Jar"
    5. (Most important step) Select "android-support-v4" jar file of "libs" folder from your CURRENT PROJECT LOCATION (path should be on your project folder and not the android sdk).
    6. Select "Order and Export" tab and "TICK" the checkbox of "android-support-v4.jar"

    That's it, you're done!

提交回复
热议问题