Canonot resolve symbol fasterxml

Asked 2 years ago, Updated 2 years ago, 112 views

If you synchronize with the code shown below, the event log will display the following errors:

Is there something missing?

error message

 Gradle sync failed: Could not find method compile() for arguments [com.fasterxml.jackson.core:jackson-databind:2.9.8] on root project 'LoginActivity' of type org.gradle.api.Project.
            Consult IDE log for more details (Help | Show Log)

Source Code

LoginActivity.java

package com.example.loginactivity.ui.login;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import androidx.announcement.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;

import com.example.loginactivity.R;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;

build gradle(:app)


dependencies {
    implementation fileTree (dir: 'libs', include: ['*.jar')

    implementation'androidx.appcompat:appcompat:1.1.0'
    implementation'com.google.android.material:material:1.1.0'
    implementation'androidx.announcement:announcement:1.1.0'
    implementation 'androidx.constrainlayout:constrainlayout:1.1.3'
    implementation 'androidx.lifecycle:lifecycle-extensions: 2.2.0'
    implementation'com.squareup.okhttp3:okhttp:4.0.0-alpha02'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation'androidx.test.ext:junit:1.1.1'
    androidTestImplementation'androidx.test.espreso: espresso-core: 3.2.0'
    implementation'com.journeyapps:zxing-android-embedded:3.6.0'
    implementation'com.google.zxing:core:3.3.0'
    implementation'com.fasterxml.jackson.core:jackson-databind:2.10.0'
    implementation'com.fasterxml.jackson.core:jackson-annotations:2.10.0'
}

java android android-studio

2022-09-30 20:10

1 Answers

It seems that the reason was that the following description was written in Build Gradle (LoginActivity).
After commenting out, I was able to rebuild it.

implement'com.fasterxml.jackson.core:jackson-databind:2.9.8'


2022-09-30 20:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.