dybarsky / spots-dialog

Android AlertDialog with moving dots progress indicator
MIT License
1.08k stars 242 forks source link

java.lang.NoSuchFieldError: dmax.dialog.R$id.progress #9

Closed ftp27 closed 7 years ago

ftp27 commented 9 years ago

Hello. Your library causes error:

    java.lang.NoSuchFieldError: dmax.dialog.R$id.progress
            at dmax.dialog.SpotsDialog.initProgress(SpotsDialog.java:76)
            at dmax.dialog.SpotsDialog.onCreate(SpotsDialog.java:49)
            at android.app.Dialog.dispatchOnCreate(Dialog.java:353)
            at android.app.Dialog.show(Dialog.java:257)
dybarsky commented 9 years ago

Do you use proguard?

ftp27 commented 9 years ago

No.

dybarsky commented 9 years ago

This is really strange. I will check it. Please, write device android version, app build tools version

live-wire commented 9 years ago

java.lang.NoSuchFieldError: dmax.dialog.R$id.progress at dmax.dialog.SpotsDialog.initProgress(SpotsDialog.java:76) at dmax.dialog.SpotsDialog.onCreate(SpotsDialog.java:49) at android.app.Dialog.dispatchOnCreate(Dialog.java:353) at android.app.Dialog.show(Dialog.java:257) i didn't get it before. I suddendly started getting it today device android version - 4.4.4 app build tools version - 21.1.2

dybarsky commented 9 years ago

I can't reproduce it on android 4.4.4 with build tools 21.1.2 and spots dialog version 0.4 If you are using proguard, add these into your custom rules file:

-keep class dmax.dialog.** {
    *;
}
dybarsky commented 9 years ago

May be you use progress id in your project. Please, check it out

dybarsky commented 9 years ago

One more question. Can you reproduce it in 100% times ?

live-wire commented 9 years ago

It was working fine for me till this morning. I didn't change anything. I am not using proguard and progress id. //alertDialog = new SpotDialog.... I get this error on alertDialog.show();

live-wire commented 9 years ago

Now I'm getting this error 100% times on my kitkat device :(

dybarsky commented 9 years ago

Okay. Googling and Stackowerflowing made this clear. The problem comes, when you use in project layout resource with the same name as library uses. In you case this is dialog.xml. Do you have such layout file? Try to rename it and check this issue again. And I will rename resoures files in library to some more complex names to avoid such overridings

live-wire commented 9 years ago

Yeah. This was it. :smile: Thanks Maksym and renaming your resource files sounds like a good idea :+1:

dybarsky commented 9 years ago

Great. I am happy, we have found the solution :) Version 0.6 will contain this renaming fix.

dybarsky commented 9 years ago

Fixed in version 0.6

rajesh-codes commented 7 years ago

Hello, I am getting the line as follows

AlertDialog dialog=new SpotsDialog(MainActivity.this); //error in this line as follows

Incompatible types. Required: android.support.v7.app.AlertDialog Found: dmax.dialog.SpotsDialog

dybarsky commented 7 years ago

Hi @rajesh7777 . You should replace import android.support.v7.app.AlertDialog with import android.app.AlertDialog

harrytrinh2 commented 6 years ago

thank you!

RADS5 commented 6 years ago

hellow please i am geting error at this line : final AlertDialog waitingDialog = new SpotsDialog(this); waitingDialog.show(); waitingDialog.setMessage("Please waiting...."); waitingDialog.setCancelable(false);

here is the error : error: constructor SpotsDialog in class SpotsDialog cannot be applied to given types; required: Context,String,int,boolean,OnCancelListener found: MainActivity reason: actual and formal argument lists differ in length

saadh393 commented 5 years ago

Hi @rajesh7777 . You should replace import android.support.v7.app.AlertDialog with import android.app.AlertDialog

Thanks This Helps me Now it's working <3

sky2dev commented 5 years ago

thanks bro