0

Please see following attached screen shot. I will try to add android-v4 jar file but getting issue in android stdio (in Android stdio, Adding by import project feature)

enter image description here

When importing jar file den got following error.

enter image description here

build.gradle (Module::App) file is here

android {
    compileSdkVersion 13
    buildToolsVersion "21.1.2"
    defaultConfig {
        applicationId "com.jigsaw.startup"
        minSdkVersion 10
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    //    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.gms:play-services:6.5.87'
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.loopj.android:android-async-http:1.4.6'
    compile 'com.android.support:support-v4:21.0.3'alert    
}


configurations {
    all*.exclude group: 'com.android.support', module: 'support-v4'

Let me know if anybody need any extra information.

Manish Trivedi
  • 3,481
  • 5
  • 23
  • 29
  • 1
    Your build.gradle file for the app module. – Morrison Chang Jan 30 '15 at 06:57
  • 1
    Try this link bro http://stackoverflow.com/questions/16580586/add-support-library-to-android-studio-project you need not to import the jar files in gradle add dependency in your gradle build script as described in the link. – Vigneshwaran Murugesan Jan 30 '15 at 06:58
  • @Vigneshearan.m ...Thanks man! But i have already try it out....but it give me red alert. So I removed it. I I have attached my build.gradle file – Manish Trivedi Jan 30 '15 at 07:08
  • Are you importing the project from Eclipse? – Vigneshwaran Murugesan Jan 30 '15 at 07:10
  • @ManishTrivedi You are getting downvotes as you are not following the stackoverflow Question format guidelines. You should add codes in its format and not supposed to put screenshots for those. – Spidy Jan 30 '15 at 07:13
  • 1
    Ok got it. let me change it. @Spidy – Manish Trivedi Jan 30 '15 at 07:21
  • @Vigneshearan.m I am using android-stdio – Manish Trivedi Jan 30 '15 at 07:22
  • @Spidy I can't show tootltip/title into code so I was attached screenshot instead of code. :( :( – Manish Trivedi Jan 30 '15 at 07:25
  • First try removing the listener you added to the welcomeactivity class and try sync project with gradle files button in the android studio which is before the AVD manager button and one of my projects i have not used this line "compile 'com.android.support:support-v4:21.0.3' " with "alert" :) still it works why dont you try removing that line and sync you proj once. – Vigneshwaran Murugesan Jan 30 '15 at 07:42

2 Answers2

0

This statement in your build script:

configurations {
    all*.exclude group: 'com.android.support', module: 'support-v4'
}

is explicitly excluding anything from com.android.support.v4 from being linked into your project, so that's why the import com.android.support.v4.Fragment statement isn't working. Remove that and the import should be fine.

Scott Barta
  • 79,344
  • 24
  • 180
  • 163
0

I changed android API and worked on Andoid 4.2. then issue resolved.

Thanks to all

Manish Trivedi
  • 3,481
  • 5
  • 23
  • 29