WorkingSpace4
WorkingSpace4

Reputation: 764

import android.view.View; cannot resolve symbol 'view'

In android studio 3.4.1 onClick listener, not fount and now it showing setOnEditorActionListener

bth.setOnEditorActionListener(new TextView.OnEditorActionListener() {
                @Override
                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                    return false;
                }
            });

import android.view.View;
cannot resolve symbol 'view'

This was a working project, it is showing this error
if I run it will run without any issue
I open it from another PC and there is no issue like this.


I am using latest android studio 3.4.1

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:animated-vector-drawable:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:28.0.0'
    //firebase
    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
    //slider
    implementation project(':library')
    //glide
    implementation 'com.github.bumptech.glide:glide:4.7.1'
    //recyclerview gravity
    implementation 'com.github.rubensousa:gravitysnaphelper:1.5'
    // rating library
    implementation 'com.github.ome450901:SimpleRatingBar:1.4.2'
    //cardview
    implementation 'com.android.support:cardview-v7:28.0.0'

    //retrofit
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'

    implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'

    //timber-logging interceptor
    implementation 'com.jakewharton.timber:timber:4.7.1'

    //round corner image
    implementation 'com.makeramen:roundedimageview:2.3.0'

    //Html tag remover
    implementation 'org.jsoup:jsoup:1.11.3'

    implementation 'com.google.code.gson:gson:2.6.2'

    //    dots indicator
    implementation 'com.ryanjeffreybrooks:indefinitepagerindicator:1.0.10'
    implementation 'com.tbuonomo.andrui:viewpagerdotsindicator:2.1.2'

    implementation 'com.google.firebase:firebase-messaging:17.6.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
    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'

    // for unit test
    testImplementation 'com.squareup.okhttp3:mockwebserver:3.12.0'
    testImplementation 'org.mockito:mockito-android:2.7.22'

    implementation 'com.github.sharish:ShimmerRecyclerView:v1.3'


}

I tried invalied cash and restart
restart pc
reinstall android studio
But no result
My team member android studio confi
Android Studio 3.2.1
Build #AI-181.5540.7.32.5056338, built on October 9, 2018
JRE: 1.8.0_152-release-1136-b06 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

My android studio

Android Studio 3.4.1
Build #AI-183.6156.11.34.5522156, built on May 2, 2019
JRE: 1.8.0_152-release-1343-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0


The project is from git

Upvotes: 1

Views: 2033

Answers (2)

Cagatay Belgen
Cagatay Belgen

Reputation: 1

You have to add the following code in MainActivity.java

import android.view.View;

Upvotes: 0

Clinton
Clinton

Reputation: 21

Sorry this is coming late, I experienced the same problem and after hours of searching I discovered that the View class has been corrupted, you can fix the problem by deleting the platform in the SDK(android 28) and installing a new one, hope this helps Goodluck

Upvotes: 2

Related Questions