Android App Login issue

varaprasady
Dear Sir,
im stuck with Login issue on my android app.
1.i add external jar (kiteconnect.jar)
2.Created Button Login in that added code as in test.java i replaced my api key...
3.Getting errors at KiteConnect kiteconnect = new KiteConnect("your_apiKey");

FATAL EXCEPTION: main
09-06 12:18:20.890: E/AndroidRuntime(27370): Process: kitetest.trade, PID: 27370
09-06 12:18:20.890: E/AndroidRuntime(27370): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/rainmatter/kiteconnect/KiteConnect;
09-06 12:18:20.890: E/AndroidRuntime(27370): at kitetest.trade.KiteTestTradeActivity.onCreate(KiteTestTradeActivity.java:33)
09-06 12:18:20.890: E/AndroidRuntime(27370): at android.app.Activity.performCreate(Activity.java:6582)
09-06 12:18:20.890: E/AndroidRuntime(27370): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)
09-06 12:18:20.890: E/AndroidRuntime(27370): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2532)
09-06 12:18:20.890: E/AndroidRuntime(27370): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2667)
09-06 12:18:20.890: E/AndroidRuntime(27370): at android.app.ActivityThread.-wrap11(ActivityThread.java)
09-06 12:18:20.890: E/AndroidRuntime(27370): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1494)
09-06 12:18:20.890: E/AndroidRuntime(27370): at android.os.Handler.dispatchMessage(Handler.java:111)
09-06 12:18:20.890: E/AndroidRuntime(27370): at android.os.Looper.loop(Looper.java:207)
09-06 12:18:20.890: E/AndroidRuntime(27370): at android.app.ActivityThread.main(ActivityThread.java:5776)
09-06 12:18:20.890: E/AndroidRuntime(27370): at java.lang.reflect.Method.invoke(Native Method)
09-06 12:18:20.890: E/AndroidRuntime(27370): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
09-06 12:18:20.890: E/AndroidRuntime(27370): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
09-06 12:18:20.890: E/AndroidRuntime(27370): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.rainmatter.kiteconnect.KiteConnect" on path: DexPathList[[zip file "/data/app/kitetest.trade-2/base.apk"],nativeLibraryDirectories=[/data/app/kitetest.trade-2/lib/arm64, /vendor/lib64, /system/lib64]]
09-06 12:18:20.890: E/AndroidRuntime(27370): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
09-06 12:18:20.890: E/AndroidRuntime(27370): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
09-06 12:18:20.890: E/AndroidRuntime(27370): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
09-06 12:18:20.890: E/AndroidRuntime(27370): ... 13 more
09-06 12:18:20.890: E/AndroidRuntime(27370): Suppressed: java.lang.ClassNotFoundException: com.rainmatter.kiteconnect.KiteConnect
09-06 12:18:20.890: E/AndroidRuntime(27370): at java.lang.Class.classForName(Native Method)
09-06 12:18:20.890: E/AndroidRuntime(27370): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
09-06 12:18:20.890: E/AndroidRuntime(27370): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
09-06 12:18:20.890: E/AndroidRuntime(27370): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
09-06 12:18:20.890: E/AndroidRuntime(27370): ... 14 more
09-06 12:18:20.890: E/AndroidRuntime(27370): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

Can you suggest me where i getting wrong?
  • tonystark
    Hi @varaprasady,

    Have you enabled ProGuard in your gradle files? If yes, try after disabling it.
  • varaprasady
    Dear Sir,
    im developing my android app with eclipse and android sdk
    thanks
  • varaprasady
    varaprasady edited September 2017
    Dear sir,
    kindly provide steps to use api for android program..
    if you can provide code for basic app upto login process will be greatfull...
    thanks
  • varaprasady
    varaprasady edited September 2017
    Dear sir,
    proguard is desabled in project.properties.may be other issue was reason...
    im getting error at this point
    userModel = kiteconnect.requestAccessToken("requestcode", strapisecurityKey);
    how do i get login screen with security answers screen...
    thanks
  • sujith
    Hi @varaprasady,
    Kite Connect Java is not compatible with Android since Unirest Network library we use isn't compatible with Android.
    You can download repository and modify KiteRequest to use any android compatible library like Okhttp, Retrofit or Volley.
  • varaprasady
    Thanks sujit ,
    yesterday i tried to resolve errors.unirest errors gone...but i stuck at this point

    java.lang.IllegalStateException: Could not execute method for android:onClick
    09-07 11:42:29.527: E/AndroidRuntime(19721): at android.view.View$DeclaredOnClickListener.onClick(View.java:4509)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at android.view.View.performClick(View.java:5269)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at android.view.View$PerformClick.run(View.java:21556)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at android.os.Handler.handleCallback(Handler.java:815)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at android.os.Handler.dispatchMessage(Handler.java:104)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at android.os.Looper.loop(Looper.java:207)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at android.app.ActivityThread.main(ActivityThread.java:5776)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at java.lang.reflect.Method.invoke(Native Method)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
    09-07 11:42:29.527: E/AndroidRuntime(19721): Caused by: java.lang.reflect.InvocationTargetException
    09-07 11:42:29.527: E/AndroidRuntime(19721): at java.lang.reflect.Method.invoke(Native Method)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at android.view.View$DeclaredOnClickListener.onClick(View.java:4504)
    09-07 11:42:29.527: E/AndroidRuntime(19721): ... 9 more
    09-07 11:42:29.527: E/AndroidRuntime(19721): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/config/RequestConfig;
    09-07 11:42:29.527: E/AndroidRuntime(19721): at com.mashape.unirest.http.options.Options.refresh(Options.java:70)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at com.mashape.unirest.http.options.Options.(Options.java:46)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at com.mashape.unirest.http.HttpClientHelper.prepareRequest(HttpClientHelper.java:151)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:131)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at com.mashape.unirest.request.BaseRequest.asJson(BaseRequest.java:68)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at kitetest.trade.KiteTestTradeActivity.postRequest(KiteTestTradeActivity.java:200)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at kitetest.trade.KiteTestTradeActivity.requestAccessToken(KiteTestTradeActivity.java:176)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at kitetest.trade.KiteTestTradeActivity.inputKPClickHandler(KiteTestTradeActivity.java:95)
    09-07 11:42:29.527: E/AndroidRuntime(19721): ... 11 more
    09-07 11:42:29.527: E/AndroidRuntime(19721): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.client.config.RequestConfig" on path: DexPathList[[zip file "/data/app/kitetest.trade-2/base.apk"],nativeLibraryDirectories=[/data/app/kitetest.trade-2/lib/arm64, /vendor/lib64, /system/lib64]]
    09-07 11:42:29.527: E/AndroidRuntime(19721): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    09-07 11:42:29.527: E/AndroidRuntime(19721): ... 19 more
    09-07 11:42:29.527: E/AndroidRuntime(19721): Suppressed: java.lang.ClassNotFoundException: org.apache.http.client.config.RequestConfig
    09-07 11:42:29.527: E/AndroidRuntime(19721): at java.lang.Class.classForName(Native Method)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
    09-07 11:42:29.527: E/AndroidRuntime(19721): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
    09-07 11:42:29.527: E/AndroidRuntime(19721): ... 20 more
    09-07 11:42:29.527: E/AndroidRuntime(19721): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available


    please guide me....
  • sujith
    Hi @varaprasady,
    Check out this thread.

    PS: Android Studio is the official IDE for Android. Eclipse is deprecated now. The Gradle build system is far better than Ant.
  • sujith
    Gradle makes your life easy. In Ant, it is very difficult to find build errors.
  • varaprasady
    thanks sujith
This discussion has been closed.