In my project, I am trying to build auto image slider view
I am using SliderView library. And I added dependency from github:
implementation 'com.github.smarteist:autoimageslider:1.4.0-appcompat'
But when add this dependency in project and sync the project, and try to use this library in my xml file. This library not appear although the project is build successfully.
Build.gradle(app):
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.nctr.cd.bmvp"
minSdk 26
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.gitee.archermind-ti:autoimageslider:1.0.0-beta'
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
// room database dependency
def room_version = "2.4.3"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
//retrofit http client dependency
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
//swipe refresh dependency to add pull to refresh for recycleView
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
// dependency for gson
implementation 'com.google.code.gson:gson:2.9.1'
// dependency for loading image from url
implementation 'com.github.bumptech.glide:glide:4.11.0'
// google service dependency
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
// auto image slider dependency
implementation 'com.github.smarteist:autoimageslider:1.4.0-appcompat'
}
Please check if jcenter() repositories is missing in your build.gradle:
allprojects {
repositories {
google()
//here
jcenter()
mavenCentral()
}
}
And also make sure that your project is on appcompat dependencies.
Related
I am using the Android canary 13(Bubble Bee). My problem is that I am unable to resolve any third part library. I have tried adding multiple different libraries but cannot resolve them during building project. When I sync the project after adding the library the project synced successfully by downloading the dependency but in the project that library cannot resolve and when I try to build the project it says as mention in the image
Below is the code of of build.gradle(app) file.
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'androidx.navigation.safeargs'
id 'com.google.gms.google-services'
id 'kotlin-kapt'
}
android {
compileSdk 31
defaultConfig {
applicationId "com.ra.rightads"
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
dataBinding {
enabled = true
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
def nav_version = "2.3.5"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
// Navigation dependencies
implementation "androidx.navigation:navigation-fragment:$nav_version"
implementation "androidx.navigation:navigation-ui:$nav_version"
implementation "androidx.navigation:navigation-dynamic-features-fragment:$nav_version"
androidTestImplementation "androidx.navigation:navigation-testing:$nav_version"
implementation "androidx.navigation:navigation-compose:2.4.0-alpha10"
//Firebase dependencies
implementation "com.google.firebase:firebase-core:19.0.2"
implementation "com.google.firebase:firebase-auth:21.0.1"
implementation "com.google.firebase:firebase-firestore:23.0.4"
implementation "com.google.android.gms:play-services-auth:19.2.0"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'com.google.firebase:firebase-database:20.0.2'
implementation 'com.google.firebase:firebase-analytics:19.0.2'
implementation 'com.google.firebase:firebase-storage:20.0.0'
//Google material dependencies
implementation 'com.google.android.material:material:1.4.0'
// Picasso
implementation 'com.squareup.picasso:picasso:2.71828'
// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
// Okhttp
implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2'
// Glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
//Viewpager
implementation 'androidx.viewpager2:viewpager2:1.0.0'
//Hilt dependency
implementation("com.google.dagger:hilt-android:2.38.1")
//Multidex
implementation 'com.android.support:multidex:1.0.3'
//Kapt
kapt 'com.github.bumptech.glide:compiler:4.11.0'
// sdp and ssp for dp and sp values
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
// Image Cropper
// implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
}
Here is the code of my project level build.gradle file.Image cropper is the library I am currently trying to add.
// Top-level build file where you can add configuration options common to all sub-
projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com'
}
maven { url 'https://jitpack.io' }
}
dependencies {
def nav_version = "2.3.5"
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.google.gms:google-services:4.3.10'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath('com.android.support:multidex:1.0.3')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I need help and I need to resolve this error. Your help will be appreciated.
From looking at that project's page on GitHub, I see that it is no longer maintained. And since JCenter is shut down, you can't easily get the library using Maven/Gradle.
Someone has forked it and continues to develop it, so you can use that library instead.
Replace jcenter() with maven { url 'https://jitpack.io' } and replace 'com.theartofdev.edmodo:android-image-cropper:2.8.0' with 'com.github.CanHub:Android-Image-Cropper:3.3.5'.
This question already has an answer here:
Why does case matter in gradle task method names?
(1 answer)
Closed last month.
I am not able to add the GitHub repository of Youtube video extractor for exoplayer, implementing in android studio project.
build.gridle(abc app)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.google.gms:google-services:4.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gridle(app)
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.abc"
minSdkVersion 20
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
// multiDexEnabled true
//useProguard true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation "androidx.recyclerview:recyclerview-selection:1.1.0-rc03"
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.navigation:navigation-fragment:2.3.2'
implementation 'androidx.navigation:navigation-ui:2.3.2'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation ('com.squareup.retrofit2:retrofit:2.1.0') {
// exclude Retrofit’s OkHttp dependency module and define your own module import
exclude module: 'okhttp'
}
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
implementation 'com.payumoney.core:payumoney-sdk:7.4.4'
implementation 'com.payumoney.sdkui:plug-n-play:1.6.0'
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:26.6.0')
// Declare the dependency for the Firebase SDK for Google Analytics
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.android.support:multidex:1.0.3'
//Adding exoplayer dependencies
implementation 'com.google.android.exoplayer:exoplayer:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-core:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-dash:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-hls:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:r2.4.0'
implementation 'com.google.android.exoplayer:exoplayer-ui:r2.4.0'
//Youtube extractor
Implementation 'com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0' // getting error in this line
}
When I'm trying to add the "Implementation 'com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0'", I don't know why showing the below error -
unexpected token: com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0
Could not compile build file 'C:\Users\Rupesh\AndroidStudioProjects\abc\app\build.gradle'.
> startup failed:
build file 'C:\Users\Rupesh\AndroidStudioProjects\abc\app\build.gradle': 84: unexpected token: com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0 # line 84, column 20.
Implementation 'com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0'
Use i instead of I in implementation.
The correct line should be
implementation 'com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0'
I was working with one of the codelabs tutorials https://codelabs.developers.google.com/codelabs/android-room-with-a-view/index.html?index=..%2F..index#3 .
Int which while editing buil.gradle (app) . I got Failed to resolve : androidx ,Failed to resolve : androidx.arch & Failed to resolve : com.google.android
build.gradle
android {
compileSdkVersion 29
buildToolsVersion "30.0.1"
defaultConfig {
applicationId "com.example.androidroomcodelabs"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// Room components
implementation "androidx.room:room-runtime:$rootProject.2.2.4"
annotationProcessor "androidx.room:room-compiler:$rootProject.2.2.4"
androidTestImplementation "androidx.room:room-testing:$rootProject.2.2.4"
// Lifecycle components
implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.2.3.0"
annotationProcessor "androidx.lifecycle:lifecycle-compiler:$rootProject.2.3.0"
// UI
implementation "com.google.android.material:material:$rootProject.1.0.0"
// Testing
androidTestImplementation "androidx.arch.core:core-testing:$rootProject.1.2.0"
}
Might be because you are missing the reference to the Google's maven repository in the project level build.gradle file:
buildscript {
repositories {
google() // this allow to lookup in the Google's maven repository
jcenter()
}
...
}
allprojects {
repositories {
google() // this allow to lookup in the Google's maven repository
jcenter()
}
}
It was a silly mistake that I made by not seeing the difference in build.gradle(app) and build.gradle. If in case someone ran into same error follow this.It will take me two days to accept my answer but it worked for me.
build.gradle(app)
implementation "androidx.room:room-runtime:$rootProject.roomVersion"
annotationProcessor "androidx.room:room-compiler:$rootProject.roomVersion"
androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
// Lifecycle components
implementation "androidx.lifecycle:lifecycle extensions:$rootProject.archLifecycleVersion"
annotationProcessor "androidx.lifecycle:lifecycle-compiler:$rootProject.archLifecycleVersion"
// UI
implementation "com.google.android.material:material:$rootProject.materialVersion"
// Testing
androidTestImplementation "androidx.arch.core:core-testing:$rootProject.coreTestingVersion"
Leaving the roomVersion, archLifecycleVersion, coreTestingVersion & materialVersion as they are and adding the below version in build.gradle
build.gradle
roomVersion = '2.2.1'
archLifecycleVersion = '2.2.0'
coreTestingVersion = '2.1.0'
materialVersion = '1.0.0'
}```
I have been researching for the past 3 days and nights on this issue but whenever I am uploading android app bundle on Google Play Store but getting 64-bit requirement error on review.My app bundle is completely Java/Kotlin based with native support as some third party has dependency on it. I have included the support for all architecture armeabi-v7a, arm64-v8a,x86,x86_64 in gradle file also enabled split for the abi.
While creating a signed app bundle, in the analyzer it shows all the native support library in it(.so file under armeabi-v7a, arm64-v8a,x86,x86_64 in lib folder).
The following APKs or App Bundles are available to 64-bit devices, but they only have 32-bit native code: 21.
Even though I have added dependency for both 32/64 bit native code.
Here is Android App Bundles properties https://ibb.co/j66wn4S
Gradle config I have added:
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.1'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.application.name"
minSdkVersion 22
targetSdkVersion 28
versionCode 74
versionName "3.1"
ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64', "armeabi"
renderscriptTargetApi 16
renderscriptSupportModeEnabled true
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id : "we54rew6r4ew654sdf4sdf54sdf4",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.google.firebase:firebase-ads:17.1.3'
implementation 'com.github.kanytu:android-parallax-listview:v1.1'
implementation 'com.koushikdutta.ion:ion:2.2.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'jp.wasabeef:blurry:2.1.1'
implementation 'com.onesignal:OneSignal:3.10.6'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.irozon.sneaker:sneaker:1.0.1'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'com.android.support:support-v4:28.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.daimajia.easing:library:2.0#aar'
implementation 'com.daimajia.androidanimations:library:2.3#aar'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.google.android.exoplayer:exoplayer:2.8.4'
implementation 'pl.bclogic:pulsator4droid:1.0.3'
implementation 'com.github.yehiahd:FastSave-Android:1.0.6'
implementation 'de.mrmaffen:vlc-android-sdk:2.0.6'
implementation 'com.devbrackets.android:exomedia:4.3.0'
testImplementation 'junit:junit:4.12'
implementation 'com.jaeger.statusbarutil:library:1.5.1'
}
repositories {
mavenCentral()
maven {
url "https://jitpack.io"
}
flatDir {
dirs 'libx'
}
}
apply plugin: 'com.google.gms.google-services'
I integrated ButterKnife into my project, since then it has been impossible for me to build it
I've tried different versions of the library but nothing seems to work
Here is the error during the build:
Could not find com.jakewharton:butterknife-compiler:7.0.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/jakewharton/butterknife-compiler/7.0.1/butterknife-compiler-7.0.1.pom
- https://dl.google.com/dl/android/maven2/com/jakewharton/butterknife-compiler/7.0.1/butterknife-compiler-7.0.1.jar
- https://jcenter.bintray.com/com/jakewharton/butterknife-compiler/7.0.1/butterknife-compiler-7.0.1.pom
- https://jcenter.bintray.com/com/jakewharton/butterknife-compiler/7.0.1/butterknife-compiler-7.0.1.jar
- https://jitpack.io/com/jakewharton/butterknife-compiler/7.0.1/butterknife-compiler-7.0.1.pom
- https://jitpack.io/com/jakewharton/butterknife-compiler/7.0.1/butterknife-compiler-7.0.1.jar
Required by:
project :app
And this is my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.toto"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//Retrofit Dependencies
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
// Butter Knife
implementation 'com.jakewharton:butterknife:7.0.1'
implementation 'com.android.support:support-annotations:28.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:7.0.1'
// ZXing
implementation 'com.github.tobrun:QR-Vision-Fragment:master-SNAPSHOT'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
}
I have already added the jitpack repositories in the project build.gradle:
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
try this
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
If you are building an old android project and do not want to upgrade your butterknife dependency then add this to your gradle(app level) file. It wokred for me. Happy Coding :)
android {
...
defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}
}
}
Use This:
compile 'com.jakewharton:butterknife:8.7.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
from this butterknife-compiler version 7.0.1 not listed(founded) in mvn repository
so use the latest lib version
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'