问题
After adding android-support-v7-appcompat and google-play-services_lib to the Android project application starts to crash right after start with java.lang.ClassNotFoundException exception.
I read all questions on StackOverflow related to this problem, and opened Eclipse -> Java Build Path -> Order and Export and verified that: Android Private Libraries, Android dependencies, Google Play Services.jar are checked and Android API unchecked here.
So apk built locally works fine. But on TeamCity side apk which we get as result crash with exception. So I suppose, that I need to add some changes to Ant script regarding android-support-v7-appcompat.
Please suggest steps which I can try.
回答1:
ClassNotFoundException is exactly that. A class that is references cannot be found. When working with third party libraries, you must ensure that their dependancies (if any) are also included in your class path.
Without seeing the actual stacktrace, its difficult to narrow down the problem, but I would check if the dependancies of the third party libraries that I am adding are also included in the class path.
Hope that helps.
来源:https://stackoverflow.com/questions/38475591/java-lang-classnotfoundexception-didnt-find-class-with-teamcity-build