I have been trying to solve this weird issue for 2 days now and i simply cant find the answer. I have looked on various different questions here but it seems to be a slightly different problem as im having.
My android studio works fine when I start a new app it renders the view and no issues.
When I import a app i need to work on it suddenly cant sync gradle and says the following:
Error:Cause: failed to find target with hash string 'android-22' in: E:\Android\sdk
My Android SDK is up to date all the tools are installed - see image below:
Here is what I have done so far to try to get this import to show, im using a windows PC
- Uninstalled Android Studio and Re-installed the SDK
- Made sure that the ANDROID_HOME system variables and tool & platform paths are set - tested as can call "Android" from CMD and it loads the SDK
- Edited the build.Gradle file to target another SDK version - but it just says it cant find the new targeted version.
Is there some other things I can do to try get this app to import? As I know the app is working fine for other people...
Update gradle snippet
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
packagingOptions {
exclude('META-INF/NOTICE')
}
packagingOptions {
exclude('META-INF/LICENSE')
}
defaultConfig {
applicationId "ru.ifsoft.network"
minSdkVersion 15
targetSdkVersion 22
versionCode 12
versionName '1.5'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.mcxiaoke.volley:library:1.0.18'
compile('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: 'httpclient'
}
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
compile 'com.android.support:recyclerview-v7:22.2.+'
compile 'com.github.chrisbanes.photoview:library:1.2.3'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
compile 'com.android.support:support-v4:22.2.1'
compile 'com.google.android.gms:play-services-gcm:7.5.0'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services-ads:7.5.0'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.android.support:design:22.2.1'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.squareup.okhttp:okhttp:2.5.0'
}
Thanks