Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ftp27 opened this issue Oct 1, 2015 · 19 comments
Closed

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

ftp27 opened this issue Oct 1, 2015 · 19 comments

Comments

@ftp27
Copy link

ftp27 commented Oct 1, 2015

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
Copy link
Owner

dybarsky commented Oct 1, 2015

Do you use proguard?

@ftp27
Copy link
Author

ftp27 commented Oct 1, 2015

No.

@dybarsky
Copy link
Owner

dybarsky commented Oct 1, 2015

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

@live-wire
Copy link

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
Copy link
Owner

dybarsky commented Oct 7, 2015

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
Copy link
Owner

dybarsky commented Oct 7, 2015

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

@dybarsky
Copy link
Owner

dybarsky commented Oct 7, 2015

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

@live-wire
Copy link

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
Copy link

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

@dybarsky
Copy link
Owner

dybarsky commented Oct 7, 2015

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
Copy link

Yeah. This was it. 😄 Thanks Maksym and renaming your resource files sounds like a good idea 👍

@dybarsky
Copy link
Owner

dybarsky commented Oct 7, 2015

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

@dybarsky
Copy link
Owner

dybarsky commented Oct 7, 2015

Fixed in version 0.6

@dybarsky dybarsky closed this as completed Oct 7, 2015
@rajesh-codes
Copy link

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
Copy link
Owner

dybarsky commented Nov 29, 2017

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

@dybarsky dybarsky reopened this Nov 29, 2017
@harrytrinh2
Copy link

thank you!

@RADS5
Copy link

RADS5 commented Jun 13, 2018

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
Copy link

saadh393 commented May 3, 2019

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
Copy link

sky2dev commented Sep 15, 2019

thanks bro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants