0

I am new in android. I want to create an app but I have this error::

error: package android.support.v7.app does not exist

and my gradle code is here::

android {
    signingConfigs {
        apk_key {
            keyAlias 'key1'
            keyPassword ''
            storeFile file('D:/Users/hossein/Desktop/android-key/apk_key.jks')
            storePassword ''
        }
    }
    compileSdkVersion 28

    buildToolsVersion "28.0.3"
    defaultConfig {
        applicationId "maa.tic_tac_to"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta2'
    implementation 'com.google.firebase:firebase-messaging:19.0.1'
    testImplementation 'junit:junit:4.12'
}


apply plugin: 'com.google.gms.google-services'

can anyone help me???

Tamir Abutbul
  • 7,301
  • 7
  • 25
  • 53
hossein
  • 77
  • 6
  • @MaximeLaunois its not work for me – hossein Jul 07 '19 at 14:19
  • What do you mean by "*its not work for me*"? Did you added the Support Library as per the instructions given by the answers? What error does you get? Are you getting that error *every time* you create a project? – Maxime Launois Jul 07 '19 at 14:22
  • @MaximeLaunois i have android support library in SDK Manager and its installed but i cant find properties when i right click in project – hossein Jul 07 '19 at 14:30

1 Answers1

0

The problem could be on your code, just click the error and press alt + enter then select import android.support.v7.app.

there is no problem in the gradle, try to clean & rebuild the project.

Hope it helps!

NJY404
  • 349
  • 3
  • 14