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

Build breaks with support library 23.0.0 #226

Closed
koch-t opened this issue Aug 18, 2015 · 11 comments
Closed

Build breaks with support library 23.0.0 #226

koch-t opened this issue Aug 18, 2015 · 11 comments

Comments

@koch-t
Copy link
Contributor

koch-t commented Aug 18, 2015

Combining this library with the new support library, fail the build since both libraries declare the attribute titleTextColor Attribute "titleTextColor" has already been defined

@ryugoo
Copy link

ryugoo commented Aug 18, 2015

Same problem occurred. So I made a deal with provisional.

  1. Download version 1.6.2 code.
  2. Fix code
  3. Import module (Android Studio)

Fix1

https://github.com/square/android-times-square/blob/master/library/res/values/attrs.xml#L8

<attr name="titleTextColor2" format="color"/>

Fix2

https://github.com/square/android-times-square/blob/master/library/src/com/squareup/timessquare/CalendarPickerView.java#L122

titleTextColor = a.getColor(R.styleable.CalendarPickerView_titleTextColor2,

@freezy
Copy link

freezy commented Aug 18, 2015

Same problem here. Wouldn't it better to prefix all custom attributes in order to avoid this kind of conflict?

@NeverGivinUp
Copy link

Same problem. Agree with @freezy. Took me forever to find the cause.

@edenman
Copy link
Collaborator

edenman commented Aug 18, 2015

Merged @niqo01's PR. Working on getting a 1.6.3 release out now.

@edenman edenman closed this as completed Aug 18, 2015
@edenman
Copy link
Collaborator

edenman commented Aug 19, 2015

Released 1.6.3. It'll take a little time to propogate out into maven central.

@NeverGivinUp
Copy link

My app is crashing. I don't understand why though. I don't think I am styling CalendarPickerView.

Here is my test case:

BugTest.java

package com.vahdat.gastricbypasssupport;

import android.os.Bundle;

import com.vahdat.gastricbypasssupport.ui.ActionBarBaseActivity;

public class BugTest extends ActionBarBaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bug_test);

    }
}

activity_bug_test.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical">

    <com.squareup.timessquare.CalendarPickerView
        android:id="@+id/calendar_view"
        android:layout_width="match_parent"
        android:layout_height="0px"
        android:layout_weight="1"
        />
</LinearLayout>

Stack trace

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vahdat.gastricbypasssupport/com.vahdat.gastricbypasssupport.BugTest}: android.view.InflateException: Binary XML file line #7: Error inflating class com.squareup.timessquare.CalendarPickerView
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
            at android.app.ActivityThread.access$800(ActivityThread.java:139)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5086)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class com.squareup.timessquare.CalendarPickerView
            at android.view.LayoutInflater.createView(LayoutInflater.java:620)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
            at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:257)
            at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
            at com.vahdat.gastricbypasssupport.BugTest.onCreate(BugTest.java:12)
            at android.app.Activity.performCreate(Activity.java:5248)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
            at android.app.ActivityThread.access$800(ActivityThread.java:139)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5086)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.reflect.InvocationTargetException
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at android.view.LayoutInflater.createView(LayoutInflater.java:594)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
            at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:257)
            at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
            at com.vahdat.gastricbypasssupport.BugTest.onCreate(BugTest.java:12)
            at android.app.Activity.performCreate(Activity.java:5248)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
            at android.app.ActivityThread.access$800(ActivityThread.java:139)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5086)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.content.res.Resources$NotFoundException: File res/anim/abc_fade_out.xml from color state list resource ID #0x7f040001
            at android.content.res.Resources.loadColorStateList(Resources.java:2255)
            at android.content.res.Resources.getColor(Resources.java:817)
            at com.squareup.timessquare.CalendarPickerView.<init>(CalendarPickerView.java:114)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at android.view.LayoutInflater.createView(LayoutInflater.java:594)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
            at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:257)
            at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
            at com.vahdat.gastricbypasssupport.BugTest.onCreate(BugTest.java:12)
            at android.app.Activity.performCreate(Activity.java:5248)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
            at android.app.ActivityThread.access$800(ActivityThread.java:139)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5086)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag alpha
            at android.content.res.ColorStateList.createFromXmlInner(ColorStateList.java:146)
            at android.content.res.ColorStateList.createFromXml(ColorStateList.java:129)
            at android.content.res.Resources.loadColorStateList(Resources.java:2251)
            at android.content.res.Resources.getColor(Resources.java:817)
            at com.squareup.timessquare.CalendarPickerView.<init>(CalendarPickerView.java:114)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at android.view.LayoutInflater.createView(LayoutInflater.java:594)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
            at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:257)
            at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
            at com.vahdat.gastricbypasssupport.BugTest.onCreate(BugTest.java:12)
            at android.app.Activity.performCreate(Activity.java:5248)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
            at android.app.ActivityThread.access$800(ActivityThread.java:139)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5086)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)

@freezy
Copy link

freezy commented Aug 19, 2015

Thanks for the quick fix, works well here. Cheers!

@edenman
Copy link
Collaborator

edenman commented Aug 19, 2015

@NeverGivinUp this looks unrelated. Can you please upload your entire test project and file a new issue please?

@khusravsh
Copy link

@edenman I have a similar error, created new issue, because lost this PR somehow and couldn't write here. (In fact, just mistakenly thought this issue was a PR)

@alexustinovsm
Copy link

@ryugoo, thanks for work around!

@kan137g
Copy link

kan137g commented Oct 28, 2016

if just rename it,we maybe not ask this question.
my code run normal in pc, while in Mac this error occurred.

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