hoang8f / android-flat-button

FButton - a flat button library for Android
Apache License 2.0
1.4k stars 327 forks source link

Error inflating class info.hoang8f.widget.FButton #41

Open Abdulwahid80 opened 6 years ago

Abdulwahid80 commented 6 years ago

After updating android studio form 2.3.3 to 3.0 I faced this problem my project was working properly with FButton. when I upgrade android studio then update my project this problem appears. Also After modifying build gradle to 2.3.3 the same problem still existed but when I delete google repository form build script repositories and all project repositories it works properly. I would to know what cause this problem?

8155220 commented 6 years ago

same here

8155220 commented 6 years ago
  1. prest Ctrl+Alt+Shift+S
  2. Select project
  3. Change gradle Version to -> 3.3
  4. change Android PLugin version to -> 2.3.3

that work for me

GoltsevEugene commented 6 years ago

I believe that should be fixed asap. 8155220 - bad idea, you won't use all enhancement in new gradle in such case.

adhavpavan commented 6 years ago

same issue

indy1515 commented 6 years ago

@pranaysharma What do you add to hot fix the problem?

Patra89 commented 6 years ago

Is this issue going to be fixed soon? Also @pranaysharma could you give more details about what I'm I supposed to do to fix this?

jd-alexander commented 6 years ago

Hey everyone! I fixed it. Use my library as a dependency https://github.com/jd-alexander/android-flat-button

https://jitpack.io/#jd-alexander/android-flat-button/v1.1

Abdulwahid80 commented 6 years ago

thanks @jd-alexander it works properly with modifying button_color to fButtonColor. it really helps

abhriyaroy commented 6 years ago

@pranaysharma please could you clarify as to what the fix is? Like, what tags do I add the color hex codes with in the colors.xml file?

jd-alexander commented 6 years ago

@abhriyaroy just use my dependency in the link above. I changed some stuff with the attributes; naming and type.

jd-alexander commented 6 years ago

@abhriyaroy if you really wanna see the changes you can also just look on the most recent commit logs by me and the other contributor before.

abhriyaroy commented 6 years ago

@jd-alexander thank you so much!

correaricardo commented 6 years ago

@jd-alexander Whoa, what a nice fella.

useit4me commented 6 years ago

Same as @jd-alexander said. Just rephrasing here. the fix is

  1. Copy the file FButton.java from here --> https://github.com/hoang8f/android-flat-button/blob/master/library/src/main/java/info/hoang8f/widget/FButton.java to src/main/java/

  2. In the FButton.java change FButton_buttonColorat the line no 115 } else if (attr == R.styleable.FButton_buttonColor) to } else if (attr == R.styleable.FButton_fButtonColor) {

  3. Copy/Merge the 3 files under the https://github.com/hoang8f/android-flat-button/tree/master/library/src/main/res/values

  4. Make sure the build.gradle (Module) uses the library compile 'com.github.jd-alexander:android-flat-button:v1.1'

  5. Make sure build.ggradle (project) has the jipack repository enabled like this allprojects { repositories { google() jcenter() maven { url 'https://jitpack.io' } } }

  6. In the activity_main.xml or similar wherever you guys are using the widget info.hoang8f.widget.FButton if you are using the property ButtonColor; change it to fButtonColor

If you have these steps taken care of the build should run fine.

maribelmai commented 6 years ago

Hello, I tried to use jd-alexander version but I really cannot change the min sdk version to 17 so I tried the following and it worked for me: Instead of using gradle to import the project, I downloaded it and imported as a module, then referenced the dependency, I hope it helps

eyildiz-ugoe commented 6 years ago

I cannot use this since it has some minimum version requirement.

maribelmai commented 6 years ago

@eyildiz-ugoe check my answer

maribelmai commented 6 years ago

I think I wasn't clear. The module I imported is https://github.com/hoang8f/android-flat-button/tree/master/library I didn't use the jd-alexander version

eyildiz-ugoe commented 6 years ago

Oh okay. I got it totally wrong then. Thanks, I'll use this one.

ashishdeshpande98 commented 6 years ago

Actually sir according to ur guidence I already done with the gradle version and Android plugin version , but after that I had these error Failed to resolve ' info.hoang8f:Fitting:1.0.5 ' Failed to resolve ' com.rdngwuxian.meterialedittext:library:2.1.4

takprosto commented 6 years ago

@jd-alexander I have this problem: Failed to resolve: com.github.jd-alexander:android-flat-button:v1.1 How can I fix it?

anggit97 commented 6 years ago

@jd-alexander you did the trick , it working ok! @useit4me you makes clear explanation, thanks man..

pranaysharma commented 6 years ago

Sorry Guys my band-aid fix was not working so deleted the post!!

stephanieporter commented 6 years ago

guys im struggling with this, im following a yoga tutorial and i have no idea what to do :(

panpan1997 commented 6 years ago

@stephanieporter
@jd-alexander you need to add following code in the build.gradle (Project: Your Project) allprojects { repositories { maven { url "https://jitpack.io" } } } and add following code in the build.gradle(app)

compile 'com.github.jd-alexander:android-flat-button:v1.1

add change all the buttoncolor to fbuttoncolor

engmms commented 6 years ago

Hi,All ..I follow the previous steps ,,and still the error

iSalmankhanZ commented 6 years ago

thanks a lot @jd-alexander your library works like charm.

jd-alexander commented 6 years ago

@iSalmankhanZ No problem. Really happy this minor fix has helped so many users! :sunglasses:

chrisdavery commented 6 years ago

![Uploading image.png…] i tried @jd-alexander 's tip at my existing app . but it appears like this how could fix i fix it?

chrisdavery commented 6 years ago

image

jd-alexander commented 6 years ago

Make sure offline mode isn't enabled.

chrisdavery commented 6 years ago

im not sure if im offline but how to check it?

On Thu, May 24, 2018 at 2:11 AM, Joel Dean notifications@github.com wrote:

Make sure offline mode isn't enabled.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hoang8f/android-flat-button/issues/41#issuecomment-391445805, or mute the thread https://github.com/notifications/unsubscribe-auth/AfE8DH61nPNk7VTz4gqV2gGhBbiv9x3oks5t1aZfgaJpZM4QJ7rB .

iSalmankhanZ commented 6 years ago

@chrisdavery Go to File -> Settings. And open the 'Build,Execution,Deployment', Then open the 'Build Tools' -> 'Gradle'. Then uncheck "Offline work" on the right. Click the 'OK' button. Then Rebuild the Project. it should work and are you following the EDMT DEV? i have completed the same series AndroidEatIt!

vincentieng commented 6 years ago

@iSalmankhanZ Hello, I follow what you said and the problem still occurr. I'm following the AndroidEatIt tutorial and i'm stuck with this problem. It said : "Could not find com.github.jd-alexander:android-flat-button:v1.1." And " Failed to resolve: com.github.jd-alexander:android-flat-button:v1.1"

Can you help me please ? Thank you

jd-alexander commented 6 years ago

@vincentieng read through all the comments above and see if you find a solution. Ensure you add JitPack as a repository.

vincentieng commented 6 years ago

@jd-alexander Thank you for your answer sir, I do have Jitpack as a repository but it still tell me that it "Failed to resolve : com.github.jd-alexander:android-flat-button:v1.1"

iSalmankhanZ commented 6 years ago

@chrisdavery please have a look at my gradel, hope this solve your error. gradelo

iSalmankhanZ commented 6 years ago

@chrisdavery you have to include the line maven.google.com please refer the image

vincentieng commented 6 years ago

@iSalmankhanZ @jd-alexander And it's working, thank a lot to both of you !

iSalmankhanZ commented 6 years ago

@vincentieng well good to know that its working all thanks to @jd-alexander for providing this library, happy coding.!

jd-alexander commented 6 years ago

Awesome!

chrisdavery commented 6 years ago

Hi Salman ! Thank you! i'll update you if i tried this . On 30 Jun 2018 20:13, "iSalmankhanZ" notifications@github.com wrote:

@chrisdavery https://github.com/chrisdavery please have a look at my gradel, hope this solve your error. [image: gradelo] https://user-images.githubusercontent.com/32505719/42125070-fffb2a14-7c8c-11e8-8283-9b2124abcade.JPG

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hoang8f/android-flat-button/issues/41#issuecomment-401537337, or mute the thread https://github.com/notifications/unsubscribe-auth/AfE8DFmRVK8RWg1Z0QJ7zBCj7rCPHYOhks5uB2tPgaJpZM4QJ7rB .

chrisdavery commented 6 years ago

how's this master?

On Sat, Jun 30, 2018 at 8:13 PM, iSalmankhanZ notifications@github.com wrote:

@chrisdavery https://github.com/chrisdavery please have a look at my gradel, hope this solve your error. [image: gradelo] https://user-images.githubusercontent.com/32505719/42125070-fffb2a14-7c8c-11e8-8283-9b2124abcade.JPG

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hoang8f/android-flat-button/issues/41#issuecomment-401537337, or mute the thread https://github.com/notifications/unsubscribe-auth/AfE8DFmRVK8RWg1Z0QJ7zBCj7rCPHYOhks5uB2tPgaJpZM4QJ7rB .

jd-alexander commented 6 years ago

What do you mean?

chrisdavery commented 6 years ago

is it now ok?

On Sat, Jul 7, 2018 at 10:54 AM, Joel Dean notifications@github.com wrote:

What do you mean?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hoang8f/android-flat-button/issues/41#issuecomment-403183763, or mute the thread https://github.com/notifications/unsubscribe-auth/AfE8DEX3Jg9lhEFkUF4JMaGGEggm7py_ks5uECLwgaJpZM4QJ7rB .

chrisdavery commented 6 years ago

still unable to resolve :(

On Sun, Jul 8, 2018 at 7:10 PM, Chris Dave Piaoan pchrisdave@gmail.com wrote:

is it now ok?

On Sat, Jul 7, 2018 at 10:54 AM, Joel Dean notifications@github.com wrote:

What do you mean?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hoang8f/android-flat-button/issues/41#issuecomment-403183763, or mute the thread https://github.com/notifications/unsubscribe-auth/AfE8DEX3Jg9lhEFkUF4JMaGGEggm7py_ks5uECLwgaJpZM4QJ7rB .

vincentieng commented 6 years ago

@iSalmankhanZ Hello, I know it's not the appropriate topic but as you've done the restauration app. I would like to ask you if you can help me because i'm stuck on a little problem for 3 days.

I'm at the part where when you click on a food, it's suppose to show you the detail and the quantity you would like to purchase, the problem is that when I click on the food. It seems that my clickListener is not working, here is my code.

`private void loadMenu(){ adapter = new FirebaseRecyclerAdapter<Category,MenuViewHolder>(Category.class,R.layout.menu_item, MenuViewHolder.class, category) { @Override protected void populateViewHolder(final MenuViewHolder viewHolder, Category model, int position) { viewHolder.txtMenuName.setText(model.getName()); Picasso.with(getBaseContext()).load(model.getImage()) .into(viewHolder.imageView); final Category clickItem = model; viewHolder.setItemClickListener(new ItemClickListener() { @Override public void onClick(View view, int position, boolean isLongClick) { Toast.makeText(Home.this, ""+clickItem.getName(), Toast.LENGTH_SHORT).show(); Intent foodList = new Intent(Home.this, FoodList.class); foodList.putExtra("CategoryId", adapter.getRef(position).getKey()); startActivity(foodList);

                }
            });
        }
    };

    recycler_menu.setAdapter(adapter);
}`

I would also know if it is possible to DM on github (i'm a noob x) ) or create an independant topic like on stackoverflow.

Thanks a lot

iSalmankhanZ commented 6 years ago

@vincentieng here you go, you have to update firebase from 11.0 to 12.0 or higher refer this https://github.com/iSalmankhanZ/FINALproject

//Loading Menu private void loadMenu() { FirebaseRecyclerOptions options = new FirebaseRecyclerOptions.Builder() .setQuery(category, Category.class) .build(); adapter = new FirebaseRecyclerAdapter<Category, MenuViewHolder>(options) { @Override protected void onBindViewHolder(@NonNull MenuViewHolder viewHolder, final int position, @NonNull Category model) { viewHolder.txtMenuName.setText(model.getName()); Picasso.with(getBaseContext()).load(model.getImage()) .into(viewHolder.imageView); final Category clickItem = model; viewHolder.setItemClickListner(new ItemClickListner() { @Override public void onClick(View v, int adapterPosition, boolean isLongClick) { Intent serviceList = new Intent(Home.this, FoodList.class); serviceList.putExtra("CategoryId", adapter.getRef(position).getKey()); startActivity(serviceList); } }); } @NonNull @Override public MenuViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.menu_item, parent, false); return new MenuViewHolder(itemView); } }; adapter.startListening(); recycler_menu.setAdapter(adapter); }

vincentieng commented 6 years ago

@iSalmankhanZ Thank you, it works for me.

iSalmankhanZ commented 6 years ago

@vincentieng Happy to know.