I used the GitHub time picker dialog library and I got an error "Can not find symbol R".
1) The library I used.
implementation 'com.kovachcode:timePickerWithSeconds:1.0.1'
2) The error line code is below.
setButton(context.getText(R.string.time_set), this); // in this line
setButton2(context.getText(R.string.cancel), (OnClickListener) null);// in this line
//setIcon(android.R.drawable.ic_dialog_time);
LayoutInflater inflater =
(LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.time_picker_dialog, null);//in this line
setView(view);
mTimePicker = (TimePicker) view.findViewById(R.id.timePicker);//in this line
This file is also a read-only file and not editable. Please give me a solution.
3) These are all dependencies I used.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.firebase:firebase-jobdispatcher:0.8.6'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4: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.loopj.android:android-async-http:1.4.9'
implementation 'com.android.support:design:28.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.android.volley:volley:1.1.1-rc1'
implementation 'de.hdodenhof:circleimageview:3.0.1'
implementation 'info.androidhive:fontawesome:0.0.5'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.kovachcode:timePickerWithSeconds:1.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
Please check your manifest and add
tools:replace="android:icon, android:label, android:theme"
import like this in your class.
import com.yourpackage.R;
it can be error on "time_picker_dialog.xml" file or any other xml file. Can you check it?
Related
After adding com.google.gms:google-services below, I am getting an error that ListenableFuture cannot be found.
I'm using a method in a class in androidx.camera.lifecycle, which returns a ListenableFuture, so I'm guessing 'com.google.gms:google-services:4.3.10' and "androidx.camera:camera-view:${camerax_version}" are using conflicting versions of ListenableFuture.
How do I best resolve this?
dependencies {
implementation 'com.google.gms:google-services:4.3.10'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.mlkit:barcode-scanning:17.0.2'
def camerax_version = "1.2.0-alpha02"
implementation "androidx.camera:camera-camera2:${camerax_version}"
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
implementation "androidx.camera:camera-view:${camerax_version}"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment:2.4.2'
implementation 'androidx.navigation:navigation-ui:2.4.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
I tried to add the firestore dependency and after I did this I got a error saying the following:
Caused by: java.lang.RuntimeException: Duplicate class com.google.protobuf.AbstractMessageLite found in modules protobuf-java-3.15.3 (com.google.protobuf:protobuf-java:3.15.3) and protobuf-javalite-3.19.2 (com.google.protobuf:protobuf-javalite:3.19.2)
The following code are all the dependencies I use hope someone can find the problem.
dependencies {
implementation("androidx.compose.foundation:foundation:1.2.0-alpha07")
implementation 'androidx.core:core-ktx:1.7.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.3.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0"
// Hilt
implementation "com.google.dagger:hilt-android:2.40.5"
kapt "com.google.dagger:hilt-compiler:2.40.5"
// Room
implementation "androidx.room:room-runtime:2.4.1"
implementation "androidx.room:room-ktx:2.4.1"
kapt "androidx.room:room-compiler:2.4.1"
// Navigation
implementation "androidx.navigation:navigation-compose:2.4.0"
implementation "androidx.hilt:hilt-navigation-compose:1.0.0"
//animated navigation
implementation "androidx.navigation:navigation-compose:2.5.0-alpha04"
//implementation "com.google.accompanist:accompanist-navigation-animation:0.16.0"
//IGDB
implementation 'com.github.husnjak:IGDB-API-JVM:1.0.5'
testImplementation "androidx.arch.core:core-testing:2.1.0"
//coil
implementation("io.coil-kt:coil-compose:2.0.0-rc01")
//fuel
implementation 'com.github.kittinunf.fuel:fuel-android:2.3.1'
//system ui
implementation "com.google.accompanist:accompanist-systemuicontroller:0.17.0"
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:29.3.1')
// When using the BoM, you don't specify versions in Firebase library dependencies
// Declare the dependency for the Firebase SDK for Google Analytics
implementation 'com.google.firebase:firebase-analytics-ktx'
// Declare the dependencies for any other desired Firebase products
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.google.firebase:firebase-firestore'
}
With these dependencies present in build.gradle.
I am getting this error when i am trying to run the project
Process 'command '/Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java'' finished with
non-zero exit value 1
/*CamerAFragment*/
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
//compile "com.android.support:design:$rootProject.supportLibraryVersion"
//butterknife
// implementation 'com.jakewharton:butterknife:8.8.1'
//annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
//circle indicator
implementation 'me.relex:circleindicator:1.2.2#aar'
//google plus
implementation 'com.google.android.gms:play-services-auth:11.0.4'
/*Viper*/
androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
// reactive
implementation "io.reactivex.rxjava2:rxjava:$rootProject.rxjava2Version"
implementation "io.reactivex.rxjava2:rxandroid:$rootProject.rxandroidVersion"
// retrofit
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
// dependency injection
implementation "com.google.dagger:dagger:$rootProject.dagger2Version"
annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
provided 'javax.annotation:jsr250-api:1.0'
implementation 'javax.inject:javax.inject:1'
//multidex
implementation 'com.android.support:multidex:1.0.3'
//new start
// kapt 'com.google.dagger:dagger-android-processor:2.15'
// kapt 'com.google.dagger:dagger-compiler:2.15'
//new end
//animationasdasd
compile 'com.skyfishjy.ripplebackground:library:1.0.1'
//DrawablePageIndicator
implementation 'com.augustopicciani.drawable_page_indicator:library:1.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
// AutoScrollView
implementation('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
exclude module: 'support-v4'
}
//Cropper
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.7'
/*AWS*/
implementation 'com.amazonaws:aws-android-sdk-s3:2.6.+'
implementation 'com.amazonaws:aws-android-sdk-cognito:2.6.+'
implementation 'com.amazonaws:aws-android-sdk-core:2.6.+'
/*//glide
implementation 'com.github.bumptech.glide:glide:4.5.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'*/
//Country code
implementation 'com.hbb20:ccp:2.2.2'
// implementation 'com.hbb20:ccp:2.0.3'
//Underscore
implementation 'com.github.javadev:underscore:1.28'
//pdf opener
compile 'com.github.barteksc:android-pdf-viewer:2.8.2'
//Crash
implementation 'com.google.firebase:firebase-crash:11.0.4'
/* // Check for v11.4.2 or higher
implementation 'com.google.firebase:firebase-core:15.0.0'*/
// Add dependency
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
/*Custom Camera view*/
implementation project(':Cameralibrary')
/*App purchase */
implementation 'com.android.billingclient:billing:1.0'
/*OCR demo Gradle starts from here */
// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "android.arch.lifecycle:extensions:${versions.lifecycle}"
implementation "android.arch.lifecycle:common-java8:${versions.lifecycle}"
implementation "com.getkeepsafe.relinker:relinker:${versions.relinker}"
implementation 'de.greenrobot:eventbus:2.4.0'
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:${versions.leak_canary}"
debugImplementation "com.squareup.leakcanary:leakcanary-android:${versions.leak_canary}"
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation "com.commit451:PhotoView:${versions.photoview}"
// implementation 'com.viewpagerindicator:library:2.4.1#aar'
implementation 'fr.avianey.com.viewpagerindicator:library:2.4.1.1#aar'
//butterknife
implementation "com.jakewharton:butterknife:${versions.butterknife}"
// kapt "com.jakewharton:butterknife-compiler:${versions.butterknife}"
annotationProcessor "com.jakewharton:butterknife-compiler:${versions.butterknife}"
//circle indicator
implementation 'me.relex:circleindicator:1.2.2#aar'
//glide
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation "com.android.support:design:${versions.design}"
implementation "com.android.support:design:${versions.appcompat_v7}"
//pdf shockwave
compile 'com.github.barteksc:pdfium-android:1.9.0'
//cat loader
implementation 'com.roger.catloadinglibrary:catloadinglibrary:1.0.4'
//shimmer text
compile 'com.romainpiel.shimmer:library:1.4.0#aar'
/*End here */
// compile("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.2")
implementation 'com.google.firebase:firebase-ml-vision:18.0.1'
implementation 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
implementation 'com.google.firebase:firebase-ml-vision-face-model:17.0.2'
implementation 'com.google.firebase:firebase-ml-model-interpreter:16.2.3'
implementation 'com.android.support:exifinterface:28.0.0'
Your project includes too many dependencies, try remove them one by one and gradle sync until you find which one caused error.
Its a time consuming task, but should do if you can not ensure.
And you could try add this in build.gradle----android:
dexOptions {
javaMaxHeapSize "4g" //enlarge heap size value.
}
The problem basically is that when trying to RecyclerView in the class I get error "Can not resolve symbol" RecycleView "
This is my gradle code
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.android.support:recyclerview-v7:28.0.+'
This is my class
package com.example.admin.economizate;
public class ViewHolder extends RecyclerView{
}
A ViewHolder should not extend a RecyclerView, but you need an import statement regardless
You would want
import android.support.v7.widget.RecyclerView.ViewHolder;
public class YourViewHolder extends RecyclerView.ViewHolder {
Note: You already have implementation 'com.android.support:recyclerview-v7:28.0.0', so remove the recyclerview-v7:28.0.+' line
I am trying to get image from web and put it into ImageView, but Picasso keeps showing errors.. when I refresh androidStudio, it shows another errors..
I looked up for solutions, but there is no relevant up-to-date post anywhere.
If anyone has any idea how to solve it, please comment.
Error: Program type already present: com.squareup.picasso.Action
Error: Program type already present:
com.squareup.picasso.Callback$EmptyCallback
Dependencies:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-
layout:1.1.3'
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.squareup.picasso:picasso:2.5.2'
}
Picasso:
Picasso.with(About.this).load(photo).into(myImageView, new Callback() {
#Override public void onSuccess() {
Log.d("Debug", "Picasso Success");
}
#Override public void onError() {
Log.d("Debug", "Picasso Errored");
}
});
String photo:
String photo = getIntent().getExtras().getString("photo");
try to update to implementation "com.squareup.picasso:picasso:2.71828"
the duplicate entry program type already present can only come from another library or another module. most likely, there is a unnecessary picasso .jar in the libs directory, which ot delete.