I receive this error in Android Studio when I try to render a DatePicker:
Rendering Problems Exception raised during rendering: java/nio/charset/Charsets
When I delete the DataPicker from raw XML the error dissappears and I can work normally with my layout, but as soon as I try to add a DataPicker this error appears and I cannot see any component in the Component Tree, nor any activity in the activity view (where I operate with the design of my layout).
I'm using API 16 to render the layout (since APIs 17 & 18 are broken with CalendarView & DataPicker) and for locale I have es-ES.
What can I do to solve this error or, at least, be able to work in Design view with a DataPicker?
Related
The app is crashing when the app is in the background and I changed the font and open the app again.
Getting Below error
Caused by: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment could not find Fragment constructor
Steps
Open the bottom sheet dialog CategoriesBottomSheetDialog
Minimize the application (in the background)
Changed font
Open the app again
I can provide a fix using bundle but I want to know if using kotlin plugin no-arg concept can apply this annotation on CategoriesBottomSheetDialog and allow the class to be invoked with the empty constructor.
#NoArg
class CategoriesBottomSheetDialog(
override val di: DI,
screenType: MainScreenType
) : DIAware, BottomSheetDialogFragment() {}
I tried but not working even though the root cause is unable to invoke an empty constructor. Any inputs on this note to kind of solve without using bundle?
It's my first time that I am using Maps in my Android Studio project.
My problem is that I always get the same error code:
java.lang.IllegalArgumentException: Textures with dimensions16x256 are
larger than the maximum supported size 0x0
at com.google.maps.api.android.lib6.gmm6.vector.gl.ai.a(:com.google.android.gms.dynamite_mapsdynamite#17785052#17.7.85
(040700-253824076):75)
at com.google.maps.api.android.lib6.gmm6.vector.gl.ak.a(:com.google.android.gms.dynamite_mapsdynamite#17785052#17.7.85
(040700-253824076):52)
at com.google.maps.api.android.lib6.gmm6.vector.gl.ak.(:com.google.android.gms.dynamite_mapsdynamite#17785052#17.7.85
(040700-253824076):4)
at com.google.maps.api.android.lib6.gmm6.vector.gl.f.(:com.google.android.gms.dynamite_mapsdynamite#17785052#17.7.85
(040700-253824076):44)
at com.google.maps.api.android.lib6.gmm6.vector.bx.a(:com.google.android.gms.dynamite_mapsdynamite#17785052#17.7.85
(040700-253824076):82)
at com.google.maps.api.android.lib6.gmm6.vector.bi.run(:com.google.android.gms.dynamite_mapsdynamite#17785052#17.7.85
(040700-253824076):90)
It would be nice if someone could help me.
For some reason on the project I am working on in Android Studio the XML graphic editor has stopped showing me the picture of the screen layout. The app itself works fine and the layout woks fine on my device, but I don't have a picture of it on my computer screen in the editor.
The editor shows a error Rendering Problem - Exception raised during rendering
in the details it shows me a stack trace of a java.lang.NullPointerException, and it tip is to try and refresh the layout, but that doesn't work. I tried to refresh, to rebuild, and every other kind of refresh possible but nothing works. I checked other projects that I had worked on and thy where OK the graphics was fine, but not on my current project. So I need help finding the problem.
java.lang.NullPointerException
at android.graphics.BidiRenderer.getScriptFont(BidiRenderer.java:290)
at android.graphics.BidiRenderer.getScriptRuns(BidiRenderer.java:280)
at android.graphics.BidiRenderer.renderText(BidiRenderer.java:133)
at android.graphics.BidiRenderer.renderText(BidiRenderer.java:108)
at android.graphics.Paint_Delegate.measureText(Paint_Delegate.java:1310)
at android.graphics.Paint_Delegate.nGetTextAdvances(Paint_Delegate.java:972)
at android.graphics.Paint_Delegate.nGetRunAdvance(Paint_Delegate.java:1147)
at android.graphics.Paint.nGetRunAdvance(Paint.java)
at android.graphics.Paint.getRunAdvance(Paint.java:2729)
at android.text.TextLine.getRunAdvance(TextLine.java:729)
at android.text.TextLine.handleText(TextLine.java:778)
at android.text.TextLine.handleRun(TextLine.java:1018)
at android.text.TextLine.measureRun(TextLine.java:417)
at android.text.TextLine.measure(TextLine.java:310)
at android.text.TextLine.metrics(TextLine.java:281)
at android.text.Layout.measurePara(Layout.java:1966)
at android.text.Layout.getDesiredWidthWithLimit(Layout.java:186)
at android.widget.TextView.onMeasure(TextView.java:8168)
at android.view.View.measure(View.java:22035)
at android.widget.Toolbar.measureChildCollapseMargins(Toolbar.java:1548)
at android.widget.Toolbar.onMeasure(Toolbar.java:1662)
at android.view.View.measure(View.java:22035)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6622)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at com.android.internal.widget.ActionBarContainer.onMeasure(ActionBarContainer.java:291)
at android.view.View.measure(View.java:22035)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6622)
at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:378)
at android.view.View.measure(View.java:22035)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure(View.java:22035)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.measureView(RenderSessionImpl.java:590)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:343)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:384)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:547)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.java:681)
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)
In xml toolbar you can find refresh button, so that it will notify if it is any warnings in your xml.
If your used custom layout then rendering problem shown..
Let see the error log:
java.lang.NullPointerException
at android.graphics.BidiRenderer.getScriptFont(BidiRenderer.java:290)
I think you need to clone project like library module, then add #Nullable to this method to avoid exception here.
if view is rendering fine at run time but you are only having problem showing preview in layout editor then you should use isInEditMode() method and should not do unsupported operations if view is being rendered in layout editor
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (!isInEditMode()) {
//custom logic
}
}
I am sorry to say that your answers did not help me at all. The solution for me was to go back to one of my backup visions, when the edit display still worked, and start from there. I found that when changing too many parameters in the Theme Editor (three) cause a bug that stops the XML editor from showing the layout picture.
One of the things I learned many years ago when first started to learn programming was that there is no such thing as to many backups, this is one of those time when I am glad I listed to my teachers.
I was testing my app with the new Android 5.0 (API21) but was getting an error with the CalendarView
Caused by: java.lang.UnsupportedOperationException: CalendarView does not exists for the new DatePicker
at android.widget.DatePickerCalendarDelegate.getCalendarView(DatePickerCalendarDelegate.java:501)
at android.widget.DatePicker.getCalendarView(DatePicker.java:365)
For my surprise the error was not because there is no CalendarView in the NEW API21 DatePicker, in fact, there is no DatePicker in API21, just CalendarView.
The error was produced because I was hidding the Week Numbers in the CalendarView
picker.getCalendarView().setShowWeekNumber(false);
This instruction throws the UnsupportedOperationException, be warned no more Week Numbers in the CalendarView, they just disappeared it, no explanation.
One problem that can cause this exception is that if your DatePicker mode is android:datePickerMode="calendar", DatePicker.getCalendarView would cause exception in post API 21, then in order to solve this, change the mode of your DatePicker to android:datePickerMode="spinner" and in java you can use from conditions to handle API greater than or equal to 21
I think you are getting confused.
your requirement is "to hide week number"
But actually there is no week Number in date picker neither in api21 nor below 21
so i suggest you skipping "picker.getCalendarView().setShowWeekNumber(false);"
line and continue with rest of code.
In a RCP application, I change the locale by programatically setting it in the .ini file and restarting the application.
The problem is that view titles, which are defined in OSGI-INF/l10n files referred from the plugin.xml file, aren't updated until I focus them.
For example after having switched from EN to FR, I have this :
It's only after I click on the second tab that I get this :
I can't reset the perspectives as they may have been changed by the user (view resized, removed or added). I've set configurer.setSaveAndRestore(true); in my WorkbenchAdvisor.initialize method to ensure the views layout is restored at launch.
Is there a way to programatically force an update of the views titles without losing the perspective configuration ?
I precise that I can't use the new Eclipse 4 (Juno) API.
As you are restoring perspective from previous session, it might be remembering part titles.
By default ViewPart doesnt do anything in saveMemento() method.
Override below methods are to debug the issue
public void init(IViewSite site, IMemento memento) throws PartInitException
String getPartName()