How to fix kivy.factory.FactoryException: Unknown class Error

3,687 views
Skip to first unread message

뿌야

unread,
Apr 18, 2020, 12:41:30 PM4/18/20
to Kivy users support
I have some problem during my kivy project.
I stayed long time search google but I didn't solved it.

Here is My Error code
     raise FactoryException('Unknown class <%s>' % name)
 kivy.factory.FactoryException: Unknown class <FilechooserIconView>


Here is My Python Code

import kivy
kivy.require('1.9.1')
from kivy.app import App
from kivy.uix.label import Label 
from kivy.properties import ListProperty
from kivy.graphics import Color, Rectangle 
from kivy.uix.floatlayout import FloatLayout 
from kivy.uix.boxlayout import BoxLayout 
from kivy.uix.button import Button 
from kivy.uix.widget import Widget 
from kivy.uix.textinput import TextInput 
from kivy.uix.camera import Camera 
from kivy.core.audio import SoundLoader
from kivy.uix.popup import Popup 
from kivy.lang import Builder

import os

#kv file
kv = '''
#:import Factory kivy.factory.Factory

BoxLayout:
    orientation: "vertical"
    Upper_bar:
        size_hint: (1, 0.1)

    Label:
        text: "Select Mode"
        size_hint: 1, .9
        font_size: 50
    BoxLayout:
        padding: 200
        Button:
            text: "Object"
            size_hint: .5, .0
            font_size: 50
            on_press: Factory.ObjectPop().open()

        Button:
            text: "Street"
            size_hint: .5, .0
            font_size: 50
            on_press: app.button_click_callback2(self) #Button callback

<Upper_bar>:
    BoxLayout:
    Button:
        size_hint: (0.3, 1)
        text: 'INFORMATION'
        on_press: Factory.InformationPop().open()

#Information Popup
<InformationPop@Popup>:
    size_hint: 0.5, 0.5
    title: 'INFORMATION'
    auto_dismiss: False #close를 눌러야 종료
    BoxLayout:
        orientation: 'vertical'
        Label:
            text:
                """AIObjectCameraApp
                Name: 
                Student Number: 
                E-mail:  """
        Button:
            text:
                'Close'
            on_press:
                root.dismiss()
            size_hint_y: None
            height: '40dp'

#Object Popup
<ObjectPop@Popup>:
    title: 'Select Picture'
    auto_dismiss: False
    size_hint: (0.9, 0.9)

    BoxLayout:
        size: root.size
        pos: root.pos
        orientation: 'vertical'
        FilechooserIconView:
            id: Filechooser

        BoxLayout:
            size_hint_y: None
            height: 30
            Button:
                text: 'Select'
                on_release:
                    app.Save_path = filechooser.path
                    root.dismiss()

            Label:


            Button:
                text: 'Cancel'
                on_release: root.dismiss()
'''
class Upper_bar(BoxLayout): 
    pass 

class ObjectPop(Popup):
    def __init__(self, **kwargs):
        super(ObjectPop, self).__init__(**kwargs)
        self.ids['filechooser'].path = os.getcwd()

class AIObjectCameraApp(App): 
    save_path = os.getcwd()

    pass

    def button_click_callback2(self, instance): #Callback print2
        print('You Select %s' % instance.text)

    def build(self): 
        return Builder.load_string(kv) #kv Builder(pass)

if __name__ == '__main__':
    AIObjectCameraApp().run() 


Elliot Garbus

unread,
Apr 18, 2020, 2:11:06 PM4/18/20
to kivy-...@googlegroups.com

FileChooserIconView

Not:

FilechooserIconView

 

See highlight below.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/73ea06f4-13a3-4e3c-8de3-8cac6fdfe37e%40googlegroups.com.

 

뿌야

unread,
Apr 18, 2020, 2:38:14 PM4/18/20
to Kivy users support
Thank you your comment. But now Another error occurs.
  self.ids['fileChooser'].path = os.getcwd()
 KeyError: 'fileChooser'

2020년 4월 19일 일요일 오전 3시 11분 6초 UTC+9, Elliot Garbus 님의 말:

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.

Elliot Garbus

unread,
Apr 18, 2020, 2:46:09 PM4/18/20
to kivy-...@googlegroups.com
FileChooserIconView:
    id: filechooser

 

Not id: Filechooser

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/97eceefc-aa54-495e-89ac-88a25cba75bd%40googlegroups.com.

 

뿌야

unread,
Apr 18, 2020, 2:46:43 PM4/18/20
to Kivy users support
Oh. I solved this problem. Thank you sir.


2020년 4월 19일 일요일 오전 3시 38분 14초 UTC+9, 뿌야 님의 말:
Reply all
Reply to author
Forward
0 new messages