-2

I know that similar questions have been on SO and I have read through and tried to implement the solutions mentioned but nothing is working. The specific problem is like this (using ECLIPSE):

I am trying to implement location awareness in one of the activities (triggered through menu selection) in my app. As long as my code looks like,

"public class MealHistoryActivity extends Activity {...}",

I don't get any error. As soon as I modify it to

public class MealHistoryActivity extends Activity implements ConnectionCallbacks, OnConnectionFailedListener, LocationListener {..",

it throws in the following error:

E/AndroidRuntime(5027): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.package.activities.MealHistoryActivity" on path: DexPathList[[zip file "/data/app/com.package.activities-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]

What I have tried:

  1. Adding up the library projects (support library as well as google play services) and cleaning all the projects.
  2. Including Android Private Libraries for the application as well as the library projects.
  3. Double-checking the API key in android manifest as well as the SHA-1 fingerprint key associated to it.
  4. Using all the internet and network permissions in the manifest that are needed for location services.

Would greatly appreciate any ideas on how to solve this since I am stuck on it for the last few days!

Rehan
  • 107
  • 1
  • 2
  • 7
  • My suggestion is to use Android Studio, Eclipse ADT is on a "death path" now. – greywolf82 Feb 14 '15 at 15:30
  • Just tried migrating the project to Android Studio. It says Gradle 2.2.1 is required to migrate to Gradle wrapper and sync. I have followed the steps listed in http://stackoverflow.com/questions/27311467/gradle-2-1-is-required-migrate-to-gradle-wrapper-and-sync-project but it's of no use. – Rehan Feb 14 '15 at 16:51

1 Answers1

0

The error suggests that the classes from the google-play-service project are not loading.

Make sure you are referencing a copy of the project in your workspace, and not the copy that is in the sdk directory. Try doing that or deleting the google service project from your workspace and redoing the steps in this guide.

Another possible cause for this is version mismatch. If your device's version is less than the version specified in the above mentioned guide than the google services project will not install on your device at all.

SilverCorvus
  • 2,956
  • 1
  • 15
  • 26
  • thanks for the advice!! my google play services library was within the workspace but I reinstalled play services from SDK, imported them back into workspace, and it is working fine now. – Rehan Feb 14 '15 at 17:19