Reputation: 9295
I have exported a jar file from one of my maven projects. This project has a dependency of apache common validations. after I have added the jar to libs folder of my android project, and also I have added the common validations jar files (made sure that they are in the same version both in the maven project and in the android project). Now when I run the app I am getting this error:
01-24 20:58:14.151: E/AndroidRuntime(1241): FATAL EXCEPTION: main
01-24 20:58:14.151: E/AndroidRuntime(1241): java.lang.NoClassDefFoundError: com.evappcom.validator.Validator
01-24 20:58:14.151: E/AndroidRuntime(1241): at com.evapp.protocols.BaseProtocol.emailValidation(BaseProtocol.java:176)
01-24 20:58:14.151: E/AndroidRuntime(1241): at com.evapp.protocols.PasswordLoginProtocol.isValidInput(PasswordLoginProtocol.java:30)
01-24 20:58:14.151: E/AndroidRuntime(1241): at com.evapp.activities.LoginActivity.doLogin(LoginActivity.java:88)
01-24 20:58:14.151: E/AndroidRuntime(1241): at com.evapp.activities.LoginActivity.access$0(LoginActivity.java:82)
01-24 20:58:14.151: E/AndroidRuntime(1241): at com.evapp.activities.LoginActivity$1.onClick(LoginActivity.java:56)
01-24 20:58:14.151: E/AndroidRuntime(1241): at android.view.View.performClick(View.java:4204)
01-24 20:58:14.151: E/AndroidRuntime(1241): at android.view.View$PerformClick.run(View.java:17355)
01-24 20:58:14.151: E/AndroidRuntime(1241): at android.os.Handler.handleCallback(Handler.java:725)
01-24 20:58:14.151: E/AndroidRuntime(1241): at android.os.Handler.dispatchMessage(Handler.java:92)
01-24 20:58:14.151: E/AndroidRuntime(1241): at android.os.Looper.loop(Looper.java:137)
01-24 20:58:14.151: E/AndroidRuntime(1241): at android.app.ActivityThread.main(ActivityThread.java:5041)
01-24 20:58:14.151: E/AndroidRuntime(1241): at java.lang.reflect.Method.invokeNative(Native Method)
01-24 20:58:14.151: E/AndroidRuntime(1241): at java.lang.reflect.Method.invoke(Method.java:511)
01-24 20:58:14.151: E/AndroidRuntime(1241): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-24 20:58:14.151: E/AndroidRuntime(1241): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-24 20:58:14.151: E/AndroidRuntime(1241): at dalvik.system.NativeStart.main(Native Method)
01-24 20:58:47.347: E/Trace(1258): error opening trace file: No such file or directory (2)
What is wrong with my process?
Upvotes: 1
Views: 120
Reputation: 31567
You shouldn't export jar file from maven project. Use maven command:
mvn package
to build android applications and copy it form target
directory.
Upvotes: 1