how to import Materialrecent design in android app - android

I am trying to import Github library about Material design from https://github.com/ZieIony/MaterialRecents but I am facing this type of error:
("Error:Dependency com.github.ZieIony:MaterialRecents:d2aec46f48 on project app resolves to an APK archive which is not supported as a compilation dependency. File: C:\Users\Talha\.gradle\caches\modules-2\files-2.1\com.github.ZieIony\MaterialRecents\d2aec46f48\494f96d345471f38b6f3f4c1c42347a2b42f8303\MaterialRecents-d2aec46f48.apk")
My Gradle is
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.talha.myrecentdesign"
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.github.ZieIony:MaterialRecents:d2aec46f48'
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
compile 'com.nineoldandroids:library:2.4.0'
}
and
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have searched from many sites but not find the exact solution. Please help me.

The library you are reffering to uses CardView which is part of the android support design library, so you have to add a dependency for that aswell.
compile 'com.android.support:design:22.2.0'

Related

Update SDK: Failed to resolve: com.android.support:appcompat-v7

I'm using Android Studio 2.3.3 and updated my SDK version and now I'm using API 27 but I encountered the following error:
Also I install repository and sync project but This error occurred:
This code is gradle.build (project):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Also this code is gradle.build (Module:app )
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.0'
defaultConfig {
applicationId "comp.packk.ir"
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:27.1.1'
}
What is the solution?
implementation or compile 'com.android.support:appcompat-v7:27.1.1'
implementation or compile 'com.android.support:cardview-v7:27.1.1'
implementation or compile 'com.android.support:design:27.1.1'

Android 3.0.1 does not resolve dependency

I want to add those dependencies:
implementation 'com.andrognito.pinlockview:pinlockview:2.1.0'
implementation 'com.multidots:fingerprint-auth:1.0.1'
in android studio 3.0.1 with gradle 3.0.1 but I get the following error:
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.multidots:fingerprint-auth:1.0.1.
Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve com.andrognito.pinlockview:pinlockview:2.1.0.
My build.gradle files are:
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And the other one:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.b.jacob.gallery"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:24.2.1'
implementation 'com.android.support:design:24.2.1'
implementation 'com.andrognito.pinlockview:pinlockview:2.1.0'
implementation 'com.multidots:fingerprint-auth:1.0.1'
testImplementation 'junit:junit:4.12'
}
It's important to say that those dependencies resolve without any problem in older version of android studio.
implementation 'com.android.support:appcompat-v7:24.2.1'
implementation 'com.android.support:design:24.2.1'
and
buildToolsVersion '26.0.2'
cannot go together there will be a conflict
Your changes should be :-
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support:design:26.0.2'
and
compileSdkVersion 26
Note
Dont forget to make sure Offline Work is unchecked in android studio...and you are connected to internet
These are the probable reasons why the dependencies cant be resolved !!

Right version of the android google play services

I'm building an android app to store a text file in the google drive.According to my perspective, the code is OK. But when I put the app level dependency of the google play-services, it throws an error in the app level version dependency. Due to this reason, I cannot sync the gradle. I think the error is with the version numbers.
here is the play service dependency I put
"compile 'com.google.android.gms:play-services:8.4.0'"
And this is the dependency that shows as an error when I put the above dependency
"compile 'com.android.support:appcompat-v7:23.4.0'"
Here is my app level graddle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.xxxxx.calllogtogoogledrive"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services:8.4.0'
}
Here is the project level gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Could you try to change your build.gradle like this;
allprojects {
repositories {
maven { url "http://jcenter.bintray.com" }
}
Remove jcenter() add this.

App size increases in Google Play Store before download

I have built a 4MB sized app for the Google Play Store (only available for Sri Lanka unfortunately) and I have been reported recently that some users cannot download the app because the app can be too large, sometimes reaching a size of 40 to 400MB.
I tried to find what may be causing this problem, but I cannot replicate this scenario on my device. What are the factors that can cause this type of bloating of the app size, and what can I do to reduce this?
I have used firebase analytics and crash reporting services and in an earlier question, I was told it might contribute to this. Is this true, and how?
Edit:- Here is the top level build.gradle source
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here is app level build file:-
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "observerjobs.com.testapp"
minSdkVersion 15
targetSdkVersion 24
versionCode 6
versionName "0.2.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.google.firebase:firebase-core:9.8.0'
compile 'com.google.firebase:firebase-crash:9.8.0'
compile 'com.facebook.fresco:fresco:0.14.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:support-vector-drawable:24.2.1'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.android.support:cardview-v7:24.0.+'
compile 'com.android.support:recyclerview-v7:24.0.+'
}
apply plugin: 'com.google.gms.google-services'

Failed to resolve Twitter SDK

I am getting this error while building the android project :
Error:Failed to resolve: com.twitter.sdk.android:twitter:2.0.0
This is my gradle file :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.khurana.nikhil.tuhub"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
manifestPlaceholders = [manifestApplicationId : "${applicationId}",
onesignal_app_id : "3363b4de-b4d3-45c7-a74a-2d75d7a97848",
onesignal_google_project_number: "561678063868"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.+'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.firebase:firebase-database:10.0.0'
compile 'com.firebaseui:firebase-ui:1.0.0'
compile 'com.onesignal:OneSignal:2.+#aar'
compile 'com.google.android.gms:play-services-gcm:10.0.0'
compile 'com.google.android.gms:play-services-analytics:10.0.0'
compile 'com.google.android.gms:play-services-location:10.0.0'
compile 'com.google.firebase:firebase-core:10.0.0'
compile 'com.google.android.gms:play-services:10.0.0'
}
apply plugin: 'com.google.gms.google-services'
I tried this solution mentioned in one of the post but that didn't work. Here's the solution I found :
Adding this to project gradle Repository section
maven { url 'https://maven.fabric.io/repo' }
But this didn't work.
Tried this too :maven { url 'https://maven.fabric.io/repo' }
Adding the repository worked for me. Here's my build gradle(project)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
// Google Play Services classpath
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Hope this helps :)

Categories

Resources