question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

version5.0.1 java.lang.NoClassDefFoundError: com.linecorp.linesdk.internal.nwclient.OpenIdSigningKeyResolver

See original GitHub issue

Such an error occurs. What are the possible causes?

E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: com.example.nrikiji.linetest314, PID: 2431
                  java.lang.NoClassDefFoundError: com.linecorp.linesdk.internal.nwclient.OpenIdSigningKeyResolver
                      at com.linecorp.linesdk.internal.nwclient.LineAuthenticationApiClient.<init>(LineAuthenticationApiClient.java:59)
                      at com.linecorp.linesdk.internal.nwclient.LineAuthenticationApiClient.<init>(LineAuthenticationApiClient.java:71)
                      at com.linecorp.linesdk.auth.internal.LineAuthenticationController.<init>(LineAuthenticationController.java:75)
                      at com.linecorp.linesdk.auth.internal.LineAuthenticationActivity.onCreate(LineAuthenticationActivity.java:90)
                      at android.app.Activity.performCreate(Activity.java:6285)
                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2524)
                      at android.app.ActivityThread.access$900(ActivityThread.java:154)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1391)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:234)
                      at android.app.ActivityThread.main(ActivityThread.java:5526)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

https://developers.line.biz/ja/docs/android-sdk/integrate-line-login/ When installing the SDK and executing the following code by this procedure it will crash…

package com.example.nrikiji.linetest314;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

import com.linecorp.linesdk.Scope;
import com.linecorp.linesdk.auth.LineAuthenticationParams;
import com.linecorp.linesdk.auth.LineLoginApi;
import com.linecorp.linesdk.auth.LineLoginResult;

import java.util.Arrays;

public class MainActivity extends AppCompatActivity {

    private static final int REQUEST_CODE = 1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        try{
            // App-to-app login
            Intent loginIntent = LineLoginApi.getLoginIntent(
                    getApplicationContext(),
                    "1565553788",
                    new LineAuthenticationParams.Builder()
                            .scopes(Arrays.asList(Scope.PROFILE))
                            .build());
            startActivityForResult(loginIntent, REQUEST_CODE); // ★ Crash!!

        }
        catch(Exception e) {
            Log.e("ERROR", e.toString());
        }
    }

    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode != REQUEST_CODE) {
            Log.e("ERROR", "Unsupported Request");
            return;
        }

        LineLoginResult result = LineLoginApi.getLoginResultFromIntent(data);

        switch (result.getResponseCode()) {

            case SUCCESS:
                // Login successful
                String accessToken = result.getLineCredential().getAccessToken().getTokenString();
                break;

            case CANCEL:
                // Login canceled by user
                Log.e("ERROR", "LINE Login Canceled by user.");
                break;

            default:
                // Login canceled due to other error
                Log.e("ERROR", "Login FAILED!");
                Log.e("ERROR", result.getErrorData().toString());
        }
    }}

The version of android studio is 3.1.4 and the development environment can not be upgraded above this due to circumstances of …

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nrikijicommented, Feb 1, 2019

Sorry. I tried it again and it went well. The setting of gradle may have been wrong

build.gradle

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation(name:'line-sdk-5.0.1', ext:'aar')
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:customtabs:28.0.0'
    implementation('com.madgag.spongycastle:prov:1.58.0.0') {
        exclude group: 'junit', module: 'junit'
    }

 //  It might be missing here!!
    runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.10.5'
    runtimeOnly ('io.jsonwebtoken:jjwt-orgjson:0.10.5') {
        exclude group: 'org.json', module: 'json' //provided by Android natively
    }
}
0reactions
LiYing2010commented, Feb 1, 2019

congratulations~~~

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to install android-sdk: "java.lang.NoClassDefFoundError
Just had this error, solved by downloading the Android SDK Command-line Tools (latest) on Android Studio, under Preferences > Appearance & Behavior >...
Read more >
line-sdk-android - bytemeta
Failed Build Android (React Native) on LINE SDK 5.0.1, java.lang.NoClassDefFoundError: com.linecorp.linesdk.internal.nwclient.OpenIdSigningKeyResolver.
Read more >
line-sdk-android from line - GithubHelp
version5.0.1 java.lang.NoClassDefFoundError: com.linecorp.linesdk.internal.nwclient.OpenIdSigningKeyResolver. Such an error occurs. What are the possible causes ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found