Open benzscoutout opened 7 years ago
Hi @Mercidez Does this exception appears in the sample app? Otherwise could you please share your code?
I hit the same issue. Log
kotlin.UninitializedPropertyAccessException: lateinit property items has not been initialized
at com.igalata.bubblepicker.rendering.PickerRenderer.initialize(PickerRenderer.kt:79)
at com.igalata.bubblepicker.rendering.PickerRenderer.onSurfaceChanged(PickerRenderer.kt:67)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1537)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1253)
BTW, [Feature request] Is there any way to load image from network?
Hello. Have you by any chance figured out the solution? Cause actually i am facing the same problem right now.
To be more precise this is the code (i believe it is the way it should be)
and this is the error
I have the exactly the same problem
I got many errors in GLSurfaceView class. Any ideas that could help?
I am also getting this issue, any help!!
Please check if your array is non zero so that the bubblepicker can initialize and adapter get set as otherwise, the PickerRenderer.initialize(PickerRenderer) doesn't get initialized and this issue occur
declare array before main instance this solve my problem
It is very sad that the developer is not addressing the issue many of us are facing :(
@ismailtosun Could you paste the code as it should be according to you?
Here is my code: @ismailtosun @igalata Kindly help
public class BubblePicker extends AppCompatActivity {
com.igalata.bubblepicker.rendering.BubblePicker picker;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bubble_picker);
final String[] titles = getResources().getStringArray(R.array.countries);
final TypedArray colors = getResources().obtainTypedArray(R.array.colors);
final TypedArray images = getResources().obtainTypedArray(R.array.images);
picker=new com.igalata.bubblepicker.rendering.BubblePicker(this);
picker.setAdapter(new BubblePickerAdapter() {
@Override
public int getTotalCount() {
return images.length();
}
@NotNull
@Override
public PickerItem getItem(int position) {
PickerItem item = new PickerItem();
item.setTitle(titles[position]);
item.setGradient(new BubbleGradient(colors.getColor((position * 1) % 2, 0),
colors.getColor((position) % 1 + 1, 0), BubbleGradient.VERTICAL));
// item.setTypeface(mediumTypeface);
item.setTextColor(ContextCompat.getColor(BubblePicker.this, android.R.color.white));
item.setBackgroundImage(ContextCompat.getDrawable(BubblePicker.this, images.getResourceId(position, 0)));
return item;
}
});
}
@Override
protected void onResume() {
super.onResume();
picker.onResume();
}
@Override
protected void onPause() {
super.onPause();
picker.onPause();
}
}
same issue, any working solutions?
I am getting error when i write junit testcase:
kotlin.UninitializedPropertyAccessException: lateinit property inventoryService has not been initialized
at com.e8om.books.junit.svc.InventoryServiceTests.stockGroupListTest(InventoryServicesTest.kt:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Hi All, I too got same exception, any working solution found?
I noticed that this happens when your adapter is not set at the time when "onResume" is called. This happens to me too when I try to fetch items from the API and onResume
gets called earlier than I get them and thus I got it to not crash by setting an empty list for an adapter, but now when I do get the items, they do not get displayed even though adapter's methods do get called e.g. getItem
.
@BenzScoutOut @dbof10 @P130 @CHRISPASP95 @MilanVucic @rosanlal26 please review my lib was developed based on this lib. This is a conflict between java and kotlin library and I fixed this issue https://github.com/hantrungkien/Bubble-Picker
I am facing this issue, Any solution
kotlin.UninitializedPropertyAccessException: lateinit property viewModelFactory has not been initialized at com.kavin.task.landist.country.ui.CountryFragment.onCreateView(CountryFragment.kt:31) at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2605) etc.
I'm not use kotlin project, I use java
I try to use this library but error when startActivity
"lateinit property items has not been initialized"