Сбой предварительного просмотра компоновки Jetpack с помощью hiltViewModel<>()Android

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Сбой предварительного просмотра компоновки Jetpack с помощью hiltViewModel<>()

Сообщение Anonymous »

Я использую Compose версии 1.1.0-beta03 и hilt-navigation-compose:1.0.0-beta01.
Это мой составной код:

Код: Выделить всё

fun EngagementBotChart(modifier: Modifier = Modifier) {
val newHomeViewModel = hiltViewModel()
AndroidView(
modifier = modifier.fillMaxSize(),
factory = { context ->

},
update = { view ->

}
)
}
он ​​работает нормально, когда я создаю проект, но вот что происходит при предварительном просмотре композиции:

Код: Выделить всё

java.lang.NoSuchMethodException:  i r . i n b o . a p p . h o m e . v i e w m o d e l . H o m e V i e w M o d e l . & l t ; i n i t & g t ; ( ) < b r   / >         a t   j a v a . b a s e / j a v a . l a n g . C l a s s . g e t C o n s t r u c t o r 0 ( C l a s s . j a v a : 3 3 4 9 ) < b r   / >         a t   j a v a . b a s e / j a v a . l a n g . C l a s s . n e w I n s t a n c e ( C l a s s . j a v a : 5 5 6 ) < b r   / >         a t   a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r $ N e w I n s t a n c e F a c t o r y . c r e a t e ( V i e w M o d e l P r o v i d e r . j a v a : 2 1 9 ) < b r   / >         a t   a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r . g e t ( V i e w M o d e l P r o v i d e r . j a v a : 1 8 7 ) < b r   / >         a t   a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r . g e t ( V i e w M o d e l P r o v i d e r . j a v a : 1 5 0 ) < b r   / >         a t   a n d r o i d x . l i f e c y c l e . v i e w m o d e l . c o m p o s e . V i e w M o d e l K t . g e t ( V i e w M o d e l . k t : 8 7 ) < b r   / >         a t   a n d r o i d x . l i f e c y c l e . v i e w m o d e l . c o m p o s e . V i e w M o d e l K t . v i e w M o d e l ( V i e w M o d e l . k t : 7 2 ) < b r   / >         a t   i r . i n b o . a p p . h o m e . u i . H o m e C o m p o n e n t s K t . E n g a g e m e n t B o t C h a r t ( H o m e C o m p o n e n t s . k t : 2 8 1 ) < b r   / >         a t   i r . i n b o . a p p . h o m e . u i . C o m p o s a b l e S i n g l e t o n s $ H o m e C o m p o n e n t s K t $ l a m b d a - 1 $ 1 $ 1 $ 4 $ i n v o k e $ $ i n l i n e d $ C o n s t r a i n t L a y o u t $ 2 . i n v o k e ( C o n s t r a i n t L a y o u t . k t : 2 4 2 4 ) < b r   / >         a t   i r . i n b o . a p p . h o m e . u i . C o m p o s a b l e S i n g l e t o n s $ H o m e C o m p o n e n t s K t $ l a m b d a - 1 $ 1 $ 1 $ 4 $ i n v o k e $ $ i n l i n e d $ C o n s t r a i n t L a y o u t $ 2 . i n v o k e ( C o n s t r a i n t L a y o u t . k t : 1 0 1 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 0 7 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 4 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . l a y o u t . L a y o u t K t . M u l t i M e a s u r e L a y o u t ( L a y o u t . k t : 5 6 2 ) < b r   / >         a t   i r . i n b o . a p p . h o m e . u i . C o m p o s a b l e S i n g l e t o n s $ H o m e C o m p o n e n t s K t $ l a m b d a - 1 $ 1 $ 1 $ 4 . i n v o k e ( H o m e C o m p o n e n t s . k t : 2 5 5 ) < b r   / >         a t   i r . i n b o . a p p . h o m e . u i . C o m p o s a b l e S i n g l e t o n s $ H o m e C o m p o n e n t s K t $ l a m b d a - 1 $ 1 $ 1 $ 4 . i n v o k e ( H o m e C o m p o n e n t s . k t : 8 6 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 1 6 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 4 ) < b r   / >         a t   i r . i n b o . a p p . h o m e . u i . H o m e C o m p o n e n t s K t . H o m e B o x C o m p o n e n t ( H o m e C o m p o n e n t s . k t : 2 6 7 ) < b r   / >         a t   i r . i n b o . a p p . h o m e . u i . C o m p o s a b l e S i n g l e t o n s $ H o m e C o m p o n e n t s K t $ l a m b d a - 1 $ 1 $ i n v o k e $ $ i n l i n e d $ C o n s t r a i n t L a y o u t $ 2 . i n v o k e ( C o n s t r a i n t L a y o u t . k t : 2 4 1 3 ) < b r   / >         a t   i r . i n b o . a p p . h o m e . u i . C o m p o s a b l e S i n g l e t o n s $ H o m e C o m p o n e n t s K t $ l a m b d a - 1 $ 1 $ i n v o k e $ $ i n l i n e d $ C o n s t r a i n t L a y o u t $ 2 . i n v o k e ( C o n s t r a i n t L a y o u t . k t : 1 0 1 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 0 7 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 4 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . l a y o u t . L a y o u t K t . M u l t i M e a s u r e L a y o u t ( L a y o u t . k t : 5 6 2 ) < b r   / >         a t   i r . i n b o . a p p . h o m e . u i . C o m p o s a b l e S i n g l e t o n s $ H o m e C o m p o n e n t s K t $ l a m b d a - 1 $ 1 . i n v o k e ( H o m e C o m p o n e n t s . k t : 2 5 5 ) < b r   / >         a t   i r . i n b o . a p p . h o m e . u i . C o m p o s a b l e S i n g l e t o n s $ H o m e C o m p o n e n t s K t $ l a m b d a - 1 $ 1 . i n v o k e ( H o m e C o m p o n e n t s . k t : 3 4 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 0 7 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 4 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . m a t e r i a l . M a t e r i a l T h e m e _ a n d r o i d K t . P l a t f o r m M a t e r i a l T h e m e ( M a t e r i a l T h e m e . a n d r o i d . k t : 2 3 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . m a t e r i a l . M a t e r i a l T h e m e K t $ M a t e r i a l T h e m e $ 1 $ 1 . i n v o k e ( M a t e r i a l T h e m e . k t : 8 2 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . m a t e r i a l . M a t e r i a l T h e m e K t $ M a t e r i a l T h e m e $ 1 $ 1 . i n v o k e ( M a t e r i a l T h e m e . k t : 8 1 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 0 7 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 4 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . C o m p o s i t i o n L o c a l K t . C o m p o s i t i o n L o c a l P r o v i d e r ( C o m p o s i t i o n L o c a l . k t : 2 2 8 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . m a t e r i a l . T e x t K t . P r o v i d e T e x t S t y l e ( T e x t . k t : 2 6 5 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . m a t e r i a l . M a t e r i a l T h e m e K t $ M a t e r i a l T h e m e $ 1 . i n v o k e ( M a t e r i a l T h e m e . k t : 8 1 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . m a t e r i a l . M a t e r i a l T h e m e K t $ M a t e r i a l T h e m e $ 1 . i n v o k e ( M a t e r i a l T h e m e . k t : 8 0 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 0 7 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 4 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . C o m p o s i t i o n L o c a l K t . C o m p o s i t i o n L o c a l P r o v i d e r ( C o m p o s i t i o n L o c a l . k t : 2 2 8 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . m a t e r i a l . M a t e r i a l T h e m e K t . M a t e r i a l T h e m e ( M a t e r i a l T h e m e . k t : 7 2 ) < b r   / >         a t   i r . i n b o . a p p . t h e m e . T h e m e K t . I n b o T h e m e ( T h e m e . k t : 5 4 ) < b r   / >         a t   i r . i n b o . a p p . h o m e . u i . H o m e C o m p o n e n t s K t . H o m e G r i d ( H o m e C o m p o n e n t s . k t : 3 4 ) < b r   / >         a t   i r . i n b o . a p p . h o m e . u i . H o m e C o m p o n e n t s K t . H o m e G r i d P r e v i e w ( H o m e C o m p o n e n t s . k t : 2 3 2 ) < b r   / >         a t   j a v a . b a s e / j d k . i n t e r n a l . r e f l e c t . N a t i v e M e t h o d A c c e s s o r I m p l . i n v o k e 0 ( N a t i v e   M e t h o d ) < b r   / >         a t   j a v a . b a s e / j d k . i n t e r n a l . r e f l e c t . N a t i v e M e t h o d A c c e s s o r I m p l . i n v o k e ( N a t i v e M e t h o d A c c e s s o r I m p l . j a v a : 6 2 ) < b r   / >         a t   j a v a . b a s e / j d k . i n t e r n a l . r e f l e c t . D e l e g a t i n g M e t h o d A c c e s s o r I m p l . i n v o k e ( D e l e g a t i n g M e t h o d A c c e s s o r I m p l . j a v a : 4 3 ) < b r   / >         a t   j a v a . b a s e / j a v a . l a n g . r e f l e c t . M e t h o d . i n v o k e ( M e t h o d . j a v a : 5 6 6 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . t o o l i n g . C o m m o n P r e v i e w U t i l s . i n v o k e C o m p o s a b l e M e t h o d ( C o m m o n P r e v i e w U t i l s . k t : 1 5 0 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . t o o l i n g . C o m m o n P r e v i e w U t i l s . i n v o k e C o m p o s a b l e V i a R e f l e c t i o n $ u i _ t o o l i n g _ r e l e a s e ( C o m m o n P r e v i e w U t i l s . k t : 1 8 9 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . t o o l i n g . C o m p o s e V i e w A d a p t e r $ i n i t $ 3 $ 1 $ c o m p o s a b l e $ 1 . i n v o k e ( C o m p o s e V i e w A d a p t e r . k t : 5 7 8 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . t o o l i n g . C o m p o s e V i e w A d a p t e r $ i n i t $ 3 $ 1 $ c o m p o s a b l e $ 1 . i n v o k e ( C o m p o s e V i e w A d a p t e r . k t : 5 7 6 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . t o o l i n g . C o m p o s e V i e w A d a p t e r $ i n i t $ 3 $ 1 . i n v o k e ( C o m p o s e V i e w A d a p t e r . k t : 6 1 5 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . t o o l i n g . C o m p o s e V i e w A d a p t e r $ i n i t $ 3 $ 1 . i n v o k e ( C o m p o s e V i e w A d a p t e r . k t : 5 7 1 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 0 7 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 4 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . C o m p o s i t i o n L o c a l K t . C o m p o s i t i o n L o c a l P r o v i d e r ( C o m p o s i t i o n L o c a l . k t : 2 2 8 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . t o o l i n g . I n s p e c t a b l e K t . I n s p e c t a b l e ( I n s p e c t a b l e . k t : 6 1 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . t o o l i n g . C o m p o s e V i e w A d a p t e r $ W r a p P r e v i e w $ 1 . i n v o k e ( C o m p o s e V i e w A d a p t e r . k t : 5 2 0 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . t o o l i n g . C o m p o s e V i e w A d a p t e r $ W r a p P r e v i e w $ 1 . i n v o k e ( C o m p o s e V i e w A d a p t e r . k t : 5 1 9 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 0 7 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 4 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . C o m p o s i t i o n L o c a l K t . C o m p o s i t i o n L o c a l P r o v i d e r ( C o m p o s i t i o n L o c a l . k t : 2 2 8 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . t o o l i n g . C o m p o s e V i e w A d a p t e r . W r a p P r e v i e w ( C o m p o s e V i e w A d a p t e r . k t : 5 1 5 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . t o o l i n g . C o m p o s e V i e w A d a p t e r . a c c e s s $ W r a p P r e v i e w ( C o m p o s e V i e w A d a p t e r . k t : 1 2 1 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . t o o l i n g . C o m p o s e V i e w A d a p t e r $ i n i t $ 3 . i n v o k e ( C o m p o s e V i e w A d a p t e r . k t : 5 7 1 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . t o o l i n g . C o m p o s e V i e w A d a p t e r $ i n i t $ 3 . i n v o k e ( C o m p o s e V i e w A d a p t e r . k t : 5 6 8 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 0 7 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 4 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . p l a t f o r m . C o m p o s e V i e w . C o n t e n t ( C o m p o s e V i e w . a n d r o i d . k t : 4 1 0 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . p l a t f o r m . A b s t r a c t C o m p o s e V i e w $ e n s u r e C o m p o s i t i o n C r e a t e d $ 1 . i n v o k e ( C o m p o s e V i e w . a n d r o i d . k t : 2 5 2 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . p l a t f o r m . A b s t r a c t C o m p o s e V i e w $ e n s u r e C o m p o s i t i o n C r e a t e d $ 1 . i n v o k e ( C o m p o s e V i e w . a n d r o i d . k t : 2 5 1 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 0 7 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 4 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . r u n t i m e . C o m p o s i t i o n L o c a l K t . C o m p o s i t i o n L o c a l P r o v i d e r ( C o m p o s i t i o n L o c a l . k t : 2 2 8 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . p l a t f o r m . C o m p o s i t i o n L o c a l s K t . P r o v i d e C o m m o n C o m p o s i t i o n L o c a l s ( C o m p o s i t i o n L o c a l s . k t : 1 6 6 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . p l a t f o r m . A n d r o i d C o m p o s i t i o n L o c a l s _ a n d r o i d K t $ P r o v i d e A n d r o i d C o m p o s i t i o n L o c a l s $ 3 . i n v o k e ( A n d r o i d C o m p o s i t i o n L o c a l s . a n d r o i d . k t : 1 2 3 ) < b r   / >         a t   a n d r o i d x . c o m p o s e . u i . p l a t f o r m . A n d r o i d C o m p o s i t i o n L o c a l s _ a n d r o i d K t $ P r o v i d e A n d r oidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:122)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.ProvideAndroidCompositionLocals(AndroidCompositionLocals.android.kt:114)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:157)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:156)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:156)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:140)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.ComposerKt.invokeComposable(Composer.kt:3337)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:2582)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:2571)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:234)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:2571)
at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:2522)
at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:478)
at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:748)
at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:433)
at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:140)
at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:897)
at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:131)
at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:182)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:354)
at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:196)
at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:138)
at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:984)
at android.view.View.dispatchAttachedToWindow(View.java:20479)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3489)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3496)
at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:44)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:360)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:431)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:141)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:714)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$7(RenderTask.java:870)
at com.android.tools.idea.rendering.RenderExecutor$runAsyncActionWithTimeout$2.run(RenderExecutor.kt:187)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
когда я удаляю код hiltviewModel, все работает нормально!
Я пробую это с разными версиями Compose и не могу решить эту проблему!

Подробнее здесь: https://stackoverflow.com/questions/700 ... tviewmodel
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»