3

After creating a switch something happen and i got the error. So i followed this thread: Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties however my app, that worked before started crashing:

    06-14 16:50:34.563: W/dalvikvm(21199): threadid=1: thread exiting with uncaught exception (group=0x41745360)
    06-14 16:50:34.563: E/AndroidRuntime(21199): FATAL EXCEPTION: main
    06-14 16:50:34.563: E/AndroidRuntime(21199): java.lang.RuntimeException: Unable to get provider com.projectcaruso.naturalfamilyplaning.StatusProvider: java.lang.ClassNotFoundException: com.projectcaruso.naturalfamilyplaning.StatusProvider
    06-14 16:50:34.563: E/AndroidRuntime(21199):    at android.app.ActivityThread.installProvider(ActivityThread.java:4692)
    06-14 16:50:34.563: E/AndroidRuntime(21199):    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4319)

Manifest:

    <provider android:name=".StatusProvider" 
              android:authorities="com.projectcaruso.naturalfamilyplaning"/>

Class:

public class StatusProvider extends ContentProvider {

The fix project properties set it to check-box enable project specific settings and 1.6 for compliance level.

Community
  • 1
  • 1
jcaruso
  • 2,364
  • 1
  • 31
  • 64
  • You did a complete clean, build, and deploy? – Dave Newton Jun 14 '13 at 21:56
  • yes i did a clean and the redeployed it to my phone. – jcaruso Jun 14 '13 at 21:57
  • Is the package name in the code spelled differently? I notice in your manifest and the Exception, you have "planing" with 1 'n'--if the package name is spelled "planning" with 2 'n's this would be expected. – rightparen Jun 14 '13 at 22:25
  • possible duplicate of [Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties](http://stackoverflow.com/questions/7637144/android-requires-compiler-compliance-level-5-0-or-6-0-found-1-7-instead-plea) – Code-Apprentice Nov 26 '13 at 19:28

2 Answers2

8

Right click on your project -> Properties -> Java Compiler. Inside Java Compiler, make sure the JDK Compiler compliance level is set to 1.6 and not anything else.

Also, if you have any library projects connected, make sure they also use the same settings.

MrByte
  • 1,083
  • 2
  • 11
  • 21
  • This one answer was just part of the solution for me. I've added an answer that solved the whole chain-of-failure events that I encountered. – Someone Somewhere Nov 21 '13 at 00:25
1

I had the same waste-of-time error message when I used the latest Eclipse to import a project from over 6 months ago. There were 4'ish steps needed to fix it...

1) do what DemVoids suggested above

2) do the top half of this: https://stackoverflow.com/a/9571322/550471 (when you press OK it'll ask you if you want to remove the src folder, click YES)

3) clean and rebuild all (I have it set to build automatically because our projects are made up of so many libraries)

4) if you get the error "The project was not built since its build path is incomplete" then it's because the Android.jar library is missing from that project.

4a) On that project (library), right click -> properties -> select "Android" and make a note of the selected API Level.

4b) now click "Java Build Path" -> Libraries tab -> Add External Jars -> navigate to your Android/sdk/platforms/android-XX/android.jar

(above, replace the XX with the API level of that project)

Community
  • 1
  • 1
Someone Somewhere
  • 23,475
  • 11
  • 118
  • 166
  • Thanks for helping improve this answer! – jcaruso Nov 21 '13 at 13:43
  • I'm going through a lot of older projects for maintenance and the steps above are getting old... so then I decided to import projects into Eclipse using the option "Android"->"Existing Android Code Into Workspace" (I previously only used General->Existing Projects Into Workspace" because that's what worked!). However, this time I was totally surprised to discover that importing Android projects using the Android import option was totally successful and my steps weren't even needed ! crazy. – Someone Somewhere Nov 21 '13 at 18:50