Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Error:(4, 30) error: package android.support.v7.app does not exist

edited February 23 in Errors

I created a new project that extended just a normal activity.After changing it to AppCompatActivity the application is not running.
import android.support.v7.app.AppCompatActivity;

I get error

"Information:Gradle tasks [:app:assembleDebug]
C:\Users\acer\AndroidStudioProjects\Mafisizone\app\src\main\java\net\techoverload\www\mafisizone\MainActivity.java
Error:(4, 30) error: package android.support.v7.app does not exist
Error:(14, 35) error: cannot find symbol class AppCompatActivity
Error:(19, 5) error: method does not override or implement a method from a supertype
Error:(21, 9) error: cannot find symbol variable super
Error:(22, 9) error: cannot find symbol method setContentView(int)
Error:(23, 28) error: cannot find symbol method findViewById(int)
Error:(45, 16) error: cannot find symbol variable super
Error:(64, 13) error: cannot find symbol method startActivity(Intent)
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

Information:BUILD FAILED in 3s
Information:9 errors
Information:0 warnings
Information:See complete output in console"

Comments

  • I solved the problem.We need to add an appcompat dependency.

    Open project structure as shown below.

    Your build.gradle>Module app should now have this.
    dependencies {

    implementation 'com.android.support:appcompat-v7:26.0.2'
    

    }

Sign In or Register to comment.