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

Render error with DeluxeSpeedView #32

Closed
Rainbow87 opened this issue Jun 7, 2017 · 11 comments
Closed

Render error with DeluxeSpeedView #32

Rainbow87 opened this issue Jun 7, 2017 · 11 comments
Labels
Bug bug!!

Comments

@Rainbow87
Copy link

Hello,
i add DeluxeSpeedView to layout but it shows render errors:

java.lang.NoSuchFieldError: Speedometer_sv_speedometerMode
at com.github.anastr.speedviewlib.base.Speedometer.initAttributeSet(Speedometer.java:87)
at com.github.anastr.speedviewlib.base.Speedometer.(Speedometer.java:58)
at com.github.anastr.speedviewlib.DeluxeSpeedView.(DeluxeSpeedView.java:45)
at com.github.anastr.speedviewlib.DeluxeSpeedView.(DeluxeSpeedView.java:41)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:475)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:262)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:220)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:186)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:334)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:345)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:245)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:861)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:197)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:902)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:854)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:324)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:368)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:567)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:549)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:863)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:549)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$1(RenderTask.java:680)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

image

However, when i run app it can shows DeluxeSpeedView:
image

Please help me render without error.
Thanks!

@anastr
Copy link
Owner

anastr commented Jun 7, 2017

Try to build your project, build -> Make Project , or CTRL + F9.

@anastr anastr added the Bug bug!! label Jun 7, 2017
@Rainbow87
Copy link
Author

I tried to Make Project but still error

@anastr
Copy link
Owner

anastr commented Jun 8, 2017

if you have the same error with all Speedometers, that means you have problem with your project, maybe it need clone project or Gradle sync.
if not, and this is real render bug, the library must use isInEditMode() in Deluxe​Speedometer and RaySpeedometer , this is my mistake.
It will be fix in the next version.

Thanks.

@anastr
Copy link
Owner

anastr commented Jul 19, 2017

fixed in the new Version 1.1.5.

@anastr anastr closed this as completed Jul 19, 2017
@Rainbow87
Copy link
Author

Rainbow87 commented Jul 20, 2017

i compiled with version 1.1.5 (compile 'com.github.anastr:speedviewlib:1.1.5') but the still render errors with not only DeluxeSpeedView but also all of other views. i tried to clean and make project again but can not fix.

image

java.lang.NoSuchFieldError: Speedometer_sv_speedometerMode
at com.github.anastr.speedviewlib.base.Speedometer.initAttributeSet(Speedometer.java:78)
at com.github.anastr.speedviewlib.base.Speedometer.(Speedometer.java:64)
at com.github.anastr.speedviewlib.DeluxeSpeedView.(DeluxeSpeedView.java:44)
at com.github.anastr.speedviewlib.DeluxeSpeedView.(DeluxeSpeedView.java:40)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:475)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:262)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:220)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:186)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:334)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:345)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:245)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:861)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:197)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:902)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:854)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:324)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:368)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:567)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:549)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:863)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:549)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$1(RenderTask.java:680)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

@anastr
Copy link
Owner

anastr commented Jul 20, 2017

Show me the XML code please.

@Rainbow87
Copy link
Author

<com.github.anastr.speedviewlib.DeluxeSpeedView
android:id="@+id/Home_spv_SpeedMeter"
android:layout_width="280dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"

        app:sv_speedTextColor="@color/colorAccent"
        app:sv_speedBackgroundColor="@android:color/transparent"
        app:sv_textColor="@color/colorWhite"
        app:sv_unitTextColor="@color/colorAccent"
        app:sv_centerCircleColor="@color/colorWhite"
        app:sv_unitTextSize="40dp"
        app:sv_speedTextSize="60dp"
        app:sv_speedTextPadding="0dp"
        app:sv_speedTextPosition="BOTTOM_CENTER"
        app:sv_speedTextFormat="INTEGER"
        app:sv_speedTextTypeface="fonts/DS-DIGII.TTF"
        app:sv_maxSpeed="130"
        app:sv_minSpeed="0"
        app:sv_lowSpeedPercent="30"
        app:sv_mediumSpeedPercent="70"
        app:sv_lowSpeedColor="@color/colorDarkGreen"
        app:sv_mediumSpeedColor="@color/colorDarkYellow"
        app:sv_highSpeedColor="@color/colorRed"
        app:sv_unitSpeedInterval="5dp"
        app:sv_startDegree="150"
        app:sv_endDegree="390"
        app:sv_withTremble="false"
        app:sv_speedometerMode="NORMAL"

        android:layout_below="@+id/Home_tv_Title"
        android:layout_centerHorizontal="true" />

@anastr
Copy link
Owner

anastr commented Jul 20, 2017

this is a little more confusing.
would you try to delete line app:sv_speedometerMode="NORMAL", it is completely useless, (default sv_speedometerMode is NORMAL)
anyway, it doesn't show me any error !! i don't really know why this render show up !

@sermyagin
Copy link

Error help me...

activity_control.xml:14: AAPT: error: attribute sv_highSpeedColor (aka com.github.anastr.speedview:sv_highSpeedColor) not found.

activity_control.xml:14: AAPT: error: attribute sv_lowSpeedColor (aka com.github.anastr.speedview:sv_lowSpeedColor) not found.

activity_control.xml:14: AAPT: error: attribute sv_mediumSpeedColor (aka com.github.anastr.speedview:sv_mediumSpeedColor) not found.
AAPT: error: attribute sv_highSpeedColor (aka com.github.anastr.speedview:sv_highSpeedColor) not found.

activity_ray.xml:14: AAPT: error: attribute sv_lowSpeedColor (aka com.github.anastr.speedview:sv_lowSpeedColor) not found.

ray.xml:14: AAPT: error: attribute sv_mediumSpeedColor (aka com.github.anastr.speedview:sv_mediumSpeedColor) not found.

activity_work_with_indicator.xml:16: AAPT: error: attribute sv_highSpeedColor (aka com.github.anastr.speedview:sv_highSpeedColor) not found.

activity_work_with_indicator.xml:16: AAPT: error: attribute sv_lowSpeedColor (aka com.github.anastr.speedview:sv_lowSpeedColor) not found.

activity_work_with_indicator.xml:16: AAPT: error: attribute sv_lowSpeedPercent (aka com.github.anastr.speedview:sv_lowSpeedPercent) not found.

activity_work_with_indicator.xml:16: AAPT: error: attribute sv_mediumSpeedColor (aka com.github.anastr.speedview:sv_mediumSpeedColor) not found.

activity_work_with_indicator.xml:16: AAPT: error: attribute sv_mediumSpeedPercent (aka com.github.anastr.speedview:sv_mediumSpeedPercent) not found.

activity_work_with_note.xml:15: AAPT: error: attribute sv_highSpeedColor (aka com.github.anastr.speedview:sv_highSpeedColor) not found.

activity_work_with_note.xml:15: AAPT: error: attribute sv_lowSpeedColor (aka com.github.anastr.speedview:sv_lowSpeedColor) not found.

activity_work_with_note.xml:15: AAPT: error: attribute sv_mediumSpeedColor (aka com.github.anastr.speedview:sv_mediumSpeedColor) not found.

@anastr
Copy link
Owner

anastr commented Nov 22, 2019

The answer in #166 @sermyagin

@sermyagin
Copy link

Ответ в # 166 @sermyagin

thanks I will try

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

No branches or pull requests

3 participants