Explore all Navigation open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Navigation

react-navigation

@react-navigation/native-stack@6.6.2

layer

3.5.1

urh

hackrf

release 2021.03.1

gnuradio

Release v3.10.2.0

Popular Libraries in Navigation

react-navigation

by react-navigation doticontypescriptdoticon

star image 21082 doticon

Routing and navigation for your React Native apps

ImmersionBar

by gyf-dev doticonjavadoticon

star image 9822 doticonApache-2.0

android 4.4以上沉浸式状态栏和沉浸式导航栏管理,适配横竖屏切换、刘海屏、软键盘弹出等问题,可以修改状态栏字体颜色和导航栏图标颜色,以及不可修改字体颜色手机的适配,适用于Activity、Fragment、DialogFragment、Dialog,PopupWindow,一句代码轻松实现,以及对bar的其他设置,详见README。简书请参考:http://www.jianshu.com/p/2a884e211a62

layer

by sentsin doticonjavascriptdoticon

star image 8044 doticonMIT

丰富多样的 Web 弹出层组件,可轻松实现 Alert/Confirm/Prompt/ 普通提示/页面区块/iframe/tips等等几乎所有的弹出交互。目前已成为最多人使用的弹层解决方案

slideout

by Mango doticonjavascriptdoticon

star image 7973 doticonMIT

A touch slideout navigation menu for your mobile web apps.

urh

by jopohl doticonpythondoticon

star image 7953 doticonGPL-3.0

Universal Radio Hacker: Investigate Wireless Protocols Like A Boss

compass

by Compass doticoncssdoticon

star image 6849 doticonNOASSERTION

Compass is no longer actively maintained. Compass is a Stylesheet Authoring Environment that makes your website design simpler to implement and easier to maintain.

system-bus-radio

by fulldecent doticoncdoticon

star image 5671 doticonMIT

Transmits AM radio on computers without radio transmitting hardware.

hackrf

by mossmann doticoncdoticon

star image 4093 doticonGPL-2.0

low cost software radio platform

ahbottomnavigation

by aurelhubert doticonjavadoticon

star image 3872 doticon

A library to reproduce the behavior of the Bottom Navigation guidelines from Material Design.

Trending New libraries in Navigation

AnimatedBottomBar

by Droppers doticonkotlindoticon

star image 945 doticonMIT

A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.

onenav

by helloxz doticonjavascriptdoticon

star image 714 doticonApache-2.0

使用PHP开发的简约导航/书签管理系统。

edgetx

by EdgeTX doticonc++doticon

star image 572 doticonGPL-2.0

EdgeTX is the cutting edge open source firmware for your R/C radio

voyager

by adrielcafe doticonkotlindoticon

star image 447 doticonMIT

🛸 A pragmatic navigation library for Jetpack Compose

bluezone-app

by BluezoneGlobal doticonjavascriptdoticon

star image 372 doticonNOASSERTION

Bluezone - Bảo vệ mình, bảo vệ cộng đồng

gr-tempest

by git-artes doticonc++doticon

star image 360 doticonNOASSERTION

An implementation of TEMPEST en GNU Radio

OverlappingPanels

by discord doticonkotlindoticon

star image 296 doticonApache-2.0

Overlapping Panels is a gestures-driven navigation UI library for Android

jetpack-navigation-ftue-sample

by Zhuinden doticonkotlindoticon

star image 225 doticonApache-2.0

[DEMO] Sample code to display "First-Time User Experience" in a Single-Activity app using Jetpack-Navigation, NavGraphs, Dagger, SavedStateHandle, Hilt, and EventEmitter - based on the FTUE example code in simple-stack-tutorials, but originally described by Google.

OpenRTX

by OpenRTX doticoncdoticon

star image 212 doticonGPL-3.0

Modular Open Source Radio Firmware

Top Authors in Navigation

1

CodyHouse

13 Libraries

star icon760

2

react-navigation

10 Libraries

star icon22901

3

hardwario

8 Libraries

star icon35

4

codingmarket07

8 Libraries

star icon66

5

Zhuinden

7 Libraries

star icon1489

6

drmpeg

7 Libraries

star icon216

7

argilo

6 Libraries

star icon279

8

osmocom

6 Libraries

star icon791

9

handiko

6 Libraries

star icon27

10

bastibl

6 Libraries

star icon152

1

13 Libraries

star icon760

2

10 Libraries

star icon22901

3

8 Libraries

star icon35

4

8 Libraries

star icon66

5

7 Libraries

star icon1489

6

7 Libraries

star icon216

7

6 Libraries

star icon279

8

6 Libraries

star icon791

9

6 Libraries

star icon27

10

6 Libraries

star icon152

Trending Kits in Navigation

No Trending Kits are available at this moment for Navigation

Trending Discussions on Navigation

Jetpack compose BottomNavigation - java.lang.IllegalStateException: Already attached to lifecycleOwner

Remove Warning : [react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system

android:exported added but still getting error Apps targeting Android 12 and higher are required to specify an explicit value for android:exported

Tab & Navigation Bar changes after upgrading to XCode 13 (& iOS 15)

Unable to load class AndroidComponentsExtension after upgrading the Android Gradle Plugin 7.1

android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify

react native typescript 'string' is not assignable to parameter of type 'never.' in useNavigation

Could not resolve com.google.guava:guava:30.1-jre - Gradle project sync failed. Basic functionality will not work properly - in kotlin project

Error: Requiring module "node_modules\react-native-reanimated\src\Animated.js",

How to resolve React native navigation Error while installing version 6

QUESTION

Jetpack compose BottomNavigation - java.lang.IllegalStateException: Already attached to lifecycleOwner

Asked 2022-Apr-04 at 05:49

When I double click the same item or if I go to each composable screen very quickly i receive an error, How do I solve this problem? I tried changing few things but I just can't solve it and I can't find any resources to fix this problem.

Bottom Navigation implementation

1@Composable
2fun BottomNav(
3    navController: NavController,
4    bottomNavState: MutableState<Boolean>,
5) {
6
7    val navItems = listOf(
8        Screen.HomeScreen,
9        Screen.BookmarkScreen,
10        Screen.MyRecipesScreen,
11        Screen.FavouriteScreen
12    )
13
14    AnimatedVisibility(
15        visible = bottomNavState.value,
16        enter = slideInVertically(initialOffsetY = { it }),
17        exit = slideOutVertically(targetOffsetY = { it }),
18        content = {
19            BottomNavigation(
20                backgroundColor = Color.White,
21                elevation = 12.dp
22            ) {
23
24                val bottomNavBackStackEntry by navController.currentBackStackEntryAsState()
25                val currentDestination = bottomNavBackStackEntry?.destination
26
27                navItems.forEach { item ->
28
29                    BottomNavigationItem(
30                        icon = {
31                            Icon(painter = painterResource(id = item.icon), contentDescription = "")
32                        },
33                        label = {
34                            Text(text = item.title)
35                        },
36                        selected = currentDestination?.hierarchy?.any { it.route == item.route } == true,
37                        onClick = {
38
39                            navController.navigate(item.route) {
40
41
42                                popUpTo(navController.graph.findStartDestination().id) {
43                                    saveState = true
44                                }
45                                launchSingleTop = true
46                                restoreState = true
47
48
49                            }
50
51                        },
52                        selectedContentColor = Color.Black,
53                        unselectedContentColor = Color.LightGray,
54                        alwaysShowLabel = true,
55                    )
56
57                }
58
59            }
60        }
61    )
62
63}
64

Error Received

1@Composable
2fun BottomNav(
3    navController: NavController,
4    bottomNavState: MutableState<Boolean>,
5) {
6
7    val navItems = listOf(
8        Screen.HomeScreen,
9        Screen.BookmarkScreen,
10        Screen.MyRecipesScreen,
11        Screen.FavouriteScreen
12    )
13
14    AnimatedVisibility(
15        visible = bottomNavState.value,
16        enter = slideInVertically(initialOffsetY = { it }),
17        exit = slideOutVertically(targetOffsetY = { it }),
18        content = {
19            BottomNavigation(
20                backgroundColor = Color.White,
21                elevation = 12.dp
22            ) {
23
24                val bottomNavBackStackEntry by navController.currentBackStackEntryAsState()
25                val currentDestination = bottomNavBackStackEntry?.destination
26
27                navItems.forEach { item ->
28
29                    BottomNavigationItem(
30                        icon = {
31                            Icon(painter = painterResource(id = item.icon), contentDescription = "")
32                        },
33                        label = {
34                            Text(text = item.title)
35                        },
36                        selected = currentDestination?.hierarchy?.any { it.route == item.route } == true,
37                        onClick = {
38
39                            navController.navigate(item.route) {
40
41
42                                popUpTo(navController.graph.findStartDestination().id) {
43                                    saveState = true
44                                }
45                                launchSingleTop = true
46                                restoreState = true
47
48
49                            }
50
51                        },
52                        selectedContentColor = Color.Black,
53                        unselectedContentColor = Color.LightGray,
54                        alwaysShowLabel = true,
55                    )
56
57                }
58
59            }
60        }
61    )
62
63}
642022-03-05 11:50:10.183 8460-8460/com.im.cookgaloreapp E/AndroidRuntime: FATAL EXCEPTION: main
65    Process: com.im.cookgaloreapp, PID: 8460
66    java.lang.IllegalStateException: Already attached to lifecycleOwner
67        at androidx.lifecycle.SavedStateHandleController.attachToLifecycle(SavedStateHandleController.java:38)
68        at androidx.lifecycle.SavedStateHandleAttacher.onRecreated(SavedStateHandleSupport.kt:139)
69        at androidx.savedstate.Recreator.reflectiveNew(Recreator.java:90)
70        at androidx.savedstate.Recreator.onStateChanged(Recreator.java:62)
71        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:360)
72        at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:271)
73        at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:313)
74        at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:151)
75        at androidx.lifecycle.LifecycleRegistry.setCurrentState(LifecycleRegistry.java:121)
76        at androidx.navigation.NavBackStackEntry.updateState(NavBackStackEntry.kt:188)
77        at androidx.navigation.NavBackStackEntry.setMaxLifecycle(NavBackStackEntry.kt:154)
78        at androidx.navigation.NavController.updateBackStackLifecycle$navigation_runtime_release(NavController.kt:987)
79        at androidx.navigation.NavController.dispatchOnDestinationChanged(NavController.kt:892)
80        at androidx.navigation.NavController.navigate(NavController.kt:1726)
81        at androidx.navigation.NavController.navigate(NavController.kt:1658)
82        at androidx.navigation.NavController.navigate(NavController.kt:1980)
83        at androidx.navigation.NavController.navigate$default(NavController.kt:1975)
84        at androidx.navigation.NavController.navigate(NavController.kt:1961)
85        at com.im.cookgaloreapp.ui.components.BottomNavigationKt$BottomNav$3$1$1$2.invoke(BottomNavigation.kt:67)
86        at com.im.cookgaloreapp.ui.components.BottomNavigationKt$BottomNav$3$1$1$2.invoke(BottomNavigation.kt:57)
87        at androidx.compose.foundation.ClickableKt$clickable$4$gesture$1$2.invoke-k-4lQ0M(Clickable.kt:153)
88        at androidx.compose.foundation.ClickableKt$clickable$4$gesture$1$2.invoke(Clickable.kt:142)
89        at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1$1.invokeSuspend(TapGestureDetector.kt:223)
90        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
91        at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
92        at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
93        at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
94        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
95        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
96        at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
97        at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:511)
98        at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:406)
99        at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:419)
100        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:310)
101        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
102        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
103        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
104        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
105        at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:179)
106        at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:98)
107        at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:80)
1082022-03-05 11:50:10.184 8460-8460/com.im.cookgaloreapp E/AndroidRuntime:     at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1205)
109        at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1155)
110        at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1095)
111        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118)
112        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2799)
113        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118)
114        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2799)
115        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118)
116        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2799)
117        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118)
118        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2799)
119        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:488)
120        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1871)
121        at android.app.Activity.dispatchTouchEvent(Activity.java:4125)
122        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:446)
123        at android.view.View.dispatchPointerEvent(View.java:14568)
124        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6016)
125        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5819)
126        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5310)
127        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5367)
128        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5333)
129        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5485)
130        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5341)
131        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5542)
132        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5314)
133        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5367)
134        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5333)
135        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5341)
136        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5314)
137        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8080)
138        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8031)
139        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7992)
140        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8203)
141        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:220)
142        at android.os.MessageQueue.nativePollOnce(Native Method)
143        at android.os.MessageQueue.next(MessageQueue.java:335)
144        at android.os.Looper.loop(Looper.java:183)
145        at android.app.ActivityThread.main(ActivityThread.java:7656)
146        at java.lang.reflect.Method.invoke(Native Method)
147        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
148        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
149

ANSWER

Answered 2022-Mar-06 at 09:39

I'm facing the same problem using the latest compose navigation dependency 2.5.0-alpha03.

I don't know why it's happening.

Philip Dukhov is right, you should report this issue.

Here is a dirty workaround :

1@Composable
2fun BottomNav(
3    navController: NavController,
4    bottomNavState: MutableState<Boolean>,
5) {
6
7    val navItems = listOf(
8        Screen.HomeScreen,
9        Screen.BookmarkScreen,
10        Screen.MyRecipesScreen,
11        Screen.FavouriteScreen
12    )
13
14    AnimatedVisibility(
15        visible = bottomNavState.value,
16        enter = slideInVertically(initialOffsetY = { it }),
17        exit = slideOutVertically(targetOffsetY = { it }),
18        content = {
19            BottomNavigation(
20                backgroundColor = Color.White,
21                elevation = 12.dp
22            ) {
23
24                val bottomNavBackStackEntry by navController.currentBackStackEntryAsState()
25                val currentDestination = bottomNavBackStackEntry?.destination
26
27                navItems.forEach { item ->
28
29                    BottomNavigationItem(
30                        icon = {
31                            Icon(painter = painterResource(id = item.icon), contentDescription = "")
32                        },
33                        label = {
34                            Text(text = item.title)
35                        },
36                        selected = currentDestination?.hierarchy?.any { it.route == item.route } == true,
37                        onClick = {
38
39                            navController.navigate(item.route) {
40
41
42                                popUpTo(navController.graph.findStartDestination().id) {
43                                    saveState = true
44                                }
45                                launchSingleTop = true
46                                restoreState = true
47
48
49                            }
50
51                        },
52                        selectedContentColor = Color.Black,
53                        unselectedContentColor = Color.LightGray,
54                        alwaysShowLabel = true,
55                    )
56
57                }
58
59            }
60        }
61    )
62
63}
642022-03-05 11:50:10.183 8460-8460/com.im.cookgaloreapp E/AndroidRuntime: FATAL EXCEPTION: main
65    Process: com.im.cookgaloreapp, PID: 8460
66    java.lang.IllegalStateException: Already attached to lifecycleOwner
67        at androidx.lifecycle.SavedStateHandleController.attachToLifecycle(SavedStateHandleController.java:38)
68        at androidx.lifecycle.SavedStateHandleAttacher.onRecreated(SavedStateHandleSupport.kt:139)
69        at androidx.savedstate.Recreator.reflectiveNew(Recreator.java:90)
70        at androidx.savedstate.Recreator.onStateChanged(Recreator.java:62)
71        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:360)
72        at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:271)
73        at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:313)
74        at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:151)
75        at androidx.lifecycle.LifecycleRegistry.setCurrentState(LifecycleRegistry.java:121)
76        at androidx.navigation.NavBackStackEntry.updateState(NavBackStackEntry.kt:188)
77        at androidx.navigation.NavBackStackEntry.setMaxLifecycle(NavBackStackEntry.kt:154)
78        at androidx.navigation.NavController.updateBackStackLifecycle$navigation_runtime_release(NavController.kt:987)
79        at androidx.navigation.NavController.dispatchOnDestinationChanged(NavController.kt:892)
80        at androidx.navigation.NavController.navigate(NavController.kt:1726)
81        at androidx.navigation.NavController.navigate(NavController.kt:1658)
82        at androidx.navigation.NavController.navigate(NavController.kt:1980)
83        at androidx.navigation.NavController.navigate$default(NavController.kt:1975)
84        at androidx.navigation.NavController.navigate(NavController.kt:1961)
85        at com.im.cookgaloreapp.ui.components.BottomNavigationKt$BottomNav$3$1$1$2.invoke(BottomNavigation.kt:67)
86        at com.im.cookgaloreapp.ui.components.BottomNavigationKt$BottomNav$3$1$1$2.invoke(BottomNavigation.kt:57)
87        at androidx.compose.foundation.ClickableKt$clickable$4$gesture$1$2.invoke-k-4lQ0M(Clickable.kt:153)
88        at androidx.compose.foundation.ClickableKt$clickable$4$gesture$1$2.invoke(Clickable.kt:142)
89        at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1$1.invokeSuspend(TapGestureDetector.kt:223)
90        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
91        at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
92        at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
93        at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
94        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
95        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
96        at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
97        at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:511)
98        at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:406)
99        at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:419)
100        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:310)
101        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
102        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
103        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
104        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
105        at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:179)
106        at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:98)
107        at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:80)
1082022-03-05 11:50:10.184 8460-8460/com.im.cookgaloreapp E/AndroidRuntime:     at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1205)
109        at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1155)
110        at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1095)
111        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118)
112        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2799)
113        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118)
114        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2799)
115        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118)
116        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2799)
117        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3118)
118        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2799)
119        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:488)
120        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1871)
121        at android.app.Activity.dispatchTouchEvent(Activity.java:4125)
122        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:446)
123        at android.view.View.dispatchPointerEvent(View.java:14568)
124        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6016)
125        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5819)
126        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5310)
127        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5367)
128        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5333)
129        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5485)
130        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5341)
131        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5542)
132        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5314)
133        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5367)
134        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5333)
135        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5341)
136        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5314)
137        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8080)
138        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8031)
139        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7992)
140        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8203)
141        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:220)
142        at android.os.MessageQueue.nativePollOnce(Native Method)
143        at android.os.MessageQueue.next(MessageQueue.java:335)
144        at android.os.Looper.loop(Looper.java:183)
145        at android.app.ActivityThread.main(ActivityThread.java:7656)
146        at java.lang.reflect.Method.invoke(Native Method)
147        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
148        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
149try {
150    // The navigation code that throw this exception
151} catch (e: IllegalStateException) {
152    if (e.message != "Already attached to lifecycleOwner") {
153        throw e
154    } else {
155        // You can log the exception if you want
156    }
157}
158

Source https://stackoverflow.com/questions/71361999

QUESTION

Remove Warning : [react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system

Asked 2022-Mar-26 at 18:47

I'm creating a project to learn React Native. I'm using typescript on this project. I added react-navigation : To make react-navigation working, I had to do :

1yarn add @react-navigation/native
2yarn add @react-navigation/stack
3yarn add react-native-screens react-native-safe-area-context
4yarn add react-native-reanimated react-native-gesture-handler
5

Unfortunately, I have this warning on my yarn start :

1yarn add @react-navigation/native
2yarn add @react-navigation/stack
3yarn add react-native-screens react-native-safe-area-context
4yarn add react-native-reanimated react-native-gesture-handler
5 WARN  RCTBridge required dispatch_sync to load RNGestureHandlerModule. This may lead to deadlocks
6 LOG  Running "TddReactNative" with {"rootTag":11,"initialProps":{}}
7 WARN  [react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system! 
8PanGestureHandler@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:137194:38
9PanGestureHandler@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:136501:34
10RCTView
11View
12AnimatedComponent@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:68816:38
13AnimatedComponentWrapper
14RCTView
15View
16Card@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:135767:36
17CardContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:135324:34
18RNSScreen
19AnimatedComponent@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:68816:38
20AnimatedComponentWrapper
21MaybeFreeze@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161553:23
22Screen@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161620:36
23MaybeScreen@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161373:24
24RNSScreenContainer
25ScreenContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161753:31
26MaybeScreenContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161344:23
27RCTView
28View
29Background@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:123808:21
30CardStack@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:133002:36
31RNCSafeAreaProvider
32SafeAreaProvider@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:131859:24
33SafeAreaProviderCompat@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:132694:24
34RCTView
35View
36GestureHandlerRootView
37StackView@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:122717:36
38StackNavigator@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:122563:32
39EnsureSingleNavigator@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:124954:24
40BaseNavigationContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:124463:28
41ThemeProvider@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:130618:21
42NavigationContainerInner@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:130478:26
43AppNavigator
44RCTView
45View
46RCTView
47View
48AppContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:76309:36
49TddReactNative(RootComponent)@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:83059:28
50

I tried to remove pods and reinstall them with :

1yarn add @react-navigation/native
2yarn add @react-navigation/stack
3yarn add react-native-screens react-native-safe-area-context
4yarn add react-native-reanimated react-native-gesture-handler
5 WARN  RCTBridge required dispatch_sync to load RNGestureHandlerModule. This may lead to deadlocks
6 LOG  Running "TddReactNative" with {"rootTag":11,"initialProps":{}}
7 WARN  [react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system! 
8PanGestureHandler@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:137194:38
9PanGestureHandler@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:136501:34
10RCTView
11View
12AnimatedComponent@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:68816:38
13AnimatedComponentWrapper
14RCTView
15View
16Card@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:135767:36
17CardContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:135324:34
18RNSScreen
19AnimatedComponent@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:68816:38
20AnimatedComponentWrapper
21MaybeFreeze@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161553:23
22Screen@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161620:36
23MaybeScreen@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161373:24
24RNSScreenContainer
25ScreenContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161753:31
26MaybeScreenContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161344:23
27RCTView
28View
29Background@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:123808:21
30CardStack@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:133002:36
31RNCSafeAreaProvider
32SafeAreaProvider@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:131859:24
33SafeAreaProviderCompat@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:132694:24
34RCTView
35View
36GestureHandlerRootView
37StackView@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:122717:36
38StackNavigator@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:122563:32
39EnsureSingleNavigator@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:124954:24
40BaseNavigationContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:124463:28
41ThemeProvider@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:130618:21
42NavigationContainerInner@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:130478:26
43AppNavigator
44RCTView
45View
46RCTView
47View
48AppContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:76309:36
49TddReactNative(RootComponent)@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:83059:28
50cd ios
51rm -rf Pods/
52pod install
53

After that, I relaunched the yarn start and the app with XCode.

Here is my versions of react-navigations and other dependencies :

1yarn add @react-navigation/native
2yarn add @react-navigation/stack
3yarn add react-native-screens react-native-safe-area-context
4yarn add react-native-reanimated react-native-gesture-handler
5 WARN  RCTBridge required dispatch_sync to load RNGestureHandlerModule. This may lead to deadlocks
6 LOG  Running "TddReactNative" with {"rootTag":11,"initialProps":{}}
7 WARN  [react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system! 
8PanGestureHandler@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:137194:38
9PanGestureHandler@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:136501:34
10RCTView
11View
12AnimatedComponent@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:68816:38
13AnimatedComponentWrapper
14RCTView
15View
16Card@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:135767:36
17CardContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:135324:34
18RNSScreen
19AnimatedComponent@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:68816:38
20AnimatedComponentWrapper
21MaybeFreeze@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161553:23
22Screen@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161620:36
23MaybeScreen@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161373:24
24RNSScreenContainer
25ScreenContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161753:31
26MaybeScreenContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161344:23
27RCTView
28View
29Background@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:123808:21
30CardStack@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:133002:36
31RNCSafeAreaProvider
32SafeAreaProvider@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:131859:24
33SafeAreaProviderCompat@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:132694:24
34RCTView
35View
36GestureHandlerRootView
37StackView@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:122717:36
38StackNavigator@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:122563:32
39EnsureSingleNavigator@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:124954:24
40BaseNavigationContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:124463:28
41ThemeProvider@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:130618:21
42NavigationContainerInner@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:130478:26
43AppNavigator
44RCTView
45View
46RCTView
47View
48AppContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:76309:36
49TddReactNative(RootComponent)@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:83059:28
50cd ios
51rm -rf Pods/
52pod install
53"dependencies": {
54    "@react-navigation/native": "^6.0.6",
55    "@react-navigation/stack": "^6.0.11",
56    "@types/styled-components": "^5.1.20",
57    "moment": "^2.29.1",
58    "react": "17.0.2",
59    "react-native": "0.66.4",
60    "react-native-gesture-handler": "^2.2.0",
61    "react-native-get-location": "^2.2.1",
62    "react-native-linear-gradient": "^2.5.6",
63    "react-native-reanimated": "^2.3.1",
64    "react-native-safe-area-context": "^3.3.2",
65    "react-native-screens": "^3.10.2",
66    "styled-components": "^5.3.3"
67  },
68

I'm testing the app on an Iphone 13. It's only a warning, but does someone know why this warning appears and how to remove it ?

ANSWER

Answered 2022-Feb-05 at 12:14

The new version, of react-native-gesture-handler send warning if you use an old API version, but also if one of your package/library use it.

To disable the warning, you can ignore logs.

in your app.js / app.tsx

1yarn add @react-navigation/native
2yarn add @react-navigation/stack
3yarn add react-native-screens react-native-safe-area-context
4yarn add react-native-reanimated react-native-gesture-handler
5 WARN  RCTBridge required dispatch_sync to load RNGestureHandlerModule. This may lead to deadlocks
6 LOG  Running "TddReactNative" with {"rootTag":11,"initialProps":{}}
7 WARN  [react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system! 
8PanGestureHandler@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:137194:38
9PanGestureHandler@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:136501:34
10RCTView
11View
12AnimatedComponent@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:68816:38
13AnimatedComponentWrapper
14RCTView
15View
16Card@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:135767:36
17CardContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:135324:34
18RNSScreen
19AnimatedComponent@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:68816:38
20AnimatedComponentWrapper
21MaybeFreeze@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161553:23
22Screen@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161620:36
23MaybeScreen@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161373:24
24RNSScreenContainer
25ScreenContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161753:31
26MaybeScreenContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:161344:23
27RCTView
28View
29Background@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:123808:21
30CardStack@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:133002:36
31RNCSafeAreaProvider
32SafeAreaProvider@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:131859:24
33SafeAreaProviderCompat@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:132694:24
34RCTView
35View
36GestureHandlerRootView
37StackView@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:122717:36
38StackNavigator@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:122563:32
39EnsureSingleNavigator@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:124954:24
40BaseNavigationContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:124463:28
41ThemeProvider@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:130618:21
42NavigationContainerInner@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:130478:26
43AppNavigator
44RCTView
45View
46RCTView
47View
48AppContainer@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:76309:36
49TddReactNative(RootComponent)@http://192.168.3.2:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.TddReactNative:83059:28
50cd ios
51rm -rf Pods/
52pod install
53"dependencies": {
54    "@react-navigation/native": "^6.0.6",
55    "@react-navigation/stack": "^6.0.11",
56    "@types/styled-components": "^5.1.20",
57    "moment": "^2.29.1",
58    "react": "17.0.2",
59    "react-native": "0.66.4",
60    "react-native-gesture-handler": "^2.2.0",
61    "react-native-get-location": "^2.2.1",
62    "react-native-linear-gradient": "^2.5.6",
63    "react-native-reanimated": "^2.3.1",
64    "react-native-safe-area-context": "^3.3.2",
65    "react-native-screens": "^3.10.2",
66    "styled-components": "^5.3.3"
67  },
68import { LogBox } from 'react-native';
69
70LogBox.ignoreLogs([
71  "[react-native-gesture-handler] Seems like you\'re using an old API with gesture components, check out new Gestures system!",
72]);
73

[enter link description here]Here you have the explanation1

Source https://stackoverflow.com/questions/70743721

QUESTION

android:exported added but still getting error Apps targeting Android 12 and higher are required to specify an explicit value for android:exported

Asked 2022-Mar-24 at 15:30

I have added android:exported="true" to my only activity in manifest but still getting below error after updating compile sdk and target sdk version to 31.I also tried rebuilding the project , invalidating cache and restart but that didn't helped

Error- Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

AndroidManifest File
1<?xml version="1.0" encoding="utf-8"?>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3    package="com.xyz.abc">
4
5    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
6    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
7
8    <application
9        android:name=".framework.presentation.BaseApplication"
10        android:allowBackup="true"
11        android:icon="@mipmap/ic_launcher"
12        android:label="@string/app_name"
13        android:roundIcon="@mipmap/ic_launcher_round"
14        android:supportsRtl="true"
15        android:theme="@style/AppTheme">
16        <activity android:name="com.xyz.presentation.MainActivity"
17            android:exported="true">
18            <intent-filter>
19                <action android:name="android.intent.action.MAIN" />
20
21                <category android:name="android.intent.category.LAUNCHER" />
22            </intent-filter>
23        </activity>
24    </application>
25
26</manifest>
27
Merged manifest error

Other Manifest Files (Included in merge, but did not contribute any elements) firebase-installations:17.0.0 manifest, versionedparcelable:1.1.1 manifest, runtime:1.0.1 manifest, test:core:1.2.0 manifest, loader:1.0.0 manifest, facebook-share:11.1.0 manifest, leakcanary:leaksentry:2.0-alpha-3 manifest, material-dialogs:input:3.2.1 manifest, material-icons-extended:1.0.0 manifest, play-services-stats:17.0.0 manifest, interpolator:1.0.0 manifest, activity-compose:1.3.1 manifest, material-ripple:1.0.0 manifest, foundation:1.0.0 manifest, asynclayoutinflater:1.0.0 manifest, savedstate-ktx:1.1.0 manifest, navigation-dynamic-features-fragment:2.3.5 manifest, firebase-ui-auth:7.2.0 manifest, animation:1.0.1 manifest, animation-core:1.0.1 manifest, installreferrer:1.0 manifest, firebase-crashlytics:18.0.0 manifest, ui:1.0.1 manifest, lifecycle-viewmodel-savedstate:2.3.1 manifest, play-services-auth-base:17.0.0 manifest, hilt-android:2.35.1 manifest, material-dialogs:core:3.2.1 manifest, AndroidManifest.xml navigation file, savedstate:1.1.0 manifest, cursoradapter:1.0.0 manifest, sqlite-framework:2.0.1 manifest, room-ktx:2.1.0 manifest, leakcanary-android-core:2.0-alpha-3 manifest, AndroidManifest.xml navigation file, media:1.0.0 manifest, coordinatorlayout:1.1.0 manifest, legacy-support-core-utils:1.0.0 manifest, lifecycle-runtime:2.3.1 manifest, coil-kt:coil:1.3.1 manifest, ui-tooling-preview:1.0.0 manifest, facebook-core:11.1.0 manifest, core:1.6.0 manifest, material:1.0.0 manifest, firebase-common:20.0.0 manifest, documentfile:1.0.0 manifest, lifecycle-viewmodel-compose:2.4.0-beta01 manifest, play-services-base:17.1.0 manifest, ui-tooling-data:1.0.0 manifest, coil-base:1.3.1 manifest, firebase-analytics-ktx:19.0.0 manifest, localbroadcastmanager:1.0.0 manifest, swiperefreshlayout:1.1.0-alpha03 manifest, constraintlayout-compose:1.0.0-beta02 manifest, core-ktx:1.6.0 manifest, firebase-database-collection:18.0.0 manifest, coil-compose-base:1.3.1 manifest, activity:1.3.1 manifest, AndroidManifest.xml navigation file, facebook-messenger:11.1.0 manifest, print:1.0.0 manifest, customview:1.1.0 manifest, material-icons-core:1.0.0 manifest, play-services-measurement-sdk:19.0.0 manifest, fragment:1.3.4 manifest, firebase-appcheck-interop:16.0.0-beta01 manifest, facebook-login:11.1.0 manifest, cardview:1.0.0 manifest, runtime-rxjava2:1.0.0 manifest, viewpager2:1.0.0 manifest, play-services-ads-identifier:17.0.0 manifest, play-services-measurement-impl:19.0.0 manifest, lifecycle-livedata-core:2.3.1 manifest, play-services-safetynet:17.0.0 manifest, AndroidManifest.xml navigation file, lifecycle-viewmodel-ktx:2.3.1 manifest, transport-backend-cct:3.0.0 manifest, fragment-ktx:1.2.4 manifest, appcompat:1.3.0 manifest, transport-runtime:3.0.0 manifest, lifecycle-livedata-core-ktx:2.2.0 manifest, firebase-firestore-ktx:23.0.0 manifest, legacy-support-v4:1.0.0 manifest, play-services-basement:17.1.1 manifest, firebase-storage:20.0.0 manifest, play-services-auth-api-phone:17.4.0 manifest, leakcanary-android:2.0-alpha-3 manifest, firebase-auth-interop:20.0.0 manifest, lifecycle-viewmodel:2.3.1 manifest, browser:1.0.0 manifest, firebase-auth:21.0.1 manifest, material:1.2.1 manifest, slidingpanelayout:1.0.0 manifest, vectordrawable:1.1.0 manifest, recyclerview:1.1.0 manifest, play-services-auth:19.0.0 manifest, room-runtime:2.1.0 manifest, dagger-lint-aar:2.35.1 manifest, navigation-dynamic-features-runtime:2.3.5 manifest, play-services-measurement-api:19.0.0 manifest, firebase-encoders-json:18.0.0 manifest, sqlite:2.0.1 manifest, facebook-android-sdk:11.1.0 manifest, firebase-components:17.0.0 manifest, transport-api:3.0.0 manifest, protolite-well-known-types:18.0.0 manifest, markdown-processor:0.1.3 manifest, play-services-measurement-base:19.0.0 manifest, firebase-common-ktx:20.0.0 manifest, activity-ktx:1.3.1 manifest, firebase-crashlytics-ktx:18.0.0 manifest, coil-compose:1.3.1 manifest, multidex:2.0.1 manifest, core-runtime:2.1.0 manifest, fragment-testing:1.2.0 manifest, ui-graphics:1.0.1 manifest, AndroidManifest.xml navigation file, ui-tooling:1.0.0 manifest, grpc-android:1.28.0 manifest, ui-unit:1.0.1 manifest, play-services-measurement:19.0.0 manifest, play:core:1.9.1 manifest, annotation-experimental:1.1.0 manifest, play-services-measurement-sdk-api:19.0.0 manifest, play-services-tasks:17.0.0 manifest, firebase-analytics:19.0.0 manifest, facebook-common:11.1.0 manifest, drawerlayout:1.1.1 manifest, AndroidManifest.xml navigation file, navigation-compose:2.4.0-alpha09 manifest, facebook-gamingservices:11.1.0 manifest, firebase-firestore:23.0.0 manifest, lifecycle-livedata:2.2.0 manifest, legacy-support-core-ui:1.0.0 manifest, test:monitor:1.2.0 manifest, AndroidManifest.xml navigation file, facebook-applinks:11.1.0 manifest, viewpager:1.0.0 manifest, ui-geometry:1.0.1 manifest, lifecycle-runtime-ktx:2.3.1 manifest, constraintlayout:2.0.4 manifest, ui-text:1.0.1 manifest, AndroidManifest.xml navigation file, firebase-installations-interop:17.0.0 manifest, transition:1.3.0 manifest, foundation-layout:1.0.1 manifest, appcompat-resources:1.3.1 manifest, runtime-livedata:1.0.0 manifest, runtime-saveable:1.0.1 manifest, firebase-measurement-connector:19.0.0 manifest, vectordrawable-animated:1.1.0 manifest, main nav_graph.xml navigation file Merging Errors: Error: android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. Dairy.app main manifest (this file) Error: android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. Dairy.app main manifest (this file) Error: android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. Dairy.app main manifest (this file)

ANSWER

Answered 2021-Oct-05 at 10:38

After the build has failed go to AndroidManifest.xml and in the bottom click merged manifest see which activities which have intent-filter but don't have exported=true attribute. Or you can just get the activities which are giving error.

Add these activities to your App manifest with android:exported="true" and app tools:node="merge" this will add exported attribute to the activities giving error.

Example:

1<?xml version="1.0" encoding="utf-8"?>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3    package="com.xyz.abc">
4
5    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
6    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
7
8    <application
9        android:name=".framework.presentation.BaseApplication"
10        android:allowBackup="true"
11        android:icon="@mipmap/ic_launcher"
12        android:label="@string/app_name"
13        android:roundIcon="@mipmap/ic_launcher_round"
14        android:supportsRtl="true"
15        android:theme="@style/AppTheme">
16        <activity android:name="com.xyz.presentation.MainActivity"
17            android:exported="true">
18            <intent-filter>
19                <action android:name="android.intent.action.MAIN" />
20
21                <category android:name="android.intent.category.LAUNCHER" />
22            </intent-filter>
23        </activity>
24    </application>
25
26</manifest>
27      <activity
28            android:name="<activity which is giving error>"
29            android:exported="true"
30            tools:node="merge" />
31

You will have to do this once, you can remove this once the library developers update their libs.

Source https://stackoverflow.com/questions/69287478

QUESTION

Tab & Navigation Bar changes after upgrading to XCode 13 (& iOS 15)

Asked 2022-Mar-22 at 05:47

I have an iOS app, since upgrading to Xcode 13, I have noticed some peculiar changes to Tab and Navigation bars. In Xcode 13, there's now this black area on the tab and nav bars and on launching the app, the tab bar is now black as well as the navigation bar. Weird enough, if the view has a scroll or tableview, if I scroll up, the bottom tab bar regains its white color and if I scroll down, the navigation bar regains its white color.

N:B: I already forced light theme from iOS 13 and above:

1 if #available(iOS 13.0, *) {
2     window!.overrideUserInterfaceStyle = .light
3 }
4

Can anyone assist or point me in the right direction so as to deal with this peculiarity?

Is there a simple fix to get Storyboard to readjust or this is a case where I have to make changes to each view manually?

Example of Storyboard before upgrade:

enter image description here

and after:

enter image description here

Simulator screen before and after (respectively) upgrade:

enter image description here

ANSWER

Answered 2021-Sep-22 at 12:40

first of all the problem is cause by unchecking translucent I fixed it by choosing navigation bar appearance from attributes inspector scroll edge it will fix it see this screen shot please

Source https://stackoverflow.com/questions/69281380

QUESTION

Unable to load class AndroidComponentsExtension after upgrading the Android Gradle Plugin 7.1

Asked 2022-Mar-07 at 20:34

I recently downloaded Android Studio Bumblebee and it helpfully asked whether I wanted to upgrade to Android Gradle Plugin 7.1.0, the version that shipped alongside Android Studio Bumblebee.

After upgrading, I get a build error:

1Unable to load class 'com.android.build.api.extension.AndroidComponentsExtension'.
2
3This is an unexpected error. Please file a bug containing the idea.log file.
4

And looking at the idea.log file, I see:

1Unable to load class 'com.android.build.api.extension.AndroidComponentsExtension'.
2
3This is an unexpected error. Please file a bug containing the idea.log file.
4A problem occurred evaluating project ':main'.
5    at org.gradle.initialization.exception.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:103)
6    ...
7Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':main'.
8    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
9    ...
10Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
11    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:73)
12    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:42)
13    ...
14Caused by: java.lang.ClassNotFoundException: com.android.build.api.extension.AndroidComponentsExtension
15

Which means I can't run my app and I need to downgrade the AGP 7.0 to get things working again. How do I fix this and upgrade to Android Gradle Plugin 7.1.0?

ANSWER

Answered 2022-Feb-11 at 04:05

Updating Navigation Safe Args

These lines are the important ones to look at:

1Unable to load class 'com.android.build.api.extension.AndroidComponentsExtension'.
2
3This is an unexpected error. Please file a bug containing the idea.log file.
4A problem occurred evaluating project ':main'.
5    at org.gradle.initialization.exception.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:103)
6    ...
7Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':main'.
8    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
9    ...
10Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
11    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:73)
12    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:42)
13    ...
14Caused by: java.lang.ClassNotFoundException: com.android.build.api.extension.AndroidComponentsExtension
15Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
16    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:73)
17    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:42)
18

This indicates that the error is coming from the Navigation Safe Args plugin.

As per the Android Gradle Plugin 7.1.0 release notes:

AGP APIs that the Navigation Safe Args Gradle plugin depend on have been removed. AGP 7.1 does not work with Navigation Safe Args versions 2.4.0-rc1 or 2.4.0, but will work with versions 2.5.0-alpha01 and 2.4.1. In the meantime, as a workaround, you can use AGP 7.1 with a snapshot build of Navigation Safe Args, Navigation 2.5.0-SNAPSHOT. To use the snapshot build, follow the snapshot instructions with build id #8054565.

As Navigation 2.4.1 is now available, you can upgrade to that version of Navigation to gain the fix:

Backported from Navigation 2.5.0-alpha01: Safe Args now depends on Android Gradle Plugin version 7.0.4. This means that Navigation Safe Args will no longer be compatible with Android Studio versions prior to 7.0, but is now compatible with Android Gradle Plugin 7.1.0 and higher.

1Unable to load class 'com.android.build.api.extension.AndroidComponentsExtension'.
2
3This is an unexpected error. Please file a bug containing the idea.log file.
4A problem occurred evaluating project ':main'.
5    at org.gradle.initialization.exception.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:103)
6    ...
7Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':main'.
8    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
9    ...
10Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
11    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:73)
12    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:42)
13    ...
14Caused by: java.lang.ClassNotFoundException: com.android.build.api.extension.AndroidComponentsExtension
15Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
16    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:73)
17    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:42)
18dependencies {
19    classpath 'com.android.tools.build:gradle:7.1.0'
20
21    // Update this line to use 2.4.1
22    classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.4.1"
23}
24

Note that you should always use the same version of the Navigation library as the Safe Args plugin (i.e., your app should also use Navigation 2.4.1): you should not try to use the Navigation 2.4.1+ Safe Args plugin with an earlier version of Navigation (such as 2.3.5).

Note on Firebase Perf Plugin

Note that you might see this same error when you are using:

1Unable to load class 'com.android.build.api.extension.AndroidComponentsExtension'.
2
3This is an unexpected error. Please file a bug containing the idea.log file.
4A problem occurred evaluating project ':main'.
5    at org.gradle.initialization.exception.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:103)
6    ...
7Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':main'.
8    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
9    ...
10Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
11    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:73)
12    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:42)
13    ...
14Caused by: java.lang.ClassNotFoundException: com.android.build.api.extension.AndroidComponentsExtension
15Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
16    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:73)
17    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:42)
18dependencies {
19    classpath 'com.android.tools.build:gradle:7.1.0'
20
21    // Update this line to use 2.4.1
22    classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.4.1"
23}
24classpath "com.google.firebase:perf-plugin:1.4.0"
25

With an idea.log of that states:

1Unable to load class 'com.android.build.api.extension.AndroidComponentsExtension'.
2
3This is an unexpected error. Please file a bug containing the idea.log file.
4A problem occurred evaluating project ':main'.
5    at org.gradle.initialization.exception.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:103)
6    ...
7Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':main'.
8    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
9    ...
10Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
11    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:73)
12    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:42)
13    ...
14Caused by: java.lang.ClassNotFoundException: com.android.build.api.extension.AndroidComponentsExtension
15Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
16    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:73)
17    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:42)
18dependencies {
19    classpath 'com.android.tools.build:gradle:7.1.0'
20
21    // Update this line to use 2.4.1
22    classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.4.1"
23}
24classpath "com.google.firebase:perf-plugin:1.4.0"
25Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
26    at com.google.firebase.perf.plugin.FirebasePerfClassVisitorFactory.registerForProject(FirebasePerfClassVisitorFactory.java:54)
27    at com.google.firebase.perf.plugin.FirebasePerfPlugin.perform(FirebasePerfPlugin.java:145)
28    at com.google.firebase.perf.plugin.FirebasePerfPlugin.lambda$apply$0(FirebasePerfPlugin.java:107)
29

As per the Firebase Perf Plugin 1.4.1 Release Notes:

Migrated away from the deprecated Android Gradle plugin APIs.

So you should upgrade to 1.4.1:

1Unable to load class 'com.android.build.api.extension.AndroidComponentsExtension'.
2
3This is an unexpected error. Please file a bug containing the idea.log file.
4A problem occurred evaluating project ':main'.
5    at org.gradle.initialization.exception.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:103)
6    ...
7Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':main'.
8    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
9    ...
10Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
11    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:73)
12    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:42)
13    ...
14Caused by: java.lang.ClassNotFoundException: com.android.build.api.extension.AndroidComponentsExtension
15Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
16    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:73)
17    at androidx.navigation.safeargs.gradle.SafeArgsPlugin.apply(SafeArgsPlugin.kt:42)
18dependencies {
19    classpath 'com.android.tools.build:gradle:7.1.0'
20
21    // Update this line to use 2.4.1
22    classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.4.1"
23}
24classpath "com.google.firebase:perf-plugin:1.4.0"
25Caused by: java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension
26    at com.google.firebase.perf.plugin.FirebasePerfClassVisitorFactory.registerForProject(FirebasePerfClassVisitorFactory.java:54)
27    at com.google.firebase.perf.plugin.FirebasePerfPlugin.perform(FirebasePerfPlugin.java:145)
28    at com.google.firebase.perf.plugin.FirebasePerfPlugin.lambda$apply$0(FirebasePerfPlugin.java:107)
29classpath "com.google.firebase:perf-plugin:1.4.1"
30

Source https://stackoverflow.com/questions/70857476

QUESTION

android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify

Asked 2022-Feb-23 at 14:13

After upgrading to android 12, the application is not compiling. It shows

"Manifest merger failed with multiple errors, see logs"

Error showing in Merged manifest:

Merging Errors: Error: android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. main manifest (this file)

I have set all the activity with android:exported="false". But it is still showing this issue.

My manifest file:

1<?xml version="1.0" encoding="utf-8"?>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3    xmlns:tools="http://schemas.android.com/tools"
4    package="eu.siacs.conversations">
5
6    <uses-sdk tools:overrideLibrary="net.ypresto.androidtranscoder" />
7
8    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
9    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
10    <uses-permission android:name="android.permission.READ_CONTACTS" />
11    <uses-permission android:name="android.permission.READ_PROFILE" />
12    <uses-permission
13        android:name="android.permission.READ_PHONE_STATE"
14        android:maxSdkVersion="22" />
15    <uses-permission android:name="android.permission.INTERNET" />
16    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
17    <uses-permission android:name="android.permission.WAKE_LOCK" />
18    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
19    <uses-permission android:name="android.permission.VIBRATE" />
20    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
21    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
22    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
23    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
24    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
25    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
26
27    <uses-feature
28        android:name="android.hardware.location"
29        android:required="false" />
30    <uses-feature
31        android:name="android.hardware.location.gps"
32        android:required="false" />
33    <uses-feature
34        android:name="android.hardware.location.network"
35        android:required="false" />
36
37    <uses-permission android:name="android.permission.CAMERA" />
38    <uses-permission android:name="android.permission.RECORD_AUDIO" />
39    <uses-permission android:name="android.permission.BLUETOOTH" />
40    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
41    <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
42    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
43
44    <uses-feature
45        android:name="android.hardware.camera"
46        android:required="false" />
47    <uses-feature
48        android:name="android.hardware.camera.autofocus"
49        android:required="false" />
50    <uses-feature
51        android:name="android.hardware.microphone"
52        android:required="false" />
53
54    <application
55        android:name=".Application"
56        android:allowBackup="false"
57        android:allowClearUserData="true"
58        android:appCategory="social"
59        android:hardwareAccelerated="true"
60        android:icon="@mipmap/ic_app_launch"
61        android:label="@string/app_name"
62        android:largeHeap="true"
63        android:networkSecurityConfig="@xml/network_security_configuration"
64        android:requestLegacyExternalStorage="true"
65        android:roundIcon="@mipmap/ic_app_launch_round"
66        android:theme="@style/ConversationsTheme"
67        android:usesCleartextTraffic="true"
68        android:windowSoftInputMode="adjustPan|adjustResize"
69        tools:replace="android:label"
70        tools:targetApi="q">
71        <activity
72            android:name=".ui.search.GroupSearchActivity"
73            android:exported="true" />
74        <activity
75            android:name=".ui.profileUpdating.FavouritesActivity"
76            android:exported="true" />
77        <activity
78            android:name=".ui.profileUpdating.NameActivity"
79            android:exported="true" />
80        <activity
81            android:name=".ui.CompulsoryUpdateActivity"
82            android:exported="true" />
83        <activity android:name=".ui.payments.doPayment.DoPaymentActivity"
84            android:exported="true" />
85        <activity android:name=".ui.individualList.IndividualListActivity"
86            android:exported="true" />
87        <activity android:name=".ui.payments.setPayment.SetPaymentActivity"
88            android:exported="true" />
89        <activity android:name=".ui.login.otpActivity.OTPActivity"
90            android:exported="true" />
91        <activity android:name=".ui.login.loginActivity.LoginActivity"
92            android:exported="true" />
93
94        <service android:name=".services.XmppConnectionService" android:exported="true" />
95
96        <receiver android:name=".services.EventReceiver"
97            android:exported="true">
98            <intent-filter>
99                <action android:name="android.intent.action.BOOT_COMPLETED" />
100                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
101                <action android:name="android.intent.action.ACTION_SHUTDOWN" />
102                <action android:name="android.media.RINGER_MODE_CHANGED" />
103            </intent-filter>
104        </receiver>
105
106        <activity
107            android:name=".ui.ShareLocationActivity"
108            android:label="@string/title_activity_share_location"
109            android:exported="true"/>
110        <activity
111            android:name=".ui.SearchActivity"
112            android:label="@string/search_messages"
113            android:exported="true" />
114        <activity
115            android:name=".ui.RecordingActivity"
116            android:configChanges="orientation|screenSize"
117            android:theme="@style/ConversationsTheme.Dialog"
118            android:exported="true" />
119        <activity
120            android:name=".ui.ShowLocationActivity"
121            android:label="@string/title_activity_show_location"
122            android:exported="true" />
123        <activity
124            android:name=".ui.SplashActivity"
125            android:theme="@style/SplashTheme"
126            android:exported="true">
127            <intent-filter>
128                <action android:name="android.intent.action.MAIN" />
129
130                <category android:name="android.intent.category.LAUNCHER" />
131            </intent-filter>
132        </activity>
133        <activity
134            android:name=".ui.ConversationsActivity"
135            android:label="@string/app_name"
136            android:launchMode="singleTask"
137            android:minWidth="300dp"
138            android:minHeight="300dp"
139            android:exported="true"
140            android:windowSoftInputMode="stateHidden" />
141        <activity
142            android:name=".ui.ScanActivity"
143            android:screenOrientation="portrait"
144            android:exported="true"
145            android:theme="@style/ConversationsTheme.FullScreen"
146            android:windowSoftInputMode="stateAlwaysHidden" />
147        <activity
148            android:name=".ui.UriHandlerActivity"
149            android:label="@string/app_name"
150            android:exported="true">
151            <intent-filter>
152                <action android:name="android.intent.action.VIEW" />
153
154                <category android:name="android.intent.category.DEFAULT" />
155                <category android:name="android.intent.category.BROWSABLE" />
156
157                <data android:scheme="xmpp" />
158            </intent-filter>
159            <intent-filter android:autoVerify="true">
160                <action android:name="android.intent.action.VIEW" />
161
162                <category android:name="android.intent.category.DEFAULT" />
163                <category android:name="android.intent.category.BROWSABLE" />
164
165                <data android:scheme="https" />
166                <data android:host="im.app.in" />
167                <data android:pathPrefix="/i/" />
168                <data android:pathPrefix="/j/" />
169            </intent-filter>
170            <intent-filter>
171                <action android:name="android.intent.action.SENDTO" />
172
173                <category android:name="android.intent.category.DEFAULT" />
174
175                <data android:scheme="imto" />
176                <data android:host="jabber" />
177            </intent-filter>
178        </activity>
179        <activity
180            android:name=".ui.StartConversationActivity"
181            android:label="@string/title_activity_start_conversation"
182            android:launchMode="singleTop"
183            android:exported="true">
184            <intent-filter>
185                <action android:name="android.intent.action.VIEW" />
186            </intent-filter>
187        </activity>
188        <activity
189            android:name=".ui.SettingsActivity"
190            android:label="@string/title_activity_settings"
191            android:exported="true">
192            <intent-filter>
193                <action android:name="android.intent.action.MAIN" />
194
195                <category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
196            </intent-filter>
197        </activity>
198        <activity
199            android:name=".ui.ChooseContactActivity"
200            android:label="@string/title_activity_choose_contact"
201            android:exported="true" />
202        <activity
203            android:name=".ui.BlocklistActivity"
204            android:label="@string/title_activity_block_list"
205            android:exported="true"/>
206        <activity
207            android:name=".ui.ChangePasswordActivity"
208            android:label="@string/change_password_on_server"
209            android:exported="true"/>
210        <activity
211            android:name=".ui.ChooseAccountForProfilePictureActivity"
212            android:enabled="false"
213            android:label="@string/choose_account"
214            android:exported="true">
215            <intent-filter android:label="@string/set_profile_picture">
216                <action android:name="android.intent.action.ATTACH_DATA" />
217
218                <category android:name="android.intent.category.DEFAULT" />
219
220                <data android:mimeType="image/*" />
221            </intent-filter>
222        </activity>
223        <activity
224            android:name=".ui.ShareViaAccountActivity"
225            android:label="@string/title_activity_share_via_account"
226            android:launchMode="singleTop"
227            android:exported="true" />
228        <activity
229            android:name=".ui.EditAccountActivity"
230            android:launchMode="singleTop"
231            android:exported="true"
232            android:windowSoftInputMode="stateHidden|adjustResize" />
233        <activity
234            android:name=".ui.ConferenceDetailsActivity"
235            android:label="@string/action_muc_details"
236            android:exported="true"
237            android:windowSoftInputMode="stateHidden" />
238        <activity
239            android:name=".ui.ContactDetailsActivity"
240            android:exported="true"
241            android:windowSoftInputMode="stateHidden" />
242        <activity
243            android:name=".ui.PublishProfilePictureActivity"
244            android:label="@string/mgmt_account_publish_avatar"
245            android:exported="true"
246            android:windowSoftInputMode="stateHidden" />
247        <activity
248            android:name=".ui.PublishGroupChatProfilePictureActivity"
249            android:exported="true"
250            android:label="@string/group_chat_avatar" />
251        <activity
252            android:name=".ui.ShareWithActivity"
253            android:label="@string/app_name"
254            android:launchMode="singleTop"
255            android:exported="true">
256            <intent-filter>
257                <action android:name="android.intent.action.SEND" />
258                <action android:name="android.intent.action.SEND_MULTIPLE" />
259
260                <category android:name="android.intent.category.DEFAULT" />
261
262                <data android:mimeType="text/plain" />
263            </intent-filter>
264            <intent-filter>
265                <action android:name="android.intent.action.SEND" />
266                <action android:name="android.intent.action.SEND_MULTIPLE" />
267
268                <category android:name="android.intent.category.DEFAULT" />
269
270                <data android:mimeType="*/*" />
271            </intent-filter>
272
273            <!-- the value here needs to be the full class name; independent of the configured applicationId -->
274            <meta-data
275                android:name="android.service.chooser.chooser_target_service"
276                android:value="eu.siacs.conversations.services.ContactChooserTargetService" />
277        </activity>
278        <activity
279            android:name=".ui.TrustKeysActivity"
280            android:label="@string/trust_omemo_fingerprints"
281            android:exported="true"
282            android:windowSoftInputMode="stateAlwaysHidden" />
283        <activity
284            android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
285            android:exported="true"
286            android:theme="@style/Base.Theme.AppCompat" />
287        <activity android:name=".ui.MemorizingActivity"
288            android:exported="true" />
289        <activity
290            android:name=".ui.MediaBrowserActivity"
291            android:exported="true"
292            android:label="@string/media_browser" />
293
294        <service android:name=".services.ExportBackupService" android:exported="true"/>
295        <service android:name=".services.ImportBackupService" android:exported="true"/>
296        <service
297            android:name=".services.ContactChooserTargetService"
298            android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE"
299            android:exported="true">
300            <intent-filter>
301                <action android:name="android.service.chooser.ChooserTargetService" />
302            </intent-filter>
303        </service>
304        <service android:name=".services.CompulsoryUpdateService" android:exported="true"/>
305
306        <provider
307            android:name="androidx.core.content.FileProvider"
308            android:authorities="${applicationId}.files"
309            android:exported="false"
310            android:grantUriPermissions="true">
311            <meta-data
312                android:name="android.support.FILE_PROVIDER_PATHS"
313                android:resource="@xml/file_paths" />
314        </provider>
315        <provider
316            android:name=".services.BarcodeProvider"
317            android:authorities="${applicationId}.barcodes"
318            android:exported="false"
319            android:grantUriPermissions="true" />
320
321        <activity
322            android:name=".ui.ShortcutActivity"
323            android:label="@string/contact"
324            android:exported="true">
325            <intent-filter>
326                <action android:name="android.intent.action.CREATE_SHORTCUT" />
327            </intent-filter>
328        </activity>
329        <activity
330            android:name=".ui.MucUsersActivity"
331            android:exported="true"
332            android:label="@string/group_chat_members" />
333        <activity
334            android:name=".ui.ChannelDiscoveryActivity"
335            android:exported="true"
336            android:label="@string/discover_channels" />
337        <activity
338            android:name=".ui.RtpSessionActivity"
339            android:autoRemoveFromRecents="true"
340            android:exported="true"
341            android:launchMode="singleInstance"
342            android:supportsPictureInPicture="true" />
343    </application>
344
345</manifest>
346

My second manifest file:

1<?xml version="1.0" encoding="utf-8"?>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3    xmlns:tools="http://schemas.android.com/tools"
4    package="eu.siacs.conversations">
5
6    <uses-sdk tools:overrideLibrary="net.ypresto.androidtranscoder" />
7
8    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
9    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
10    <uses-permission android:name="android.permission.READ_CONTACTS" />
11    <uses-permission android:name="android.permission.READ_PROFILE" />
12    <uses-permission
13        android:name="android.permission.READ_PHONE_STATE"
14        android:maxSdkVersion="22" />
15    <uses-permission android:name="android.permission.INTERNET" />
16    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
17    <uses-permission android:name="android.permission.WAKE_LOCK" />
18    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
19    <uses-permission android:name="android.permission.VIBRATE" />
20    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
21    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
22    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
23    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
24    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
25    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
26
27    <uses-feature
28        android:name="android.hardware.location"
29        android:required="false" />
30    <uses-feature
31        android:name="android.hardware.location.gps"
32        android:required="false" />
33    <uses-feature
34        android:name="android.hardware.location.network"
35        android:required="false" />
36
37    <uses-permission android:name="android.permission.CAMERA" />
38    <uses-permission android:name="android.permission.RECORD_AUDIO" />
39    <uses-permission android:name="android.permission.BLUETOOTH" />
40    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
41    <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
42    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
43
44    <uses-feature
45        android:name="android.hardware.camera"
46        android:required="false" />
47    <uses-feature
48        android:name="android.hardware.camera.autofocus"
49        android:required="false" />
50    <uses-feature
51        android:name="android.hardware.microphone"
52        android:required="false" />
53
54    <application
55        android:name=".Application"
56        android:allowBackup="false"
57        android:allowClearUserData="true"
58        android:appCategory="social"
59        android:hardwareAccelerated="true"
60        android:icon="@mipmap/ic_app_launch"
61        android:label="@string/app_name"
62        android:largeHeap="true"
63        android:networkSecurityConfig="@xml/network_security_configuration"
64        android:requestLegacyExternalStorage="true"
65        android:roundIcon="@mipmap/ic_app_launch_round"
66        android:theme="@style/ConversationsTheme"
67        android:usesCleartextTraffic="true"
68        android:windowSoftInputMode="adjustPan|adjustResize"
69        tools:replace="android:label"
70        tools:targetApi="q">
71        <activity
72            android:name=".ui.search.GroupSearchActivity"
73            android:exported="true" />
74        <activity
75            android:name=".ui.profileUpdating.FavouritesActivity"
76            android:exported="true" />
77        <activity
78            android:name=".ui.profileUpdating.NameActivity"
79            android:exported="true" />
80        <activity
81            android:name=".ui.CompulsoryUpdateActivity"
82            android:exported="true" />
83        <activity android:name=".ui.payments.doPayment.DoPaymentActivity"
84            android:exported="true" />
85        <activity android:name=".ui.individualList.IndividualListActivity"
86            android:exported="true" />
87        <activity android:name=".ui.payments.setPayment.SetPaymentActivity"
88            android:exported="true" />
89        <activity android:name=".ui.login.otpActivity.OTPActivity"
90            android:exported="true" />
91        <activity android:name=".ui.login.loginActivity.LoginActivity"
92            android:exported="true" />
93
94        <service android:name=".services.XmppConnectionService" android:exported="true" />
95
96        <receiver android:name=".services.EventReceiver"
97            android:exported="true">
98            <intent-filter>
99                <action android:name="android.intent.action.BOOT_COMPLETED" />
100                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
101                <action android:name="android.intent.action.ACTION_SHUTDOWN" />
102                <action android:name="android.media.RINGER_MODE_CHANGED" />
103            </intent-filter>
104        </receiver>
105
106        <activity
107            android:name=".ui.ShareLocationActivity"
108            android:label="@string/title_activity_share_location"
109            android:exported="true"/>
110        <activity
111            android:name=".ui.SearchActivity"
112            android:label="@string/search_messages"
113            android:exported="true" />
114        <activity
115            android:name=".ui.RecordingActivity"
116            android:configChanges="orientation|screenSize"
117            android:theme="@style/ConversationsTheme.Dialog"
118            android:exported="true" />
119        <activity
120            android:name=".ui.ShowLocationActivity"
121            android:label="@string/title_activity_show_location"
122            android:exported="true" />
123        <activity
124            android:name=".ui.SplashActivity"
125            android:theme="@style/SplashTheme"
126            android:exported="true">
127            <intent-filter>
128                <action android:name="android.intent.action.MAIN" />
129
130                <category android:name="android.intent.category.LAUNCHER" />
131            </intent-filter>
132        </activity>
133        <activity
134            android:name=".ui.ConversationsActivity"
135            android:label="@string/app_name"
136            android:launchMode="singleTask"
137            android:minWidth="300dp"
138            android:minHeight="300dp"
139            android:exported="true"
140            android:windowSoftInputMode="stateHidden" />
141        <activity
142            android:name=".ui.ScanActivity"
143            android:screenOrientation="portrait"
144            android:exported="true"
145            android:theme="@style/ConversationsTheme.FullScreen"
146            android:windowSoftInputMode="stateAlwaysHidden" />
147        <activity
148            android:name=".ui.UriHandlerActivity"
149            android:label="@string/app_name"
150            android:exported="true">
151            <intent-filter>
152                <action android:name="android.intent.action.VIEW" />
153
154                <category android:name="android.intent.category.DEFAULT" />
155                <category android:name="android.intent.category.BROWSABLE" />
156
157                <data android:scheme="xmpp" />
158            </intent-filter>
159            <intent-filter android:autoVerify="true">
160                <action android:name="android.intent.action.VIEW" />
161
162                <category android:name="android.intent.category.DEFAULT" />
163                <category android:name="android.intent.category.BROWSABLE" />
164
165                <data android:scheme="https" />
166                <data android:host="im.app.in" />
167                <data android:pathPrefix="/i/" />
168                <data android:pathPrefix="/j/" />
169            </intent-filter>
170            <intent-filter>
171                <action android:name="android.intent.action.SENDTO" />
172
173                <category android:name="android.intent.category.DEFAULT" />
174
175                <data android:scheme="imto" />
176                <data android:host="jabber" />
177            </intent-filter>
178        </activity>
179        <activity
180            android:name=".ui.StartConversationActivity"
181            android:label="@string/title_activity_start_conversation"
182            android:launchMode="singleTop"
183            android:exported="true">
184            <intent-filter>
185                <action android:name="android.intent.action.VIEW" />
186            </intent-filter>
187        </activity>
188        <activity
189            android:name=".ui.SettingsActivity"
190            android:label="@string/title_activity_settings"
191            android:exported="true">
192            <intent-filter>
193                <action android:name="android.intent.action.MAIN" />
194
195                <category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
196            </intent-filter>
197        </activity>
198        <activity
199            android:name=".ui.ChooseContactActivity"
200            android:label="@string/title_activity_choose_contact"
201            android:exported="true" />
202        <activity
203            android:name=".ui.BlocklistActivity"
204            android:label="@string/title_activity_block_list"
205            android:exported="true"/>
206        <activity
207            android:name=".ui.ChangePasswordActivity"
208            android:label="@string/change_password_on_server"
209            android:exported="true"/>
210        <activity
211            android:name=".ui.ChooseAccountForProfilePictureActivity"
212            android:enabled="false"
213            android:label="@string/choose_account"
214            android:exported="true">
215            <intent-filter android:label="@string/set_profile_picture">
216                <action android:name="android.intent.action.ATTACH_DATA" />
217
218                <category android:name="android.intent.category.DEFAULT" />
219
220                <data android:mimeType="image/*" />
221            </intent-filter>
222        </activity>
223        <activity
224            android:name=".ui.ShareViaAccountActivity"
225            android:label="@string/title_activity_share_via_account"
226            android:launchMode="singleTop"
227            android:exported="true" />
228        <activity
229            android:name=".ui.EditAccountActivity"
230            android:launchMode="singleTop"
231            android:exported="true"
232            android:windowSoftInputMode="stateHidden|adjustResize" />
233        <activity
234            android:name=".ui.ConferenceDetailsActivity"
235            android:label="@string/action_muc_details"
236            android:exported="true"
237            android:windowSoftInputMode="stateHidden" />
238        <activity
239            android:name=".ui.ContactDetailsActivity"
240            android:exported="true"
241            android:windowSoftInputMode="stateHidden" />
242        <activity
243            android:name=".ui.PublishProfilePictureActivity"
244            android:label="@string/mgmt_account_publish_avatar"
245            android:exported="true"
246            android:windowSoftInputMode="stateHidden" />
247        <activity
248            android:name=".ui.PublishGroupChatProfilePictureActivity"
249            android:exported="true"
250            android:label="@string/group_chat_avatar" />
251        <activity
252            android:name=".ui.ShareWithActivity"
253            android:label="@string/app_name"
254            android:launchMode="singleTop"
255            android:exported="true">
256            <intent-filter>
257                <action android:name="android.intent.action.SEND" />
258                <action android:name="android.intent.action.SEND_MULTIPLE" />
259
260                <category android:name="android.intent.category.DEFAULT" />
261
262                <data android:mimeType="text/plain" />
263            </intent-filter>
264            <intent-filter>
265                <action android:name="android.intent.action.SEND" />
266                <action android:name="android.intent.action.SEND_MULTIPLE" />
267
268                <category android:name="android.intent.category.DEFAULT" />
269
270                <data android:mimeType="*/*" />
271            </intent-filter>
272
273            <!-- the value here needs to be the full class name; independent of the configured applicationId -->
274            <meta-data
275                android:name="android.service.chooser.chooser_target_service"
276                android:value="eu.siacs.conversations.services.ContactChooserTargetService" />
277        </activity>
278        <activity
279            android:name=".ui.TrustKeysActivity"
280            android:label="@string/trust_omemo_fingerprints"
281            android:exported="true"
282            android:windowSoftInputMode="stateAlwaysHidden" />
283        <activity
284            android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
285            android:exported="true"
286            android:theme="@style/Base.Theme.AppCompat" />
287        <activity android:name=".ui.MemorizingActivity"
288            android:exported="true" />
289        <activity
290            android:name=".ui.MediaBrowserActivity"
291            android:exported="true"
292            android:label="@string/media_browser" />
293
294        <service android:name=".services.ExportBackupService" android:exported="true"/>
295        <service android:name=".services.ImportBackupService" android:exported="true"/>
296        <service
297            android:name=".services.ContactChooserTargetService"
298            android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE"
299            android:exported="true">
300            <intent-filter>
301                <action android:name="android.service.chooser.ChooserTargetService" />
302            </intent-filter>
303        </service>
304        <service android:name=".services.CompulsoryUpdateService" android:exported="true"/>
305
306        <provider
307            android:name="androidx.core.content.FileProvider"
308            android:authorities="${applicationId}.files"
309            android:exported="false"
310            android:grantUriPermissions="true">
311            <meta-data
312                android:name="android.support.FILE_PROVIDER_PATHS"
313                android:resource="@xml/file_paths" />
314        </provider>
315        <provider
316            android:name=".services.BarcodeProvider"
317            android:authorities="${applicationId}.barcodes"
318            android:exported="false"
319            android:grantUriPermissions="true" />
320
321        <activity
322            android:name=".ui.ShortcutActivity"
323            android:label="@string/contact"
324            android:exported="true">
325            <intent-filter>
326                <action android:name="android.intent.action.CREATE_SHORTCUT" />
327            </intent-filter>
328        </activity>
329        <activity
330            android:name=".ui.MucUsersActivity"
331            android:exported="true"
332            android:label="@string/group_chat_members" />
333        <activity
334            android:name=".ui.ChannelDiscoveryActivity"
335            android:exported="true"
336            android:label="@string/discover_channels" />
337        <activity
338            android:name=".ui.RtpSessionActivity"
339            android:autoRemoveFromRecents="true"
340            android:exported="true"
341            android:launchMode="singleInstance"
342            android:supportsPictureInPicture="true" />
343    </application>
344
345</manifest>
346<?xml version="1.0" encoding="utf-8"?>
347<manifest xmlns:android="http://schemas.android.com/apk/res/android"
348    xmlns:tools="http://schemas.android.com/tools"
349    package="eu.siacs.conversations">
350
351    <application tools:ignore="GoogleAppIndexingWarning">
352        <activity
353            android:name=".ui.ManageAccountActivity"
354            android:label="@string/title_activity_manage_accounts"
355            android:launchMode="singleTask"
356            android:exported="true"/>
357        <activity
358            android:name=".ui.MagicCreateActivity"
359            android:label="@string/create_new_account"
360            android:launchMode="singleTask"
361            android:exported="true"/>
362        <activity
363            android:name=".ui.EasyOnboardingInviteActivity"
364            android:label="@string/invite_to_app"
365            android:launchMode="singleTask" />
366        <activity
367            android:name=".ui.ImportBackupActivity"
368            android:label="@string/restore_backup"
369            android:launchMode="singleTask"
370            android:exported="true">
371            <intent-filter>
372                <action android:name="android.intent.action.VIEW" />
373                <category android:name="android.intent.category.DEFAULT" />
374
375                <data android:mimeType="application/vnd.conversations.backup" />
376                <data android:scheme="content" />
377            </intent-filter>
378            <intent-filter>
379                <action android:name="android.intent.action.VIEW" />
380                <category android:name="android.intent.category.DEFAULT" />
381
382                <data android:mimeType="application/vnd.conversations.backup" />
383                <data android:scheme="file" />
384            </intent-filter>
385            <intent-filter>
386                <action android:name="android.intent.action.VIEW" />
387
388                <category android:name="android.intent.category.DEFAULT" />
389                <category android:name="android.intent.category.BROWSABLE" />
390
391                <data android:scheme="content" />
392                <data android:host="*" />
393                <data android:mimeType="*/*" />
394                <data android:pathPattern=".*\\.ceb" />
395                <data android:pathPattern=".*\\..*\\.ceb" />
396                <data android:pathPattern=".*\\..*\\..*\\.ceb" />
397                <data android:pathPattern=".*\\..*\\..*\\..*\\.ceb" />
398                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.ceb" />
399                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
400                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
401            </intent-filter>
402            <intent-filter>
403                <action android:name="android.intent.action.VIEW" />
404
405                <category android:name="android.intent.category.DEFAULT" />
406                <category android:name="android.intent.category.BROWSABLE" />
407
408                <data android:scheme="file" />
409                <data android:host="*" />
410                <data android:mimeType="*/*" />
411                <data android:pathPattern=".*\\.ceb" />
412                <data android:pathPattern=".*\\..*\\.ceb" />
413                <data android:pathPattern=".*\\..*\\..*\\.ceb" />
414                <data android:pathPattern=".*\\..*\\..*\\..*\\.ceb" />
415                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.ceb" />
416                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
417                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
418            </intent-filter>
419        </activity>
420    </application>
421</manifest>
422
423

My gradle file:

1<?xml version="1.0" encoding="utf-8"?>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3    xmlns:tools="http://schemas.android.com/tools"
4    package="eu.siacs.conversations">
5
6    <uses-sdk tools:overrideLibrary="net.ypresto.androidtranscoder" />
7
8    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
9    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
10    <uses-permission android:name="android.permission.READ_CONTACTS" />
11    <uses-permission android:name="android.permission.READ_PROFILE" />
12    <uses-permission
13        android:name="android.permission.READ_PHONE_STATE"
14        android:maxSdkVersion="22" />
15    <uses-permission android:name="android.permission.INTERNET" />
16    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
17    <uses-permission android:name="android.permission.WAKE_LOCK" />
18    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
19    <uses-permission android:name="android.permission.VIBRATE" />
20    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
21    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
22    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
23    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
24    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
25    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
26
27    <uses-feature
28        android:name="android.hardware.location"
29        android:required="false" />
30    <uses-feature
31        android:name="android.hardware.location.gps"
32        android:required="false" />
33    <uses-feature
34        android:name="android.hardware.location.network"
35        android:required="false" />
36
37    <uses-permission android:name="android.permission.CAMERA" />
38    <uses-permission android:name="android.permission.RECORD_AUDIO" />
39    <uses-permission android:name="android.permission.BLUETOOTH" />
40    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
41    <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
42    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
43
44    <uses-feature
45        android:name="android.hardware.camera"
46        android:required="false" />
47    <uses-feature
48        android:name="android.hardware.camera.autofocus"
49        android:required="false" />
50    <uses-feature
51        android:name="android.hardware.microphone"
52        android:required="false" />
53
54    <application
55        android:name=".Application"
56        android:allowBackup="false"
57        android:allowClearUserData="true"
58        android:appCategory="social"
59        android:hardwareAccelerated="true"
60        android:icon="@mipmap/ic_app_launch"
61        android:label="@string/app_name"
62        android:largeHeap="true"
63        android:networkSecurityConfig="@xml/network_security_configuration"
64        android:requestLegacyExternalStorage="true"
65        android:roundIcon="@mipmap/ic_app_launch_round"
66        android:theme="@style/ConversationsTheme"
67        android:usesCleartextTraffic="true"
68        android:windowSoftInputMode="adjustPan|adjustResize"
69        tools:replace="android:label"
70        tools:targetApi="q">
71        <activity
72            android:name=".ui.search.GroupSearchActivity"
73            android:exported="true" />
74        <activity
75            android:name=".ui.profileUpdating.FavouritesActivity"
76            android:exported="true" />
77        <activity
78            android:name=".ui.profileUpdating.NameActivity"
79            android:exported="true" />
80        <activity
81            android:name=".ui.CompulsoryUpdateActivity"
82            android:exported="true" />
83        <activity android:name=".ui.payments.doPayment.DoPaymentActivity"
84            android:exported="true" />
85        <activity android:name=".ui.individualList.IndividualListActivity"
86            android:exported="true" />
87        <activity android:name=".ui.payments.setPayment.SetPaymentActivity"
88            android:exported="true" />
89        <activity android:name=".ui.login.otpActivity.OTPActivity"
90            android:exported="true" />
91        <activity android:name=".ui.login.loginActivity.LoginActivity"
92            android:exported="true" />
93
94        <service android:name=".services.XmppConnectionService" android:exported="true" />
95
96        <receiver android:name=".services.EventReceiver"
97            android:exported="true">
98            <intent-filter>
99                <action android:name="android.intent.action.BOOT_COMPLETED" />
100                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
101                <action android:name="android.intent.action.ACTION_SHUTDOWN" />
102                <action android:name="android.media.RINGER_MODE_CHANGED" />
103            </intent-filter>
104        </receiver>
105
106        <activity
107            android:name=".ui.ShareLocationActivity"
108            android:label="@string/title_activity_share_location"
109            android:exported="true"/>
110        <activity
111            android:name=".ui.SearchActivity"
112            android:label="@string/search_messages"
113            android:exported="true" />
114        <activity
115            android:name=".ui.RecordingActivity"
116            android:configChanges="orientation|screenSize"
117            android:theme="@style/ConversationsTheme.Dialog"
118            android:exported="true" />
119        <activity
120            android:name=".ui.ShowLocationActivity"
121            android:label="@string/title_activity_show_location"
122            android:exported="true" />
123        <activity
124            android:name=".ui.SplashActivity"
125            android:theme="@style/SplashTheme"
126            android:exported="true">
127            <intent-filter>
128                <action android:name="android.intent.action.MAIN" />
129
130                <category android:name="android.intent.category.LAUNCHER" />
131            </intent-filter>
132        </activity>
133        <activity
134            android:name=".ui.ConversationsActivity"
135            android:label="@string/app_name"
136            android:launchMode="singleTask"
137            android:minWidth="300dp"
138            android:minHeight="300dp"
139            android:exported="true"
140            android:windowSoftInputMode="stateHidden" />
141        <activity
142            android:name=".ui.ScanActivity"
143            android:screenOrientation="portrait"
144            android:exported="true"
145            android:theme="@style/ConversationsTheme.FullScreen"
146            android:windowSoftInputMode="stateAlwaysHidden" />
147        <activity
148            android:name=".ui.UriHandlerActivity"
149            android:label="@string/app_name"
150            android:exported="true">
151            <intent-filter>
152                <action android:name="android.intent.action.VIEW" />
153
154                <category android:name="android.intent.category.DEFAULT" />
155                <category android:name="android.intent.category.BROWSABLE" />
156
157                <data android:scheme="xmpp" />
158            </intent-filter>
159            <intent-filter android:autoVerify="true">
160                <action android:name="android.intent.action.VIEW" />
161
162                <category android:name="android.intent.category.DEFAULT" />
163                <category android:name="android.intent.category.BROWSABLE" />
164
165                <data android:scheme="https" />
166                <data android:host="im.app.in" />
167                <data android:pathPrefix="/i/" />
168                <data android:pathPrefix="/j/" />
169            </intent-filter>
170            <intent-filter>
171                <action android:name="android.intent.action.SENDTO" />
172
173                <category android:name="android.intent.category.DEFAULT" />
174
175                <data android:scheme="imto" />
176                <data android:host="jabber" />
177            </intent-filter>
178        </activity>
179        <activity
180            android:name=".ui.StartConversationActivity"
181            android:label="@string/title_activity_start_conversation"
182            android:launchMode="singleTop"
183            android:exported="true">
184            <intent-filter>
185                <action android:name="android.intent.action.VIEW" />
186            </intent-filter>
187        </activity>
188        <activity
189            android:name=".ui.SettingsActivity"
190            android:label="@string/title_activity_settings"
191            android:exported="true">
192            <intent-filter>
193                <action android:name="android.intent.action.MAIN" />
194
195                <category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
196            </intent-filter>
197        </activity>
198        <activity
199            android:name=".ui.ChooseContactActivity"
200            android:label="@string/title_activity_choose_contact"
201            android:exported="true" />
202        <activity
203            android:name=".ui.BlocklistActivity"
204            android:label="@string/title_activity_block_list"
205            android:exported="true"/>
206        <activity
207            android:name=".ui.ChangePasswordActivity"
208            android:label="@string/change_password_on_server"
209            android:exported="true"/>
210        <activity
211            android:name=".ui.ChooseAccountForProfilePictureActivity"
212            android:enabled="false"
213            android:label="@string/choose_account"
214            android:exported="true">
215            <intent-filter android:label="@string/set_profile_picture">
216                <action android:name="android.intent.action.ATTACH_DATA" />
217
218                <category android:name="android.intent.category.DEFAULT" />
219
220                <data android:mimeType="image/*" />
221            </intent-filter>
222        </activity>
223        <activity
224            android:name=".ui.ShareViaAccountActivity"
225            android:label="@string/title_activity_share_via_account"
226            android:launchMode="singleTop"
227            android:exported="true" />
228        <activity
229            android:name=".ui.EditAccountActivity"
230            android:launchMode="singleTop"
231            android:exported="true"
232            android:windowSoftInputMode="stateHidden|adjustResize" />
233        <activity
234            android:name=".ui.ConferenceDetailsActivity"
235            android:label="@string/action_muc_details"
236            android:exported="true"
237            android:windowSoftInputMode="stateHidden" />
238        <activity
239            android:name=".ui.ContactDetailsActivity"
240            android:exported="true"
241            android:windowSoftInputMode="stateHidden" />
242        <activity
243            android:name=".ui.PublishProfilePictureActivity"
244            android:label="@string/mgmt_account_publish_avatar"
245            android:exported="true"
246            android:windowSoftInputMode="stateHidden" />
247        <activity
248            android:name=".ui.PublishGroupChatProfilePictureActivity"
249            android:exported="true"
250            android:label="@string/group_chat_avatar" />
251        <activity
252            android:name=".ui.ShareWithActivity"
253            android:label="@string/app_name"
254            android:launchMode="singleTop"
255            android:exported="true">
256            <intent-filter>
257                <action android:name="android.intent.action.SEND" />
258                <action android:name="android.intent.action.SEND_MULTIPLE" />
259
260                <category android:name="android.intent.category.DEFAULT" />
261
262                <data android:mimeType="text/plain" />
263            </intent-filter>
264            <intent-filter>
265                <action android:name="android.intent.action.SEND" />
266                <action android:name="android.intent.action.SEND_MULTIPLE" />
267
268                <category android:name="android.intent.category.DEFAULT" />
269
270                <data android:mimeType="*/*" />
271            </intent-filter>
272
273            <!-- the value here needs to be the full class name; independent of the configured applicationId -->
274            <meta-data
275                android:name="android.service.chooser.chooser_target_service"
276                android:value="eu.siacs.conversations.services.ContactChooserTargetService" />
277        </activity>
278        <activity
279            android:name=".ui.TrustKeysActivity"
280            android:label="@string/trust_omemo_fingerprints"
281            android:exported="true"
282            android:windowSoftInputMode="stateAlwaysHidden" />
283        <activity
284            android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
285            android:exported="true"
286            android:theme="@style/Base.Theme.AppCompat" />
287        <activity android:name=".ui.MemorizingActivity"
288            android:exported="true" />
289        <activity
290            android:name=".ui.MediaBrowserActivity"
291            android:exported="true"
292            android:label="@string/media_browser" />
293
294        <service android:name=".services.ExportBackupService" android:exported="true"/>
295        <service android:name=".services.ImportBackupService" android:exported="true"/>
296        <service
297            android:name=".services.ContactChooserTargetService"
298            android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE"
299            android:exported="true">
300            <intent-filter>
301                <action android:name="android.service.chooser.ChooserTargetService" />
302            </intent-filter>
303        </service>
304        <service android:name=".services.CompulsoryUpdateService" android:exported="true"/>
305
306        <provider
307            android:name="androidx.core.content.FileProvider"
308            android:authorities="${applicationId}.files"
309            android:exported="false"
310            android:grantUriPermissions="true">
311            <meta-data
312                android:name="android.support.FILE_PROVIDER_PATHS"
313                android:resource="@xml/file_paths" />
314        </provider>
315        <provider
316            android:name=".services.BarcodeProvider"
317            android:authorities="${applicationId}.barcodes"
318            android:exported="false"
319            android:grantUriPermissions="true" />
320
321        <activity
322            android:name=".ui.ShortcutActivity"
323            android:label="@string/contact"
324            android:exported="true">
325            <intent-filter>
326                <action android:name="android.intent.action.CREATE_SHORTCUT" />
327            </intent-filter>
328        </activity>
329        <activity
330            android:name=".ui.MucUsersActivity"
331            android:exported="true"
332            android:label="@string/group_chat_members" />
333        <activity
334            android:name=".ui.ChannelDiscoveryActivity"
335            android:exported="true"
336            android:label="@string/discover_channels" />
337        <activity
338            android:name=".ui.RtpSessionActivity"
339            android:autoRemoveFromRecents="true"
340            android:exported="true"
341            android:launchMode="singleInstance"
342            android:supportsPictureInPicture="true" />
343    </application>
344
345</manifest>
346<?xml version="1.0" encoding="utf-8"?>
347<manifest xmlns:android="http://schemas.android.com/apk/res/android"
348    xmlns:tools="http://schemas.android.com/tools"
349    package="eu.siacs.conversations">
350
351    <application tools:ignore="GoogleAppIndexingWarning">
352        <activity
353            android:name=".ui.ManageAccountActivity"
354            android:label="@string/title_activity_manage_accounts"
355            android:launchMode="singleTask"
356            android:exported="true"/>
357        <activity
358            android:name=".ui.MagicCreateActivity"
359            android:label="@string/create_new_account"
360            android:launchMode="singleTask"
361            android:exported="true"/>
362        <activity
363            android:name=".ui.EasyOnboardingInviteActivity"
364            android:label="@string/invite_to_app"
365            android:launchMode="singleTask" />
366        <activity
367            android:name=".ui.ImportBackupActivity"
368            android:label="@string/restore_backup"
369            android:launchMode="singleTask"
370            android:exported="true">
371            <intent-filter>
372                <action android:name="android.intent.action.VIEW" />
373                <category android:name="android.intent.category.DEFAULT" />
374
375                <data android:mimeType="application/vnd.conversations.backup" />
376                <data android:scheme="content" />
377            </intent-filter>
378            <intent-filter>
379                <action android:name="android.intent.action.VIEW" />
380                <category android:name="android.intent.category.DEFAULT" />
381
382                <data android:mimeType="application/vnd.conversations.backup" />
383                <data android:scheme="file" />
384            </intent-filter>
385            <intent-filter>
386                <action android:name="android.intent.action.VIEW" />
387
388                <category android:name="android.intent.category.DEFAULT" />
389                <category android:name="android.intent.category.BROWSABLE" />
390
391                <data android:scheme="content" />
392                <data android:host="*" />
393                <data android:mimeType="*/*" />
394                <data android:pathPattern=".*\\.ceb" />
395                <data android:pathPattern=".*\\..*\\.ceb" />
396                <data android:pathPattern=".*\\..*\\..*\\.ceb" />
397                <data android:pathPattern=".*\\..*\\..*\\..*\\.ceb" />
398                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.ceb" />
399                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
400                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
401            </intent-filter>
402            <intent-filter>
403                <action android:name="android.intent.action.VIEW" />
404
405                <category android:name="android.intent.category.DEFAULT" />
406                <category android:name="android.intent.category.BROWSABLE" />
407
408                <data android:scheme="file" />
409                <data android:host="*" />
410                <data android:mimeType="*/*" />
411                <data android:pathPattern=".*\\.ceb" />
412                <data android:pathPattern=".*\\..*\\.ceb" />
413                <data android:pathPattern=".*\\..*\\..*\\.ceb" />
414                <data android:pathPattern=".*\\..*\\..*\\..*\\.ceb" />
415                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.ceb" />
416                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
417                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
418            </intent-filter>
419        </activity>
420    </application>
421</manifest>
422
423import com.android.build.OutputFile
424
425// Top-level build file where you can add configuration options common to all
426// sub-projects/modules.
427buildscript {
428    ext.kotlin_version = "1.5.21"
429    repositories {
430        google()
431        mavenCentral()
432        maven { url 'https://jitpack.io' }
433        gradlePluginPortal()
434    }
435    dependencies {
436        classpath 'com.android.tools.build:gradle:4.2.2'
437        classpath 'com.google.gms:google-services:4.3.8'
438        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
439    }
440}
441
442apply plugin: 'com.android.application'
443apply plugin: 'kotlin-android'
444apply plugin: 'kotlin-kapt'
445apply plugin: 'com.google.gms.google-services'
446
447repositories {
448    google()
449    mavenCentral()
450    jcenter()
451    maven { url 'https://jitpack.io' }
452}
453
454configurations {
455    conversationsFreeCompatImplementation
456}
457
458dependencies {
459    implementation 'androidx.viewpager:viewpager:1.0.0'
460    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
461
462    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
463
464    implementation 'org.sufficientlysecure:openpgp-api:10.0'
465    implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
466    implementation 'androidx.appcompat:appcompat:1.3.1'
467    implementation 'androidx.exifinterface:exifinterface:1.3.2'
468    implementation 'androidx.cardview:cardview:1.0.0'
469    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
470    implementation 'androidx.emoji:emoji:1.1.0'
471    implementation 'com.google.android.material:material:1.4.0'
472    conversationsFreeCompatImplementation 'androidx.emoji:emoji-bundled:1.1.0'
473    implementation 'org.bouncycastle:bcmail-jdk15on:1.64'
474    //zxing stopped supporting Java 7 so we have to stick with 3.3.3
475    //https://github.com/zxing/zxing/issues/1170
476    implementation 'com.google.zxing:core:3.4.1'
477    implementation 'de.measite.minidns:minidns-hla:0.2.4'
478    implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
479    implementation 'org.whispersystems:signal-protocol-java:2.8.1'
480    implementation 'com.makeramen:roundedimageview:2.3.0'
481    implementation "com.wefika:flowlayout:0.4.1"
482    implementation 'net.ypresto.androidtranscoder:android-transcoder:0.3.0'
483    implementation 'org.jxmpp:jxmpp-jid:1.0.1'
484    implementation 'org.osmdroid:osmdroid-android:6.1.10'
485    implementation 'org.hsluv:hsluv:0.2'
486    implementation 'org.conscrypt:conscrypt-android:2.5.2'
487    implementation 'me.drakeet.support:toastcompat:1.1.0'
488    implementation "com.leinardi.android:speed-dial:3.2.0"
489
490    implementation "com.squareup.retrofit2:retrofit:2.9.0"
491    implementation "com.squareup.retrofit2:converter-gson:2.9.0"
492    implementation "com.squareup.okhttp3:okhttp:5.0.0-alpha.2"
493    implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.2'
494
495    implementation 'com.google.guava:guava:30.1.1-android'
496    implementation 'org.webrtc:google-webrtc:1.0.32006'
497
498    // Lifecycle Helper
499    implementation "androidx.activity:activity-ktx:1.3.0-rc02"
500    implementation "androidx.fragment:fragment-ktx:1.3.6"
501
502    //Navigation
503    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
504    implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
505
506    //CardView
507    implementation "androidx.cardview:cardview:1.0.0"
508
509    //Country Code Picker
510    implementation 'com.hbb20:ccp:2.5.3'
511
512    //Firebase
513    implementation 'com.google.firebase:firebase-bom:28.3.0'
514    implementation 'com.google.firebase:firebase-auth-ktx:21.0.1'
515    implementation 'androidx.browser:browser:1.3.0'
516
517    //OTP view
518    implementation 'com.github.mukeshsolanki:android-otpview-pinview:2.1.2'
519
520    //Retrofit
521    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
522    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
523
524    //Gson
525    implementation 'com.google.code.gson:gson:2.8.7'
526
527    //Multidex
528    implementation 'androidx.multidex:multidex:2.0.1'
529
530    //Round Image
531    implementation 'de.hdodenhof:circleimageview:3.1.0'
532
533    // Button with image and text
534    implementation 'com.github.Omega-R:OmegaCenterIconButton:0.0.4@aar'
535
536    //Razor pay
537    implementation 'com.razorpay:checkout:1.6.10'
538
539    //Mixpanel Tracking
540    implementation 'com.mixpanel.android:mixpanel-android:5.9.1'
541
542    //Loading screen
543    implementation 'com.wang.avi:library:2.1.3'
544
545    //Loading
546    implementation 'com.wang.avi:library:2.1.3'
547
548    //Form
549    implementation 'com.quickbirdstudios:surveykit:1.1.0'
550}
551
552ext {
553    travisBuild = System.getenv("TRAVIS") == "true"
554    preDexEnabled = System.getProperty("pre-dex", "true")
555    abiCodes = ['armeabi-v7a': 1, 'x86': 2, 'x86_64': 3, 'arm64-v8a': 4]
556}
557
558android {
559    compileSdkVersion 31
560
561    defaultConfig {
562        minSdkVersion 24
563        targetSdkVersion 31
564        versionCode 44
565        versionName "2.0.4"
566        multiDexEnabled = true
567        archivesBaseName += "-$versionName"
568        applicationId "com.app.app"
569        resValue "string", "applicationId", applicationId
570        def appName = "app"
571        resValue "string", "app_name", appName
572        buildConfigField "String", "APP_NAME", "\"$appName\""
573    }
574
575    splits {
576        abi {
577            universalApk true
578            enable true
579        }
580    }
581
582    configurations {
583        compile.exclude group: 'org.jetbrains' , module:'annotations'
584    }
585
586    dataBinding {
587        enabled true
588    }
589
590    dexOptions {
591        // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
592        preDexLibraries = preDexEnabled && !travisBuild
593        jumboMode true
594    }
595
596    compileOptions {
597        sourceCompatibility JavaVersion.VERSION_1_8
598        targetCompatibility JavaVersion.VERSION_1_8
599    }
600
601    flavorDimensions("mode", "distribution", "emoji")
602
603    productFlavors {
604
605        conversations {
606            dimension "mode"
607        }
608        free {
609            dimension "distribution"
610            versionNameSuffix "+f"
611        }
612        compat {
613            dimension "emoji"
614            versionNameSuffix "c"
615        }
616    }
617
618    sourceSets {
619        conversationsFreeCompat {
620            java {
621                srcDir 'src/freeCompat/java'
622                srcDir 'src/conversationsFree/java'
623            }
624        }
625    }
626
627    buildTypes {
628        release {
629            shrinkResources true
630            minifyEnabled true
631            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
632            versionNameSuffix "r"
633        }
634        debug {
635            shrinkResources true
636            minifyEnabled true
637            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
638            versionNameSuffix "d"
639        }
640    }
641
642
643    if (new File("signing.properties").exists()) {
644        Properties props = new Properties()
645        props.load(new FileInputStream(file("signing.properties")))
646
647        signingConfigs {
648            release {
649                storeFile file(props['keystore'])
650                storePassword props['keystore.password']
651                keyAlias props['keystore.alias']
652                keyPassword props['keystore.password']
653            }
654        }
655        buildTypes.release.signingConfig = signingConfigs.release
656    }
657
658    lintOptions {
659        disable 'MissingTranslation', 'InvalidPackage','AppCompatResource'
660    }
661
662    subprojects {
663
664        afterEvaluate {
665            if (getPlugins().hasPlugin('android') ||
666                    getPlugins().hasPlugin('android-library')) {
667
668                configure(android.lintOptions) {
669                    disable 'AndroidGradlePluginVersion', 'MissingTranslation'
670                }
671            }
672
673        }
674    }
675
676    packagingOptions {
677        exclude 'META-INF/BCKEY.DSA'
678        exclude 'META-INF/BCKEY.SF'
679    }
680
681    android.applicationVariants.all { variant ->
682        variant.outputs.each { output ->
683            def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
684            if (baseAbiVersionCode != null) {
685                output.versionCodeOverride = (100 * variant.versionCode) + baseAbiVersionCode
686            }
687        }
688
689    }
690}
691

ANSWER

Answered 2021-Aug-04 at 09:18

I'm not sure what you're using to code, but in order to set it in Android Studio, open the manifest of your project and under the "activity" section, put android:exported="true"(or false if that is what you prefer). I have attached an example.

Source https://stackoverflow.com/questions/68554294

QUESTION

react native typescript 'string' is not assignable to parameter of type 'never.' in useNavigation

Asked 2022-Feb-15 at 17:51

[I keep getting the error that says 'string' is not assignable to parameter of type 'never' in react native typescript and I don't know why. Can someone help me fix this bug.

Thank you in advance.]1

code snippet :

1const loadReport = (id: string) => {
2    setPostId(id);
3    navigation.navigate('Report', {postId: id});
4}
5

I get an underline under 'Report'.

ANSWER

Answered 2021-Oct-11 at 12:01

The only solution I found is to apply the type never on the string name.

1const loadReport = (id: string) => {
2    setPostId(id);
3    navigation.navigate('Report', {postId: id});
4}
5const goToContent = () => {
6    navigate("Content" as never, {} as never);
7};
8

I'm not sure it's the best solution but it's work.

Source https://stackoverflow.com/questions/68667766

QUESTION

Could not resolve com.google.guava:guava:30.1-jre - Gradle project sync failed. Basic functionality will not work properly - in kotlin project

Asked 2022-Feb-14 at 19:47

It was a project that used to work well in the past, but after updating, the following errors appear.

1plugins {
2    id 'com.android.application'
3    id 'kotlin-android'
4}
5
6android {
7    compileSdkVersion 30
8    buildToolsVersion "30.0.3"
9
10    defaultConfig {
11        applicationId "com.example.retrofit_test"
12        minSdkVersion 21
13        targetSdkVersion 30
14        versionCode 1
15        versionName "1.0"
16
17        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18    }
19
20    buildTypes {
21        release {
22            minifyEnabled false
23            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24        }
25    }
26    compileOptions {
27        sourceCompatibility JavaVersion.VERSION_1_8
28        targetCompatibility JavaVersion.VERSION_1_8
29    }
30    kotlinOptions {
31        jvmTarget = '1.8'
32    }
33}
34
35dependencies {
36
37//    implementation 'com.google.guava:guava:30.1.1-jre'
38    implementation 'com.google.guava:guava:30.1-jre'
39
40//    implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.5.30-M1'
41
42    implementation 'androidx.core:core-ktx:1.6.0'
43    implementation 'androidx.appcompat:appcompat:1.3.1'
44    implementation 'com.google.android.material:material:1.4.0'
45    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
46    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
47    implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
48    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
49    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
50    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
51    implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
52
53    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
54    implementation 'com.google.code.gson:gson:2.8.7'
55    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
56    implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
57
58    implementation 'com.github.bumptech.glide:glide:4.12.0'
59    implementation 'android.arch.persistence.room:guava:1.1.1'
60    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
61
62    testImplementation 'junit:junit:4.13.2'
63    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
64    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
65}
66

If we need more source code to check, I will update it.

The error contents are as follows.

A problem occurred configuring root project 'Retrofit_Test'.

1plugins {
2    id 'com.android.application'
3    id 'kotlin-android'
4}
5
6android {
7    compileSdkVersion 30
8    buildToolsVersion "30.0.3"
9
10    defaultConfig {
11        applicationId "com.example.retrofit_test"
12        minSdkVersion 21
13        targetSdkVersion 30
14        versionCode 1
15        versionName "1.0"
16
17        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18    }
19
20    buildTypes {
21        release {
22            minifyEnabled false
23            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24        }
25    }
26    compileOptions {
27        sourceCompatibility JavaVersion.VERSION_1_8
28        targetCompatibility JavaVersion.VERSION_1_8
29    }
30    kotlinOptions {
31        jvmTarget = '1.8'
32    }
33}
34
35dependencies {
36
37//    implementation 'com.google.guava:guava:30.1.1-jre'
38    implementation 'com.google.guava:guava:30.1-jre'
39
40//    implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.5.30-M1'
41
42    implementation 'androidx.core:core-ktx:1.6.0'
43    implementation 'androidx.appcompat:appcompat:1.3.1'
44    implementation 'com.google.android.material:material:1.4.0'
45    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
46    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
47    implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
48    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
49    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
50    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
51    implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
52
53    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
54    implementation 'com.google.code.gson:gson:2.8.7'
55    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
56    implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
57
58    implementation 'com.github.bumptech.glide:glide:4.12.0'
59    implementation 'android.arch.persistence.room:guava:1.1.1'
60    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
61
62    testImplementation 'junit:junit:4.13.2'
63    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
64    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
65}
66   Could not resolve all artifacts for configuration ':classpath'.
67   Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30.
68     Searched in the following locations:
69       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.30/kotlin-gradle-plugin-1.5.30.pom
70     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
71     Required by:
72         project :
73   Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.32.
74     Searched in the following locations:
75       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.32/kotlin-stdlib-jdk8-1.4.32.pom
76     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
77     Required by:
78         project : > com.android.tools.build:gradle:7.0.2
79         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
80         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:repository:30.0.2
81         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:aaptcompiler:7.0.2
82         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.analytics-library:shared:30.0.2
83         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.lint:lint-model:30.0.2
84         project : > com.android.tools.build:gradle:7.0.2 > androidx.databinding:databinding-compiler-common:7.0.2
85         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-host-retention-proto:30.0.2
86         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
87         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder-model:7.0.2
88         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:gradle-api:7.0.2
89         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2 > com.android.tools:common:30.0.2
90         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.analytics-library:tracker:30.0.2
91         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.build:manifest-merger:30.0.2
92   Could not find org.apache.httpcomponents:httpmime:4.5.6.
93     Searched in the following locations:
94       - https://dl.google.com/dl/android/maven2/org/apache/httpcomponents/httpmime/4.5.6/httpmime-4.5.6.pom
95     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
96     Required by:
97         project : > com.android.tools.build:gradle:7.0.2
98         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdklib:30.0.2
99         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.analytics-library:crash:30.0.2
100   Could not find commons-io:commons-io:2.4.
101     Searched in the following locations:
102       - https://dl.google.com/dl/android/maven2/commons-io/commons-io/2.4/commons-io-2.4.pom
103     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
104     Required by:
105         project : > com.android.tools.build:gradle:7.0.2
106         project : > com.android.tools.build:gradle:7.0.2 > androidx.databinding:databinding-compiler-common:7.0.2
107   Could not find org.ow2.asm:asm:7.0.
108     Searched in the following locations:
109       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm/7.0/asm-7.0.pom
110     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
111     Required by:
112         project : > com.android.tools.build:gradle:7.0.2
113         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
114         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:gradle-api:7.0.2
115   Could not find org.ow2.asm:asm-analysis:7.0.
116     Searched in the following locations:
117       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm-analysis/7.0/asm-analysis-7.0.pom
118     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
119     Required by:
120         project : > com.android.tools.build:gradle:7.0.2
121   Could not find org.ow2.asm:asm-commons:7.0.
122     Searched in the following locations:
123       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm-commons/7.0/asm-commons-7.0.pom
124     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
125     Required by:
126         project : > com.android.tools.build:gradle:7.0.2
127         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
128   Could not find org.ow2.asm:asm-util:7.0.
129     Searched in the following locations:
130       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm-util/7.0/asm-util-7.0.pom
131     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
132     Required by:
133         project : > com.android.tools.build:gradle:7.0.2
134         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
135   Could not find org.bouncycastle:bcpkix-jdk15on:1.56.
136     Searched in the following locations:
137       - https://dl.google.com/dl/android/maven2/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.pom
138     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
139     Required by:
140         project : > com.android.tools.build:gradle:7.0.2
141         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
142         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
143         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.build:apkzlib:7.0.2
144   Could not find org.glassfish.jaxb:jaxb-runtime:2.3.2.
145     Searched in the following locations:
146       - https://dl.google.com/dl/android/maven2/org/glassfish/jaxb/jaxb-runtime/2.3.2/jaxb-runtime-2.3.2.pom
147     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
148     Required by:
149         project : > com.android.tools.build:gradle:7.0.2
150         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
151         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdklib:30.0.2
152         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:repository:30.0.2
153         project : > com.android.tools.build:gradle:7.0.2 > androidx.databinding:databinding-compiler-common:7.0.2
154   Could not find net.sf.jopt-simple:jopt-simple:4.9.
155     Searched in the following locations:
156       - https://dl.google.com/dl/android/maven2/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.pom
157     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
158     Required by:
159         project : > com.android.tools.build:gradle:7.0.2
160         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
161   Could not find com.squareup:javapoet:1.10.0.
162     Searched in the following locations:
163       - https://dl.google.com/dl/android/maven2/com/squareup/javapoet/1.10.0/javapoet-1.10.0.pom
164     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
165     Required by:
166         project : > com.android.tools.build:gradle:7.0.2
167         project : > com.android.tools.build:gradle:7.0.2 > androidx.databinding:databinding-compiler-common:7.0.2
168   Could not find com.google.protobuf:protobuf-java:3.10.0.
169     Searched in the following locations:
170       - https://dl.google.com/dl/android/maven2/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.pom
171     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
172     Required by:
173         project : > com.android.tools.build:gradle:7.0.2
174         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
175         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.ddms:ddmlib:30.0.2
176         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:aapt2-proto:7.0.2-7396180
177         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:aaptcompiler:7.0.2
178         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-device-provider-gradle-proto:30.0.2
179         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-host-retention-proto:30.0.2
180         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
181         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:bundletool:1.6.0
182         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.analytics-library:shared:30.0.2 > com.android.tools.analytics-library:protos:30.0.2
183         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.analytics-library:tracker:30.0.2
184   Could not find com.google.protobuf:protobuf-java-util:3.10.0.
185     Searched in the following locations:
186       - https://dl.google.com/dl/android/maven2/com/google/protobuf/protobuf-java-util/3.10.0/protobuf-java-util-3.10.0.pom
187     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
188     Required by:
189         project : > com.android.tools.build:gradle:7.0.2
190         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:bundletool:1.6.0
191   Could not find com.google.code.gson:gson:2.8.6.
192     Searched in the following locations:
193       - https://dl.google.com/dl/android/maven2/com/google/code/gson/gson/2.8.6/gson-2.8.6.pom
194     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
195     Required by:
196         project : > com.android.tools.build:gradle:7.0.2
197         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
198         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdklib:30.0.2
199         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.analytics-library:shared:30.0.2
200         project : > com.android.tools.build:gradle:7.0.2 > androidx.databinding:databinding-compiler-common:7.0.2
201         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
202         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.build:manifest-merger:30.0.2
203   Could not find io.grpc:grpc-core:1.21.1.
204     Searched in the following locations:
205       - https://dl.google.com/dl/android/maven2/io/grpc/grpc-core/1.21.1/grpc-core-1.21.1.pom
206     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
207     Required by:
208         project : > com.android.tools.build:gradle:7.0.2
209         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
210   Could not find io.grpc:grpc-netty:1.21.1.
211     Searched in the following locations:
212       - https://dl.google.com/dl/android/maven2/io/grpc/grpc-netty/1.21.1/grpc-netty-1.21.1.pom
213     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
214     Required by:
215         project : > com.android.tools.build:gradle:7.0.2
216         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
217   Could not find io.grpc:grpc-protobuf:1.21.1.
218     Searched in the following locations:
219       - https://dl.google.com/dl/android/maven2/io/grpc/grpc-protobuf/1.21.1/grpc-protobuf-1.21.1.pom
220     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
221     Required by:
222         project : > com.android.tools.build:gradle:7.0.2
223         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
224   Could not find io.grpc:grpc-stub:1.21.1.
225     Searched in the following locations:
226       - https://dl.google.com/dl/android/maven2/io/grpc/grpc-stub/1.21.1/grpc-stub-1.21.1.pom
227     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
228     Required by:
229         project : > com.android.tools.build:gradle:7.0.2
230         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
231   Could not find com.google.crypto.tink:tink:1.3.0-rc2.
232     Searched in the following locations:
233       - https://dl.google.com/dl/android/maven2/com/google/crypto/tink/tink/1.3.0-rc2/tink-1.3.0-rc2.pom
234     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
235     Required by:
236         project : > com.android.tools.build:gradle:7.0.2
237   Could not find com.google.flatbuffers:flatbuffers-java:1.12.0.
238     Searched in the following locations:
239       - https://dl.google.com/dl/android/maven2/com/google/flatbuffers/flatbuffers-java/1.12.0/flatbuffers-java-1.12.0.pom
240     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
241     Required by:
242         project : > com.android.tools.build:gradle:7.0.2
243   Could not find org.tensorflow:tensorflow-lite-metadata:0.1.0-rc2.
244     Searched in the following locations:
245       - https://dl.google.com/dl/android/maven2/org/tensorflow/tensorflow-lite-metadata/0.1.0-rc2/tensorflow-lite-metadata-0.1.0-rc2.pom
246     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
247     Required by:
248         project : > com.android.tools.build:gradle:7.0.2
249   Could not find org.bouncycastle:bcprov-jdk15on:1.56.
250     Searched in the following locations:
251       - https://dl.google.com/dl/android/maven2/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.pom
252     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
253     Required by:
254         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
255         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
256         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.build:apkzlib:7.0.2
257   Could not find com.google.guava:guava:30.1-jre.
258     Searched in the following locations:
259       - https://dl.google.com/dl/android/maven2/com/google/guava/guava/30.1-jre/guava-30.1-jre.pom
260     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
261     Required by:
262         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
263         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:aaptcompiler:7.0.2
264         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.analytics-library:crash:30.0.2
265         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.analytics-library:shared:30.0.2
266         project : > com.android.tools.build:gradle:7.0.2 > androidx.databinding:databinding-compiler-common:7.0.2
267         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder-test-api:7.0.2
268         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
269         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:bundletool:1.6.0
270         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:gradle-api:7.0.2
271         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2 > com.android.tools:common:30.0.2
272         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.analytics-library:tracker:30.0.2
273   Could not find org.jetbrains.kotlin:kotlin-reflect:1.4.32.
274     Searched in the following locations:
275       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-reflect/1.4.32/kotlin-reflect-1.4.32.pom
276     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
277     Required by:
278         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
279   Could not find javax.inject:javax.inject:1.
280     Searched in the following locations:
281       - https://dl.google.com/dl/android/maven2/javax/inject/javax.inject/1/javax.inject-1.pom
282     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
283     Required by:
284         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
285         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:bundletool:1.6.0
286         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
287   Could not find net.sf.kxml:kxml2:2.3.0.
288     Searched in the following locations:
289       - https://dl.google.com/dl/android/maven2/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.pom
290     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
291     Required by:
292         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
293         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.ddms:ddmlib:30.0.2
294         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.lint:lint-model:30.0.2
295         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.layoutlib:layoutlib-api:30.0.2
296         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.build:manifest-merger:30.0.2
297   Could not find org.jetbrains.intellij.deps:trove4j:1.0.20181211.
298     Searched in the following locations:
299       - https://dl.google.com/dl/android/maven2/org/jetbrains/intellij/deps/trove4j/1.0.20181211/trove4j-1.0.20181211.pom
300     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
301     Required by:
302         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
303   Could not find xerces:xercesImpl:2.12.0.
304     Searched in the following locations:
305       - https://dl.google.com/dl/android/maven2/xerces/xercesImpl/2.12.0/xercesImpl-2.12.0.pom
306     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
307     Required by:
308         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
309   Could not find org.apache.commons:commons-compress:1.20.
310     Searched in the following locations:
311       - https://dl.google.com/dl/android/maven2/org/apache/commons/commons-compress/1.20/commons-compress-1.20.pom
312     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
313

ANSWER

Answered 2021-Sep-17 at 11:03

Add mavenCentral() in Build Script

1plugins {
2    id 'com.android.application'
3    id 'kotlin-android'
4}
5
6android {
7    compileSdkVersion 30
8    buildToolsVersion "30.0.3"
9
10    defaultConfig {
11        applicationId "com.example.retrofit_test"
12        minSdkVersion 21
13        targetSdkVersion 30
14        versionCode 1
15        versionName "1.0"
16
17        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18    }
19
20    buildTypes {
21        release {
22            minifyEnabled false
23            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24        }
25    }
26    compileOptions {
27        sourceCompatibility JavaVersion.VERSION_1_8
28        targetCompatibility JavaVersion.VERSION_1_8
29    }
30    kotlinOptions {
31        jvmTarget = '1.8'
32    }
33}
34
35dependencies {
36
37//    implementation 'com.google.guava:guava:30.1.1-jre'
38    implementation 'com.google.guava:guava:30.1-jre'
39
40//    implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.5.30-M1'
41
42    implementation 'androidx.core:core-ktx:1.6.0'
43    implementation 'androidx.appcompat:appcompat:1.3.1'
44    implementation 'com.google.android.material:material:1.4.0'
45    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
46    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
47    implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
48    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
49    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
50    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
51    implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
52
53    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
54    implementation 'com.google.code.gson:gson:2.8.7'
55    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
56    implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
57
58    implementation 'com.github.bumptech.glide:glide:4.12.0'
59    implementation 'android.arch.persistence.room:guava:1.1.1'
60    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
61
62    testImplementation 'junit:junit:4.13.2'
63    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
64    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
65}
66   Could not resolve all artifacts for configuration ':classpath'.
67   Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30.
68     Searched in the following locations:
69       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.30/kotlin-gradle-plugin-1.5.30.pom
70     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
71     Required by:
72         project :
73   Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.32.
74     Searched in the following locations:
75       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.32/kotlin-stdlib-jdk8-1.4.32.pom
76     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
77     Required by:
78         project : > com.android.tools.build:gradle:7.0.2
79         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
80         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:repository:30.0.2
81         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:aaptcompiler:7.0.2
82         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.analytics-library:shared:30.0.2
83         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.lint:lint-model:30.0.2
84         project : > com.android.tools.build:gradle:7.0.2 > androidx.databinding:databinding-compiler-common:7.0.2
85         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-host-retention-proto:30.0.2
86         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
87         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder-model:7.0.2
88         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:gradle-api:7.0.2
89         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2 > com.android.tools:common:30.0.2
90         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.analytics-library:tracker:30.0.2
91         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.build:manifest-merger:30.0.2
92   Could not find org.apache.httpcomponents:httpmime:4.5.6.
93     Searched in the following locations:
94       - https://dl.google.com/dl/android/maven2/org/apache/httpcomponents/httpmime/4.5.6/httpmime-4.5.6.pom
95     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
96     Required by:
97         project : > com.android.tools.build:gradle:7.0.2
98         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdklib:30.0.2
99         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.analytics-library:crash:30.0.2
100   Could not find commons-io:commons-io:2.4.
101     Searched in the following locations:
102       - https://dl.google.com/dl/android/maven2/commons-io/commons-io/2.4/commons-io-2.4.pom
103     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
104     Required by:
105         project : > com.android.tools.build:gradle:7.0.2
106         project : > com.android.tools.build:gradle:7.0.2 > androidx.databinding:databinding-compiler-common:7.0.2
107   Could not find org.ow2.asm:asm:7.0.
108     Searched in the following locations:
109       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm/7.0/asm-7.0.pom
110     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
111     Required by:
112         project : > com.android.tools.build:gradle:7.0.2
113         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
114         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:gradle-api:7.0.2
115   Could not find org.ow2.asm:asm-analysis:7.0.
116     Searched in the following locations:
117       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm-analysis/7.0/asm-analysis-7.0.pom
118     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
119     Required by:
120         project : > com.android.tools.build:gradle:7.0.2
121   Could not find org.ow2.asm:asm-commons:7.0.
122     Searched in the following locations:
123       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm-commons/7.0/asm-commons-7.0.pom
124     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
125     Required by:
126         project : > com.android.tools.build:gradle:7.0.2
127         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
128   Could not find org.ow2.asm:asm-util:7.0.
129     Searched in the following locations:
130       - https://dl.google.com/dl/android/maven2/org/ow2/asm/asm-util/7.0/asm-util-7.0.pom
131     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
132     Required by:
133         project : > com.android.tools.build:gradle:7.0.2
134         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
135   Could not find org.bouncycastle:bcpkix-jdk15on:1.56.
136     Searched in the following locations:
137       - https://dl.google.com/dl/android/maven2/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.pom
138     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
139     Required by:
140         project : > com.android.tools.build:gradle:7.0.2
141         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
142         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
143         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.build:apkzlib:7.0.2
144   Could not find org.glassfish.jaxb:jaxb-runtime:2.3.2.
145     Searched in the following locations:
146       - https://dl.google.com/dl/android/maven2/org/glassfish/jaxb/jaxb-runtime/2.3.2/jaxb-runtime-2.3.2.pom
147     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
148     Required by:
149         project : > com.android.tools.build:gradle:7.0.2
150         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
151         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdklib:30.0.2
152         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:repository:30.0.2
153         project : > com.android.tools.build:gradle:7.0.2 > androidx.databinding:databinding-compiler-common:7.0.2
154   Could not find net.sf.jopt-simple:jopt-simple:4.9.
155     Searched in the following locations:
156       - https://dl.google.com/dl/android/maven2/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.pom
157     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
158     Required by:
159         project : > com.android.tools.build:gradle:7.0.2
160         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
161   Could not find com.squareup:javapoet:1.10.0.
162     Searched in the following locations:
163       - https://dl.google.com/dl/android/maven2/com/squareup/javapoet/1.10.0/javapoet-1.10.0.pom
164     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
165     Required by:
166         project : > com.android.tools.build:gradle:7.0.2
167         project : > com.android.tools.build:gradle:7.0.2 > androidx.databinding:databinding-compiler-common:7.0.2
168   Could not find com.google.protobuf:protobuf-java:3.10.0.
169     Searched in the following locations:
170       - https://dl.google.com/dl/android/maven2/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.pom
171     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
172     Required by:
173         project : > com.android.tools.build:gradle:7.0.2
174         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
175         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.ddms:ddmlib:30.0.2
176         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:aapt2-proto:7.0.2-7396180
177         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:aaptcompiler:7.0.2
178         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-device-provider-gradle-proto:30.0.2
179         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-host-retention-proto:30.0.2
180         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
181         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:bundletool:1.6.0
182         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.analytics-library:shared:30.0.2 > com.android.tools.analytics-library:protos:30.0.2
183         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.analytics-library:tracker:30.0.2
184   Could not find com.google.protobuf:protobuf-java-util:3.10.0.
185     Searched in the following locations:
186       - https://dl.google.com/dl/android/maven2/com/google/protobuf/protobuf-java-util/3.10.0/protobuf-java-util-3.10.0.pom
187     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
188     Required by:
189         project : > com.android.tools.build:gradle:7.0.2
190         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:bundletool:1.6.0
191   Could not find com.google.code.gson:gson:2.8.6.
192     Searched in the following locations:
193       - https://dl.google.com/dl/android/maven2/com/google/code/gson/gson/2.8.6/gson-2.8.6.pom
194     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
195     Required by:
196         project : > com.android.tools.build:gradle:7.0.2
197         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
198         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdklib:30.0.2
199         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.analytics-library:shared:30.0.2
200         project : > com.android.tools.build:gradle:7.0.2 > androidx.databinding:databinding-compiler-common:7.0.2
201         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
202         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.build:manifest-merger:30.0.2
203   Could not find io.grpc:grpc-core:1.21.1.
204     Searched in the following locations:
205       - https://dl.google.com/dl/android/maven2/io/grpc/grpc-core/1.21.1/grpc-core-1.21.1.pom
206     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
207     Required by:
208         project : > com.android.tools.build:gradle:7.0.2
209         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
210   Could not find io.grpc:grpc-netty:1.21.1.
211     Searched in the following locations:
212       - https://dl.google.com/dl/android/maven2/io/grpc/grpc-netty/1.21.1/grpc-netty-1.21.1.pom
213     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
214     Required by:
215         project : > com.android.tools.build:gradle:7.0.2
216         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
217   Could not find io.grpc:grpc-protobuf:1.21.1.
218     Searched in the following locations:
219       - https://dl.google.com/dl/android/maven2/io/grpc/grpc-protobuf/1.21.1/grpc-protobuf-1.21.1.pom
220     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
221     Required by:
222         project : > com.android.tools.build:gradle:7.0.2
223         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
224   Could not find io.grpc:grpc-stub:1.21.1.
225     Searched in the following locations:
226       - https://dl.google.com/dl/android/maven2/io/grpc/grpc-stub/1.21.1/grpc-stub-1.21.1.pom
227     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
228     Required by:
229         project : > com.android.tools.build:gradle:7.0.2
230         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
231   Could not find com.google.crypto.tink:tink:1.3.0-rc2.
232     Searched in the following locations:
233       - https://dl.google.com/dl/android/maven2/com/google/crypto/tink/tink/1.3.0-rc2/tink-1.3.0-rc2.pom
234     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
235     Required by:
236         project : > com.android.tools.build:gradle:7.0.2
237   Could not find com.google.flatbuffers:flatbuffers-java:1.12.0.
238     Searched in the following locations:
239       - https://dl.google.com/dl/android/maven2/com/google/flatbuffers/flatbuffers-java/1.12.0/flatbuffers-java-1.12.0.pom
240     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
241     Required by:
242         project : > com.android.tools.build:gradle:7.0.2
243   Could not find org.tensorflow:tensorflow-lite-metadata:0.1.0-rc2.
244     Searched in the following locations:
245       - https://dl.google.com/dl/android/maven2/org/tensorflow/tensorflow-lite-metadata/0.1.0-rc2/tensorflow-lite-metadata-0.1.0-rc2.pom
246     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
247     Required by:
248         project : > com.android.tools.build:gradle:7.0.2
249   Could not find org.bouncycastle:bcprov-jdk15on:1.56.
250     Searched in the following locations:
251       - https://dl.google.com/dl/android/maven2/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.pom
252     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
253     Required by:
254         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
255         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
256         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.build:apkzlib:7.0.2
257   Could not find com.google.guava:guava:30.1-jre.
258     Searched in the following locations:
259       - https://dl.google.com/dl/android/maven2/com/google/guava/guava/30.1-jre/guava-30.1-jre.pom
260     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
261     Required by:
262         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
263         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:aaptcompiler:7.0.2
264         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.analytics-library:crash:30.0.2
265         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.analytics-library:shared:30.0.2
266         project : > com.android.tools.build:gradle:7.0.2 > androidx.databinding:databinding-compiler-common:7.0.2
267         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder-test-api:7.0.2
268         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.0.2
269         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:bundletool:1.6.0
270         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:gradle-api:7.0.2
271         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2 > com.android.tools:common:30.0.2
272         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.analytics-library:tracker:30.0.2
273   Could not find org.jetbrains.kotlin:kotlin-reflect:1.4.32.
274     Searched in the following locations:
275       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-reflect/1.4.32/kotlin-reflect-1.4.32.pom
276     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
277     Required by:
278         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
279   Could not find javax.inject:javax.inject:1.
280     Searched in the following locations:
281       - https://dl.google.com/dl/android/maven2/javax/inject/javax.inject/1/javax.inject-1.pom
282     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
283     Required by:
284         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
285         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:bundletool:1.6.0
286         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2
287   Could not find net.sf.kxml:kxml2:2.3.0.
288     Searched in the following locations:
289       - https://dl.google.com/dl/android/maven2/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.pom
290     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
291     Required by:
292         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
293         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.ddms:ddmlib:30.0.2
294         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.lint:lint-model:30.0.2
295         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.layoutlib:layoutlib-api:30.0.2
296         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools.build:builder:7.0.2 > com.android.tools.build:manifest-merger:30.0.2
297   Could not find org.jetbrains.intellij.deps:trove4j:1.0.20181211.
298     Searched in the following locations:
299       - https://dl.google.com/dl/android/maven2/org/jetbrains/intellij/deps/trove4j/1.0.20181211/trove4j-1.0.20181211.pom
300     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
301     Required by:
302         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
303   Could not find xerces:xercesImpl:2.12.0.
304     Searched in the following locations:
305       - https://dl.google.com/dl/android/maven2/xerces/xercesImpl/2.12.0/xercesImpl-2.12.0.pom
306     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
307     Required by:
308         project : > com.android.tools.build:gradle:7.0.2 > com.android.tools:sdk-common:30.0.2
309   Could not find org.apache.commons:commons-compress:1.20.
310     Searched in the following locations:
311       - https://dl.google.com/dl/android/maven2/org/apache/commons/commons-compress/1.20/commons-compress-1.20.pom
312     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
313    repositories {
314        mavenCentral()
315        google()
316    }
317
318

Source https://stackoverflow.com/questions/69205327

QUESTION

Error: Requiring module "node_modules\react-native-reanimated\src\Animated.js",

Asked 2022-Feb-09 at 06:51

I am trying to use createDrawerNavigator from import { createDrawerNavigator } from '@react-navigation/drawer'; in react native. However, I am getting the error below, which I don't know how to solve.

Error: Requiring module "node_modules\react-native-reanimated\src\Animated.js", which threw an exception: Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin?

In babel.config.js I tried to add the below code but not working as well

1module.exports = function(api) {
2  api.cache(true);
3  return {
4    presets: ['babel-preset-expo'],
5    plugins: [
6      'react-native-reanimated/plugin',
7    ]
8  };
9};
10

Below is my component

1module.exports = function(api) {
2  api.cache(true);
3  return {
4    presets: ['babel-preset-expo'],
5    plugins: [
6      'react-native-reanimated/plugin',
7    ]
8  };
9};
10import * as React from 'react';
11import { Button, View } from 'react-native';
12import { createDrawerNavigator } from '@react-navigation/drawer';
13import { NavigationContainer } from '@react-navigation/native';
14
15function HomeScreen({ navigation }) {
16  return (
17    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
18      <Button
19        onPress={() => navigation.navigate('Notifications')}
20        title="Go to notifications"
21      />
22    </View>
23  );
24}
25
26function NotificationsScreen({ navigation }) {
27  return (
28    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
29      <Button onPress={() => navigation.goBack()} title="Go back home" />
30    </View>
31  );
32}
33
34const Drawer = createDrawerNavigator();
35
36export default function MyDrawer() {
37  return (
38    <NavigationContainer>
39      <Drawer.Navigator initialRouteName="Home">
40        <Drawer.Screen name="Home" component={HomeScreen} />
41        <Drawer.Screen name="Notifications" component={NotificationsScreen} />
42      </Drawer.Navigator>
43    </NavigationContainer>
44  );
45}
46

ANSWER

Answered 2021-Dec-31 at 10:32

Please complete the setup for react-native-reanimated. You have to add 'react-native-reanimated/plugin', in the babel.config.js file so the final code in babel.config.js will look like

1module.exports = function(api) {
2  api.cache(true);
3  return {
4    presets: ['babel-preset-expo'],
5    plugins: [
6      'react-native-reanimated/plugin',
7    ]
8  };
9};
10import * as React from 'react';
11import { Button, View } from 'react-native';
12import { createDrawerNavigator } from '@react-navigation/drawer';
13import { NavigationContainer } from '@react-navigation/native';
14
15function HomeScreen({ navigation }) {
16  return (
17    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
18      <Button
19        onPress={() => navigation.navigate('Notifications')}
20        title="Go to notifications"
21      />
22    </View>
23  );
24}
25
26function NotificationsScreen({ navigation }) {
27  return (
28    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
29      <Button onPress={() => navigation.goBack()} title="Go back home" />
30    </View>
31  );
32}
33
34const Drawer = createDrawerNavigator();
35
36export default function MyDrawer() {
37  return (
38    <NavigationContainer>
39      <Drawer.Navigator initialRouteName="Home">
40        <Drawer.Screen name="Home" component={HomeScreen} />
41        <Drawer.Screen name="Notifications" component={NotificationsScreen} />
42      </Drawer.Navigator>
43    </NavigationContainer>
44  );
45}
46module.exports = {
47      ...
48      plugins: [
49          ...
50          'react-native-reanimated/plugin',
51      ],
52  };
53

As state in the setup docs for react-native-reanimatedHere

Also you need to complete setup for android as well (if not done yet) as stated Here

If you are using expo then follow these steps

Finally, run expo r -c to clear the cache.

Source https://stackoverflow.com/questions/70516450

QUESTION

How to resolve React native navigation Error while installing version 6

Asked 2022-Feb-03 at 02:23

I just installed react navigation version 6 and i received below error

Attempt to invoke interface method boolean com.swmansion.reanimated.layoutReanimation.NativeMethodsHolder.isLayoutAnimationEnabled() on a null object referenceenter image description here

below is my code

1/**
2 * Sample React Native App
3 * https://github.com/facebook/react-native
4 *
5 * @format
6 * @flow strict-local
7 */
8import 'react-native-gesture-handler';
9import React from 'react';
10
11import {
12  SafeAreaView,
13  ScrollView,
14  StatusBar,
15  StyleSheet,
16  Text,
17  useColorScheme,
18  View,
19
20} from 'react-native';
21
22import { NavigationContainer } from '@react-navigation/native';
23import { createStackNavigator } from '@react-navigation/stack';
24
25import Upload from './Screens/Upload';
26import Display from './Screens/Display';
27
28const Stack = createStackNavigator()
29
30function App() {
31
32  return (
33    <NavigationContainer>
34      <Stack.Navigator>
35        <Stack.Screen
36        name='Screen_A'
37        component={Upload}
38        >
39
40
41        </Stack.Screen>
42        <Stack.Screen
43        name='Screen_B'
44        component={Display}
45        >
46
47
48        </Stack.Screen>
49      </Stack.Navigator>
50      
51
52    </NavigationContainer>
53
54  );
55};
56
57export default App;
58

this is first time i am using react-native and react-native navigation wish to build an app

ANSWER

Answered 2021-Dec-13 at 16:21

There are two ways to solve it.

in your json package there is a package named "react-native-reanimated": "^2.3.0", remove this package and install "react-native-reanimated": "^2.2.4"

and restart metro then build again

Second way

1° - Turn on Hermes engine by editing android/app/build.gradle

1/**
2 * Sample React Native App
3 * https://github.com/facebook/react-native
4 *
5 * @format
6 * @flow strict-local
7 */
8import 'react-native-gesture-handler';
9import React from 'react';
10
11import {
12  SafeAreaView,
13  ScrollView,
14  StatusBar,
15  StyleSheet,
16  Text,
17  useColorScheme,
18  View,
19
20} from 'react-native';
21
22import { NavigationContainer } from '@react-navigation/native';
23import { createStackNavigator } from '@react-navigation/stack';
24
25import Upload from './Screens/Upload';
26import Display from './Screens/Display';
27
28const Stack = createStackNavigator()
29
30function App() {
31
32  return (
33    <NavigationContainer>
34      <Stack.Navigator>
35        <Stack.Screen
36        name='Screen_A'
37        component={Upload}
38        >
39
40
41        </Stack.Screen>
42        <Stack.Screen
43        name='Screen_B'
44        component={Display}
45        >
46
47
48        </Stack.Screen>
49      </Stack.Navigator>
50      
51
52    </NavigationContainer>
53
54  );
55};
56
57export default App;
58project.ext.react = [
59  enableHermes: true  // <- here -- change false for true
60]
61

2° - Plug Reanimated in MainApplication.java

1/**
2 * Sample React Native App
3 * https://github.com/facebook/react-native
4 *
5 * @format
6 * @flow strict-local
7 */
8import 'react-native-gesture-handler';
9import React from 'react';
10
11import {
12  SafeAreaView,
13  ScrollView,
14  StatusBar,
15  StyleSheet,
16  Text,
17  useColorScheme,
18  View,
19
20} from 'react-native';
21
22import { NavigationContainer } from '@react-navigation/native';
23import { createStackNavigator } from '@react-navigation/stack';
24
25import Upload from './Screens/Upload';
26import Display from './Screens/Display';
27
28const Stack = createStackNavigator()
29
30function App() {
31
32  return (
33    <NavigationContainer>
34      <Stack.Navigator>
35        <Stack.Screen
36        name='Screen_A'
37        component={Upload}
38        >
39
40
41        </Stack.Screen>
42        <Stack.Screen
43        name='Screen_B'
44        component={Display}
45        >
46
47
48        </Stack.Screen>
49      </Stack.Navigator>
50      
51
52    </NavigationContainer>
53
54  );
55};
56
57export default App;
58project.ext.react = [
59  enableHermes: true  // <- here -- change false for true
60]
61android\app\src\main\java\com\<yourProjectName>\MainApplication.java
62
63  import com.facebook.react.bridge.JSIModulePackage; // <- add this
64  import com.swmansion.reanimated.ReanimatedJSIModulePackage; // <- add this
65  ...
66  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
67  ...
68
69      @Override
70      protected String getJSMainModuleName() {
71        return "index";
72      }
73// add more this "Override" below <----------------
74      @Override 
75      protected JSIModulePackage getJSIModulePackage() {
76        return new ReanimatedJSIModulePackage(); // <- add
77      }
78    };
79  ...
80

AFTER ALL PROCESS React Navigation Docs To finalize installation of react-native-gesture-handler, add the following at the top (make sure it's at the top and there's nothing else before it) of your entry file, such as index.js or App.js

import 'react-native-gesture-handler';

Save all and rebuild ( Android is: npx react-native run-android )

My package.json

"@react-navigation/drawer": "^6.1.8" "@react-navigation/native": "^6.0.6" "@react-navigation/native-stack": "^6.2.5" "react-native": "0.66.4" "react-native-gesture-handler": "^2.1.0"

i solved it using first way

Source https://stackoverflow.com/questions/70335156

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Navigation

Tutorials and Learning Resources are not available at this moment for Navigation

Share this Page

share link

Get latest updates on Navigation