Kotlin is a cross-platform, static, general-purpose language with type inference. Kotlin works fully with Java. JVM version of Kotlin's standard library depends on the Java Class Library. Additionally, type inference allows its syntax to be more concise than Java.

Popular New Releases in Kotlin

shadowsocks-android

v5.2.5

leakcanary

v2.9.1

fanqiang

ChromeGo一键翻墙包-ChromeGowindows版集成翻墙包

picasso

2.8

flexbox-layout

3.0.0

Popular Libraries in Kotlin

okhttp

by square doticonkotlindoticon

star image 41993 doticonApache-2.0

Square’s meticulous HTTP client for the JVM, Android, and GraalVM.

architecture-samples

by android doticonkotlindoticon

star image 40272 doticonApache-2.0

A collection of samples to discuss and showcase different architectural tools and patterns for Android apps.

shadowsocks-android

by shadowsocks doticonkotlindoticon

star image 31812 doticonNOASSERTION

A shadowsocks client for Android

leakcanary

by square doticonkotlindoticon

star image 27449 doticonApache-2.0

A memory leak detection library for Android.

p3c

by alibaba doticonkotlindoticon

star image 25678 doticonApache-2.0

Alibaba Java Coding Guidelines pmd implements and IDE plugin

fanqiang

by bannedbook doticonkotlindoticon

star image 23529 doticon

翻墙-科学上网

architecture-components-samples

by android doticonkotlindoticon

star image 21518 doticonApache-2.0

Samples for Android Architecture Components.

iosched

by google doticonkotlindoticon

star image 20748 doticonNOASSERTION

The Google I/O Android App

material-dialogs

by afollestad doticonkotlindoticon

star image 18809 doticonApache-2.0

😍 A beautiful, fluid, and extensible dialogs API for Kotlin & Android.

Trending New libraries in Kotlin

compose-jb

by JetBrains doticonkotlindoticon

star image 8605 doticonApache-2.0

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.

Pokedex

by skydoves doticonkotlindoticon

star image 5211 doticonApache-2.0

🗡️ Pokedex demonstrates modern Android development with Hilt, Material Motion, Coroutines, Flow, Jetpack (Room, ViewModel) based on MVVM architecture.

accompanist

by google doticonkotlindoticon

star image 4677 doticonApache-2.0

A collection of extension libraries for Jetpack Compose

VancedManager

by YTVanced doticonkotlindoticon

star image 4615 doticonGPL-3.0

Vanced Installer

androidx

by androidx doticonkotlindoticon

star image 3621 doticonApache-2.0

Development environment for Android Jetpack extension libraries under the androidx namespace. Synchronized with Android Jetpack's primary development branch on AOSP.

ComposeCookBook

by Gurupreet doticonkotlindoticon

star image 3241 doticonMIT

A Collection on all Jetpack compose UI elements, Layouts, Widgets and Demo screens to see it's potential

SagerNet

by SagerNet doticonkotlindoticon

star image 3212 doticonNOASSERTION

The universal proxy toolchain for Android

florisboard

by florisboard doticonkotlindoticon

star image 2610 doticonApache-2.0

An open-source keyboard for Android which respects your privacy. Currently in early-beta.

SpotiFlyer

by Shabinder doticonkotlindoticon

star image 2585 doticonGPL-3.0

Kotlin Multiplatform Music Downloader, Supports Spotify / Gaana / Youtube Music / Jio Saavn / SoundCloud. NOTE: BEING REWRITTEN, SO STAY TUNED.

Top Authors in Kotlin

1

navikt

381 Libraries

star icon233

2

aashaypawar

119 Libraries

star icon0

3

elye

116 Libraries

star icon1018

4

roynaldi19

100 Libraries

star icon0

5

atilsamancioglu

97 Libraries

star icon282

6

JetBrains

89 Libraries

star icon44149

7

metehanie

87 Libraries

star icon0

8

bearddan2000

86 Libraries

star icon0

9

jisungbin

76 Libraries

star icon315

10

wutsi

76 Libraries

star icon7

1

381 Libraries

star icon233

2

119 Libraries

star icon0

3

116 Libraries

star icon1018

4

100 Libraries

star icon0

5

97 Libraries

star icon282

6

89 Libraries

star icon44149

7

87 Libraries

star icon0

8

86 Libraries

star icon0

9

76 Libraries

star icon315

10

76 Libraries

star icon7

Trending Kits in Kotlin

Arrow utcnow is a Python function that returns the current time in UTC as an Arrow object. Arrow is a Python module that provides a simple and intuitive interface for date and time. 


Arrow objects are like Python’s built-in datetime objects but with extra functionality. It has an Extra Time Zone- awareness by default.   

   

The arrow utcnow() function generates timestamps for logging and debugging. It can use the () method to convert the UTC time to any other timezone.   

   

Key points of Arrow Utc now:   

  1. Order Entry: It explains that users can use the platform to enter various types of orders. These include market orders, limit orders, and stop orders.   
  2. Real-Time Market Data: The availability of real-time market data, including quotes and charts. To assist the users in making informed investment decisions.   
  3. Account Management: Those features related to portfolio overview, transaction history, and account customization.   
  4. Research Tools: The research tools available on the platform, such as financial reports. It supports the users in conducting thorough analyses.   
  5. Security Measures: Emphasize the security measures in place, including authentication and authorization processes. Also, ensure the safety of users' accounts and sensitive financial information.   

   

Benefits of Arrow utcnow:   

  • It highlights the advantages of using Arrow UTCNow.   
  • Convenient order execution and management.   
  • Access to real-time market information for timely decision-making.   
  • Comprehensive account management features for tracking portfolio performance.   
  • Research tools to aid in informed investment strategies.   

   

In conclusion, utilizing Arrow UTCNow is paramount to enhancing skills. The platform's array of features, including efficient order entry, and real-time market data. It provides users with invaluable tools for making informed investment decisions.   

   

Fig: Preview of the output that you will get on running this code from your IDE.

Code


In this solution we are using Py arrow of Python.

Instructions


Follow the steps carefully to get the output easily.


  1. Download and Install the PyCharm Community Edition on your computer.
  2. Open the terminal and install the required libraries with the following commands.
  3. Install Pyglet - pip install Pyglet.
  4. Create a new Python file on your IDE.
  5. Copy the snippet using the 'copy' button and paste it into your Python file.
  6. Run the current file to generate the output.



I hope you found this useful.


I found this code snippet by searching for 'How to get UTC from time zone?' in Kandi. You can try any such use case!

Environment Tested


I tested this solution in the following versions. Be mindful of changes when working with other versions.

  1. PyCharm Community Edition 2023.2
  2. The solution is created in Python 3.8 Version
  3. Py arrow 14.0.1 Version.


Using this solution, we can be able to use arrow utcnow function with simple steps. This process also facilities an easy way to use, hassle-free method to create a hands-on working version of code which would help us to use arrow.utcnow function.    

Dependent Library


You can search for any dependent library on kandi like 'arrow'.

FAQ:   

1. How does arrow utcnow work in Python's standard library?   

Arrow utcnow() is a method in the arrow library of Python. It returns the current UTC date and time as an Arrow object. The Arrow object is a replacement for the built-in datetime module in Python.   

   

2. What is the current UTC time, and how can I access it?   

Obtain the current UTC time using the datetime module in Python.   

Example:   

from datetime import datetime, timezone   

utc_time = datetime.now (timezone.UTC)   

print(utc_time)   

   

3. What type of date and time data does the arrow module accept?   

The Arrow module in Python works with date and time data. It provides an enhanced interface compared to the standard datetime module.   

  • Timestamps   
  • String Representations   
  • Relative Time   

   

4. What is Unix time, and why is it important to understand UTC time?   

Unix time, also known as Epoch time or POSIX time, is a system for tracking time as the number of seconds. The Unix epoch is defined as 00:00:00 Coordinated Universal Time (UTC) on January 1, 1970. In other words, Unix time represents the time elapsed in seconds.   

   

5. Do all time zones use the same timestamp conversions when converting to UTC or local times?   

The time zones use the same timestamp conversions when converting to UTC or local times. Time zones can have different offsets from Coordinated Universal Time. This can affect the conversion between timestamps in standard time and DST.   

  • Time Zone Offsets   
  • Daylight Saving Time (DST)   
  • Time Zone Changes   

  


Support


  1. For any support on kandi solution kits, please use the chat
  2. For further learning resources, visit the Open Weaver Community learning page


Trending Discussions on Kotlin

Unknown host CPU architecture: arm64 , Android NDK SiliconM1 Apple MacBook Pro

Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'

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

Error: MainActivity must extend android.app.Activity [Instantiatable]

Java, Intellij IDEA problem Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED

How do I resolve error message: "Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option"

Your project requires a newer version of the Kotlin Gradle plugin. (Android Studio)

Error when trying to run my React Native app on Android

What is the hot flow and cold flow in coroutines and the difference between them?

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

QUESTION

Unknown host CPU architecture: arm64 , Android NDK SiliconM1 Apple MacBook Pro

Asked 2022-Apr-04 at 18:41

I've got a project that is working fine in windows os but when I switched my laptop and opened an existing project in MacBook Pro M1. I'm unable to run an existing android project in MacBook pro M1. first I was getting

Execution failed for task ':app:kaptDevDebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution > java.lang.reflect.InvocationTargetException (no error message)

this error was due to the Room database I applied a fix that was adding below library before Room database and also changed my JDK location from file structure from JRE to JDK.

kapt "org.xerial:sqlite-jdbc:3.34.0"

1   //Room components
2    kapt "org.xerial:sqlite-jdbc:3.34.0"
3    implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4    kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5    androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6

after that now I'm getting an issue which is Unknown host CPU architecture: arm64

there is an SDK in my project that is using this below line.

1   //Room components
2    kapt "org.xerial:sqlite-jdbc:3.34.0"
3    implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4    kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5    androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7    externalNativeBuild {
8        ndkBuild {
9           path 'Android.mk'
10        }
11    }
12    ndkVersion '21.4.7075529'
13
14
15}
16

App Gradle

1   //Room components
2    kapt "org.xerial:sqlite-jdbc:3.34.0"
3    implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4    kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5    androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7    externalNativeBuild {
8        ndkBuild {
9           path 'Android.mk'
10        }
11    }
12    ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17        cmake {
18            path "src/main/cpp/CMakeLists.txt"
19            version "3.18.1"
20            //version "3.10.2"
21        }
22    }
23

[CXX1405] error when building with ndkBuild using /Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/Android.mk: Build command failed. Error while executing process /Users/mac/Library/Android/sdk/ndk/21.4.7075529/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/Android.mk APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=1 APP_PLATFORM=android-21 NDK_OUT=/Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/build/intermediates/cxx/Debug/4k4s2lc6/obj NDK_LIBS_OUT=/Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/build/intermediates/cxx/Debug/4k4s2lc6/lib APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n} ERROR: Unknown host CPU architecture: arm64

which is causing this issue and whenever I comment on this line

path 'Android.mk'

it starts working fine, is there any way around which will help me run this project with this piece of code without getting this NDK issue?

Update - It seems that Room got fixed in the latest updates, Therefore you may consider updating Room to latest version (2.3.0-alpha01 / 2.4.0-alpha03 or above)

GitHub Issue Tracker

ANSWER

Answered 2022-Apr-04 at 18:41

To solve this on a Apple Silicon M1 I found three options

A

Use NDK 24

1   //Room components
2    kapt "org.xerial:sqlite-jdbc:3.34.0"
3    implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4    kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5    androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7    externalNativeBuild {
8        ndkBuild {
9           path 'Android.mk'
10        }
11    }
12    ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17        cmake {
18            path "src/main/cpp/CMakeLists.txt"
19            version "3.18.1"
20            //version "3.10.2"
21        }
22    }
23android {
24    ndkVersion "24.0.8215888"
25    ...
26}
27

You can install it with

1   //Room components
2    kapt "org.xerial:sqlite-jdbc:3.34.0"
3    implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4    kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5    androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7    externalNativeBuild {
8        ndkBuild {
9           path 'Android.mk'
10        }
11    }
12    ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17        cmake {
18            path "src/main/cpp/CMakeLists.txt"
19            version "3.18.1"
20            //version "3.10.2"
21        }
22    }
23android {
24    ndkVersion "24.0.8215888"
25    ...
26}
27echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;24.0.8215888'
28

or

1   //Room components
2    kapt "org.xerial:sqlite-jdbc:3.34.0"
3    implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4    kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5    androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7    externalNativeBuild {
8        ndkBuild {
9           path 'Android.mk'
10        }
11    }
12    ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17        cmake {
18            path "src/main/cpp/CMakeLists.txt"
19            version "3.18.1"
20            //version "3.10.2"
21        }
22    }
23android {
24    ndkVersion "24.0.8215888"
25    ...
26}
27echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;24.0.8215888'
28echo "y" | sudo ${ANDROID_HOME}/sdk/cmdline-tools/latest/bin/sdkmanager --install 'ndk;24.0.8215888'
29

Depending what where sdkmanager is located enter image description here

B

Change your ndk-build to use Rosetta x86. Search for your installed ndk with

1   //Room components
2    kapt "org.xerial:sqlite-jdbc:3.34.0"
3    implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4    kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5    androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7    externalNativeBuild {
8        ndkBuild {
9           path 'Android.mk'
10        }
11    }
12    ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17        cmake {
18            path "src/main/cpp/CMakeLists.txt"
19            version "3.18.1"
20            //version "3.10.2"
21        }
22    }
23android {
24    ndkVersion "24.0.8215888"
25    ...
26}
27echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;24.0.8215888'
28echo "y" | sudo ${ANDROID_HOME}/sdk/cmdline-tools/latest/bin/sdkmanager --install 'ndk;24.0.8215888'
29find ~ -name ndk-build 2>/dev/null
30

eg

1   //Room components
2    kapt "org.xerial:sqlite-jdbc:3.34.0"
3    implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4    kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5    androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7    externalNativeBuild {
8        ndkBuild {
9           path 'Android.mk'
10        }
11    }
12    ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17        cmake {
18            path "src/main/cpp/CMakeLists.txt"
19            version "3.18.1"
20            //version "3.10.2"
21        }
22    }
23android {
24    ndkVersion "24.0.8215888"
25    ...
26}
27echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;24.0.8215888'
28echo "y" | sudo ${ANDROID_HOME}/sdk/cmdline-tools/latest/bin/sdkmanager --install 'ndk;24.0.8215888'
29find ~ -name ndk-build 2>/dev/null
30vi ~/Library/Android/sdk/ndk/22.1.7171670/ndk-build
31

and change

1   //Room components
2    kapt "org.xerial:sqlite-jdbc:3.34.0"
3    implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4    kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5    androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7    externalNativeBuild {
8        ndkBuild {
9           path 'Android.mk'
10        }
11    }
12    ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17        cmake {
18            path "src/main/cpp/CMakeLists.txt"
19            version "3.18.1"
20            //version "3.10.2"
21        }
22    }
23android {
24    ndkVersion "24.0.8215888"
25    ...
26}
27echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;24.0.8215888'
28echo "y" | sudo ${ANDROID_HOME}/sdk/cmdline-tools/latest/bin/sdkmanager --install 'ndk;24.0.8215888'
29find ~ -name ndk-build 2>/dev/null
30vi ~/Library/Android/sdk/ndk/22.1.7171670/ndk-build
31DIR="$(cd "$(dirname "$0")" && pwd)"
32$DIR/build/ndk-build "$@"
33

to

1   //Room components
2    kapt "org.xerial:sqlite-jdbc:3.34.0"
3    implementation "androidx.room:room-ktx:$rootProject.roomVersion"
4    kapt "androidx.room:room-compiler:$rootProject.roomVersion"
5    androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
6android {
7    externalNativeBuild {
8        ndkBuild {
9           path 'Android.mk'
10        }
11    }
12    ndkVersion '21.4.7075529'
13
14
15}
16 externalNativeBuild {
17        cmake {
18            path "src/main/cpp/CMakeLists.txt"
19            version "3.18.1"
20            //version "3.10.2"
21        }
22    }
23android {
24    ndkVersion "24.0.8215888"
25    ...
26}
27echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;24.0.8215888'
28echo "y" | sudo ${ANDROID_HOME}/sdk/cmdline-tools/latest/bin/sdkmanager --install 'ndk;24.0.8215888'
29find ~ -name ndk-build 2>/dev/null
30vi ~/Library/Android/sdk/ndk/22.1.7171670/ndk-build
31DIR="$(cd "$(dirname "$0")" && pwd)"
32$DIR/build/ndk-build "$@"
33DIR="$(cd "$(dirname "$0")" && pwd)"
34arch -x86_64 /bin/bash $DIR/build/ndk-build "$@"
35

enter image description here

C

convert your ndk-build into a cmake build

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

QUESTION

Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'

Asked 2022-Apr-04 at 13:12

I want to add jitpack.io as a repository in my gradle file. This is my gradle root file:

1buildscript {
2    repositories {
3        google()
4        mavenCentral()
5    }
6    dependencies {
7        classpath "com.android.tools.build:gradle:7.0.2"
8        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"
9
10        classpath 'com.google.dagger:hilt-android-gradle-plugin:2.38.1'
11
12        // NOTE: Do not place your application dependencies here; they belong
13        // in the individual module build.gradle files
14    }
15}
16task clean(type: Delete) {
17    delete rootProject.buildDir
18}
19

Since I DON'T have a "allrepositories" to put my dependency there (only works there), I've created and added this code after buildscript code:

1buildscript {
2    repositories {
3        google()
4        mavenCentral()
5    }
6    dependencies {
7        classpath "com.android.tools.build:gradle:7.0.2"
8        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"
9
10        classpath 'com.google.dagger:hilt-android-gradle-plugin:2.38.1'
11
12        // NOTE: Do not place your application dependencies here; they belong
13        // in the individual module build.gradle files
14    }
15}
16task clean(type: Delete) {
17    delete rootProject.buildDir
18}
19allprojects {
20    repositories {
21        maven {url 'https://www.jitpack.io'}
22    }
23}
24

But this is the error I get

1buildscript {
2    repositories {
3        google()
4        mavenCentral()
5    }
6    dependencies {
7        classpath "com.android.tools.build:gradle:7.0.2"
8        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"
9
10        classpath 'com.google.dagger:hilt-android-gradle-plugin:2.38.1'
11
12        // NOTE: Do not place your application dependencies here; they belong
13        // in the individual module build.gradle files
14    }
15}
16task clean(type: Delete) {
17    delete rootProject.buildDir
18}
19allprojects {
20    repositories {
21        maven {url 'https://www.jitpack.io'}
22    }
23}
24Caused by: org.gradle.api.InvalidUserCodeException: Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'
25

ANSWER

Answered 2021-Sep-16 at 11:02

Android introduced a new way to define repositories.

Remove the dependencyResolutionManagement block from the setting.gradle file to have your project work the old way.

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

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

Error: MainActivity must extend android.app.Activity [Instantiatable]

Asked 2022-Mar-31 at 02:13

I tried upgrading Android Gradle Plugin from 4.2.2 to 7.0.1 using the upgrade assistant which is available in Android Studio at Tools > AGP Upgrade Assistant. The only change it made was to my project-level build.gradle file:

1buildscript {
2    repositories {
3        google()
4        mavenCentral()
5    }
6    dependencies {
7        classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8        // ...
9    }
10}
11

However, now when I run ./gradlew assemble assembleAndroidTest I get the following error:

1buildscript {
2    repositories {
3        google()
4        mavenCentral()
5    }
6    dependencies {
7        classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8        // ...
9    }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12            android:name="com.locuslabs.appsdk.MainActivity"
13                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14   Explanation for issues of type "Instantiatable":
15   Activities, services, broadcast receivers etc. registered in the manifest
16   file (or for custom views, in a layout file) must be "instantiatable" by
17   the system, which means that the class must be public, it must have an
18   empty public constructor, and if it's an inner class, it must be a static
19   inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25    lintOptions {
26        checkReleaseBuilds false
27        // Or, if you prefer, you can continue to check for errors in release builds,
28        // but continue the build even when errors are found:
29        abortOnError false
30    }
31}
32

My project is multi-module, but I don't suspect that as the problem since it's complaining about the application module, not a library module.

I believe my <activity> tag is well formed in my AndroidManifest.xml for my application module:

1buildscript {
2    repositories {
3        google()
4        mavenCentral()
5    }
6    dependencies {
7        classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8        // ...
9    }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12            android:name=&quot;com.locuslabs.appsdk.MainActivity&quot;
13                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14   Explanation for issues of type &quot;Instantiatable&quot;:
15   Activities, services, broadcast receivers etc. registered in the manifest
16   file (or for custom views, in a layout file) must be &quot;instantiatable&quot; by
17   the system, which means that the class must be public, it must have an
18   empty public constructor, and if it's an inner class, it must be a static
19   inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25    lintOptions {
26        checkReleaseBuilds false
27        // Or, if you prefer, you can continue to check for errors in release builds,
28        // but continue the build even when errors are found:
29        abortOnError false
30    }
31}
32        &lt;activity
33            android:name=&quot;com.locuslabs.appsdk.MainActivity&quot;
34            android:label=&quot;@string/app_name&quot;
35            android:windowSoftInputMode=&quot;adjustNothing&quot;&gt;
36            &lt;intent-filter&gt;
37                &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
38
39                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
40            &lt;/intent-filter&gt;
41        &lt;/activity&gt;
42

Furthermore, I don't think there is anything wrong with extending AppCompatActivity instead of android.app.Activity as I'm doing in my MainActivity.kt:

1buildscript {
2    repositories {
3        google()
4        mavenCentral()
5    }
6    dependencies {
7        classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8        // ...
9    }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12            android:name=&quot;com.locuslabs.appsdk.MainActivity&quot;
13                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14   Explanation for issues of type &quot;Instantiatable&quot;:
15   Activities, services, broadcast receivers etc. registered in the manifest
16   file (or for custom views, in a layout file) must be &quot;instantiatable&quot; by
17   the system, which means that the class must be public, it must have an
18   empty public constructor, and if it's an inner class, it must be a static
19   inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25    lintOptions {
26        checkReleaseBuilds false
27        // Or, if you prefer, you can continue to check for errors in release builds,
28        // but continue the build even when errors are found:
29        abortOnError false
30    }
31}
32        &lt;activity
33            android:name=&quot;com.locuslabs.appsdk.MainActivity&quot;
34            android:label=&quot;@string/app_name&quot;
35            android:windowSoftInputMode=&quot;adjustNothing&quot;&gt;
36            &lt;intent-filter&gt;
37                &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
38
39                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
40            &lt;/intent-filter&gt;
41        &lt;/activity&gt;
42import androidx.appcompat.app.AppCompatActivity
43
44class MainActivity : AppCompatActivity() {
45    // ...
46}
47

I'm concerned that Android Gradle Plugin 7.0.1 is not really ready for prime-time because the Android Gradle Plugin documentation still says classpath 'com.android.tools.build:gradle:4.2.0' instead of 7.0.1.

I saw that the Android Gradle Plugin 7.0.1 release notes mentioned some changes to linting but none of those changes seemed relevant to me.

I also skimmed through the Android Gradle Plugin source code to see if I could find the linting stage any identify any changes but it looked like a lot of work to find that code and do that analysis.

I searched for answers but all I could find were these two stackoverflow entries where the error was legitimate and the programmer just needed to change their code to ensure they were referencing an actual Activity:

  1. Android Studio Error: Activity must extend android.app.activity
  2. MainActivity cannot be cast to android.app.Activity

I also tried Android Gradle Plugin 7.0.0 but got the same error. Only Android Gradle Plugin 4.2.2 prevents the error.

Is this a bug in Android Gradle Plugin 7.0.1?

Update: could not disable Instantiatable

I tried to disable the Instantiatable lint error the following ways but none of them prevented the error.

First, I tried adding disable "Instantiatable" to my application-level build.gradle file:

1buildscript {
2    repositories {
3        google()
4        mavenCentral()
5    }
6    dependencies {
7        classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8        // ...
9    }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12            android:name=&quot;com.locuslabs.appsdk.MainActivity&quot;
13                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14   Explanation for issues of type &quot;Instantiatable&quot;:
15   Activities, services, broadcast receivers etc. registered in the manifest
16   file (or for custom views, in a layout file) must be &quot;instantiatable&quot; by
17   the system, which means that the class must be public, it must have an
18   empty public constructor, and if it's an inner class, it must be a static
19   inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25    lintOptions {
26        checkReleaseBuilds false
27        // Or, if you prefer, you can continue to check for errors in release builds,
28        // but continue the build even when errors are found:
29        abortOnError false
30    }
31}
32        &lt;activity
33            android:name=&quot;com.locuslabs.appsdk.MainActivity&quot;
34            android:label=&quot;@string/app_name&quot;
35            android:windowSoftInputMode=&quot;adjustNothing&quot;&gt;
36            &lt;intent-filter&gt;
37                &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
38
39                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
40            &lt;/intent-filter&gt;
41        &lt;/activity&gt;
42import androidx.appcompat.app.AppCompatActivity
43
44class MainActivity : AppCompatActivity() {
45    // ...
46}
47android {
48    lintOptions {
49        disable &quot;Instantiatable&quot;
50    }
51}
52

Second, I tried prepending @SdkSuppress("Instantiatable") to the class:

1buildscript {
2    repositories {
3        google()
4        mavenCentral()
5    }
6    dependencies {
7        classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8        // ...
9    }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12            android:name=&quot;com.locuslabs.appsdk.MainActivity&quot;
13                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14   Explanation for issues of type &quot;Instantiatable&quot;:
15   Activities, services, broadcast receivers etc. registered in the manifest
16   file (or for custom views, in a layout file) must be &quot;instantiatable&quot; by
17   the system, which means that the class must be public, it must have an
18   empty public constructor, and if it's an inner class, it must be a static
19   inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25    lintOptions {
26        checkReleaseBuilds false
27        // Or, if you prefer, you can continue to check for errors in release builds,
28        // but continue the build even when errors are found:
29        abortOnError false
30    }
31}
32        &lt;activity
33            android:name=&quot;com.locuslabs.appsdk.MainActivity&quot;
34            android:label=&quot;@string/app_name&quot;
35            android:windowSoftInputMode=&quot;adjustNothing&quot;&gt;
36            &lt;intent-filter&gt;
37                &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
38
39                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
40            &lt;/intent-filter&gt;
41        &lt;/activity&gt;
42import androidx.appcompat.app.AppCompatActivity
43
44class MainActivity : AppCompatActivity() {
45    // ...
46}
47android {
48    lintOptions {
49        disable &quot;Instantiatable&quot;
50    }
51}
52@SdkSuppress(&quot;Instantiatable&quot;)
53class MainActivity : AppCompatActivity() {
54   // ...
55}
56

Similarly, I tried @SuppressLint("Instantiatable") but that didn't work either.

ANSWER

Answered 2021-Aug-24 at 16:35

the Android Gradle Plugin documentation still says classpath 'com.android.tools.build:gradle:4.2.0' instead of 7.0.1.

You need to read further down the page, to this and this. That table is only relevant for pre-7.0.0 versions.

Is this a bug in Android Gradle Plugin 7.0.1?

Quite possibly. Or, perhaps beyond, as the Instantiatable Lint check has a history of problems.

If your scenario does not match one of those three August 2021 bugs, and you are in position to provide a reproducible test case, file a fresh issue! Beyond that, if a clean-and-rebuild is not clearing up your problem, you might need to simply disable the Instantiatable Lint check for the time being by adding the following to all of your build.gradle files at the application or library level (i.e. all except your project-level build.gradle):

1buildscript {
2    repositories {
3        google()
4        mavenCentral()
5    }
6    dependencies {
7        classpath 'com.android.tools.build:gradle:7.0.1' // changed from 4.2.2 to 7.0.1
8        // ...
9    }
10}
11/builds/locuslabs/android-team/locuslabs-android-sdk/app/src/main/AndroidManifest.xml:21: Error: MainActivity must extend android.app.Activity [Instantiatable]
12            android:name=&quot;com.locuslabs.appsdk.MainActivity&quot;
13                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14   Explanation for issues of type &quot;Instantiatable&quot;:
15   Activities, services, broadcast receivers etc. registered in the manifest
16   file (or for custom views, in a layout file) must be &quot;instantiatable&quot; by
17   the system, which means that the class must be public, it must have an
18   empty public constructor, and if it's an inner class, it must be a static
19   inner class.
201 errors, 0 warnings
21Lint found fatal errors while assembling a release target.
22To proceed, either fix the issues identified by lint, or modify your build script as follows:
23...
24android {
25    lintOptions {
26        checkReleaseBuilds false
27        // Or, if you prefer, you can continue to check for errors in release builds,
28        // but continue the build even when errors are found:
29        abortOnError false
30    }
31}
32        &lt;activity
33            android:name=&quot;com.locuslabs.appsdk.MainActivity&quot;
34            android:label=&quot;@string/app_name&quot;
35            android:windowSoftInputMode=&quot;adjustNothing&quot;&gt;
36            &lt;intent-filter&gt;
37                &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
38
39                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
40            &lt;/intent-filter&gt;
41        &lt;/activity&gt;
42import androidx.appcompat.app.AppCompatActivity
43
44class MainActivity : AppCompatActivity() {
45    // ...
46}
47android {
48    lintOptions {
49        disable &quot;Instantiatable&quot;
50    }
51}
52@SdkSuppress(&quot;Instantiatable&quot;)
53class MainActivity : AppCompatActivity() {
54   // ...
55}
56android {
57    lintOptions {
58        disable &quot;Instantiatable&quot;
59    }
60}
61

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

QUESTION

Java, Intellij IDEA problem Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED

Asked 2022-Mar-26 at 15:23

I have newly installed

1IntelliJ IDEA 2021.2 (Ultimate Edition)
2Build #IU-212.4746.92, built on July 27, 2021
3Licensed to XXXXXX
4Subscription is active until August 15, 2021.
5Runtime version: 11.0.11+9-b1504.13 amd64
6VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
7Linux 5.4.0-80-generic
8GC: G1 Young Generation, G1 Old Generation
9Memory: 2048M
10Cores: 3
11
12Kotlin: 212-1.5.10-release-IJ4746.92
13Current Desktop: X-Cinnamon
14

I cloned project I work with on other workstation without issues, but cannot start any class with main method and IDEA says:

1IntelliJ IDEA 2021.2 (Ultimate Edition)
2Build #IU-212.4746.92, built on July 27, 2021
3Licensed to XXXXXX
4Subscription is active until August 15, 2021.
5Runtime version: 11.0.11+9-b1504.13 amd64
6VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
7Linux 5.4.0-80-generic
8GC: G1 Young Generation, G1 Old Generation
9Memory: 2048M
10Cores: 3
11
12Kotlin: 212-1.5.10-release-IJ4746.92
13Current Desktop: X-Cinnamon
14Abnormal build process termination: 
15/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java -Xmx700m -Djava.awt.headless=true -Djava.endorsed.dirs=\&quot;\&quot; -Dcompile.parallel=false -Drebuild.on.dependency.change=true -Djdt.compiler.useSingleThread=true -Daether.connector.resumeDownloads=false -Dio.netty.initialSeedUniquifier=-5972351880001011455 -Dfile.encoding=UTF-8 -Duser.language=en -Duser.country=US -Didea.paths.selector=IntelliJIdea2021.2 -Didea.home.path=/home/pm/idea-IU-212.4746.92 -Didea.config.path=/home/pm/.config/JetBrains/IntelliJIdea2021.2 -Didea.plugins.path=/home/pm/.local/share/JetBrains/IntelliJIdea2021.2 -Djps.log.dir=/home/pm/.cache/JetBrains/IntelliJIdea2021.2/log/build-log -Djps.fallback.jdk.home=/home/pm/idea-IU-212.4746.92/jbr -Djps.fallback.jdk.version=11.0.11 -Dio.netty.noUnsafe=true -Djava.io.tmpdir=/home/pm/.cache/JetBrains/IntelliJIdea2021.2/compile-server/rfg-survey-api_cc70fc05/_temp_ -Djps.backward.ref.index.builder=true -Djps.track.ap.dependencies=false --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED -Dtmh.instrument.annotations=true -Dtmh.generate.line.numbers=true -Dkotlin.incremental.compilation=true -Dkotlin.incremental.compilation.js=true -Dkotlin.daemon.enabled -Dkotlin.daemon.client.alive.path=\&quot;/tmp/kotlin-idea-12426594439704512301-is-running\&quot; -classpath /home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-launcher.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/lib/tools.jar org.jetbrains.jps.cmdline.Launcher /home/pm/idea-IU-212.4746.92/lib/slf4j.jar:/home/pm/idea-IU-212.4746.92/lib/idea_rt.jar:/home/pm/idea-IU-212.4746.92/lib/platform-api.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/maven-resolver-transport-file-1.3.3.jar:/home/pm/idea-IU-212.4746.92/lib/forms_rt.jar:/home/pm/idea-IU-212.4746.92/lib/util.jar:/home/pm/idea-IU-212.4746.92/lib/annotations.jar:/home/pm/idea-IU-212.4746.92/lib/3rd-party.jar:/home/pm/idea-IU-212.4746.92/lib/kotlin-stdlib-jdk8.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/maven-resolver-connector-basic-1.3.3.jar:/home/pm/idea-IU-212.4746.92/lib/jna-platform.jar:/home/pm/idea-IU-212.4746.92/lib/protobuf-java-3.15.8.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-builders-6.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/javac2.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/aether-dependency-resolver.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-builders.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-javac-extension-1.jar:/home/pm/idea-IU-212.4746.92/lib/jna.jar:/home/pm/idea-IU-212.4746.92/lib/jps-model.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/maven-resolver-transport-http-1.3.3.jar:/home/pm/idea-IU-212.4746.92/plugins/JavaEE/lib/jasper-v2-rt.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-reflect.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-plugin.jar:/home/pm/idea-IU-212.4746.92/plugins/ant/lib/ant-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/uiDesigner/lib/jps/java-guiForms-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/eclipse/lib/eclipse-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/eclipse/lib/eclipse-common.jar:/home/pm/idea-IU-212.4746.92/plugins/IntelliLang/lib/java-langInjection-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Groovy/lib/groovy-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Groovy/lib/groovy-constants-rt.jar:/home/pm/idea-IU-212.4746.92/plugins/maven/lib/maven-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/gradle-java/lib/gradle-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/devkit/lib/devkit-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/javaFX/lib/javaFX-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/javaFX/lib/javaFX-common.jar:/home/pm/idea-IU-212.4746.92/plugins/JavaEE/lib/javaee-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/webSphereIntegration/lib/jps/javaee-appServers-websphere-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/weblogicIntegration/lib/jps/javaee-appServers-weblogic-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/JPA/lib/jps/javaee-jpa-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Grails/lib/groovy-grails-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Grails/lib/groovy-grails-compilerPatch.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-jps-common.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-common.jar org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 34781 9f0681bb-da2a-48db-8344-900ddeb29804 /home/pm/.cache/JetBrains/IntelliJIdea2021.2/compile-server
16Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
17Error: Could not create the Java Virtual Machine.
18Error: A fatal exception has occurred. Program will exit.
19

I found other comment to check Lombok works and I see it is fine.

How to fix the problem?

ANSWER

Answered 2021-Jul-28 at 07:22

You are running the project via Java 1.8 and add the --add-opens option to the runner. However Java 1.8 does not support it.

So, the first option is to use Java 11 to run the project, as Java 11 can recognize this VM option.

Another solution is to find a place where --add-opens is added and remove it. Check Run configuration in IntelliJ IDEA (VM options field) and Maven/Gradle configuration files for argLine (Maven) and jvmArgs (Gradle)

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

QUESTION

How do I resolve error message: &quot;Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option&quot;

Asked 2022-Mar-19 at 21:08

I'm new to Android development and I'm currently building my first real app. I'm trying to implement a MVVM architecture and because of that I'm having a viewModel for each fragment and each viewModel has a viewModelFactory. At least, this is how I understood it has to be.

I use the boilerplate code everyone seems to use for the factory:

1class ExampleViewModelFactory(private val exampleDao: ExampleDao) : ViewModelProvider.Factory {
2    override fun &lt;T : ViewModel&gt; create(modelClass: Class&lt;T&gt;): T {
3        if (modelClass.isAssignableFrom(exampleViewModel::class.java)) {
4            @Suppress(&quot;UNCHECKED_CAST&quot;)
5            return ExampleViewModel(exampleDao) as T
6        }
7        throw IllegalArgumentException(&quot;Unknown ViewModel class&quot;)
8    }
9}
10

Now the problem is, that the compiler is giving me the following error:

e: C:\Users\ ...\ExampleViewModel.kt: (64, 7): Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option

And this error is produced by the viewModelFactory class I have implemented in the viewModel. I really can't tell what this means and I cant find anything helpful or even related to my specific problem. I basically followed some basic tutorials about creating your first app, but I keep on running into errors like this. In most cases, I was able to fix the problem by myself, but this time it's different.

I know that a lot of you have a lot of experience and knowledge, so I hope that some of you find the time to help me and give me a hint what I can do to fix this.

ANSWER

Answered 2022-Feb-25 at 16:53

It seems like you are either directly or indirectly (through some other library) depending on Lifecycle 2.5.0-alpha01.

As per this issue:

You need to temporarily add following to your build.gradle:

1class ExampleViewModelFactory(private val exampleDao: ExampleDao) : ViewModelProvider.Factory {
2    override fun &lt;T : ViewModel&gt; create(modelClass: Class&lt;T&gt;): T {
3        if (modelClass.isAssignableFrom(exampleViewModel::class.java)) {
4            @Suppress(&quot;UNCHECKED_CAST&quot;)
5            return ExampleViewModel(exampleDao) as T
6        }
7        throw IllegalArgumentException(&quot;Unknown ViewModel class&quot;)
8    }
9}
10tasks.withType(KotlinCompile).configureEach {
11    kotlinOptions {
12        freeCompilerArgs += [
13                &quot;-Xjvm-default=all&quot;,
14        ]
15    }
16}
17

Note that in certain circumstances you may want to use all-compatibility instead of all, learn more about that in Jebrain's blogpost.

Starting with kotlin 1.6.20 you won't need touch build.gradle for more information see KT-47000

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

QUESTION

Your project requires a newer version of the Kotlin Gradle plugin. (Android Studio)

Asked 2022-Mar-17 at 15:50

I've just updated my flutter project packages to be null-safety compliant and now Android Studio wants me to update my project to use the latest version of Kotling Gradle Plugin. Can't see where to change this though. I have tried to change "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" into "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10" but this has no effect.

My build.grade-file looks like this:

1def localProperties = new Properties()
2def localPropertiesFile = rootProject.file('local.properties')
3if (localPropertiesFile.exists()) {
4    localPropertiesFile.withReader('UTF-8') { reader -&gt;
5        localProperties.load(reader)
6    }
7}
8
9def flutterRoot = localProperties.getProperty('flutter.sdk')
10if (flutterRoot == null) {
11    throw new GradleException(&quot;Flutter SDK not found. Define location with flutter.sdk in the local.properties file.&quot;)
12}
13
14def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15if (flutterVersionCode == null) {
16    flutterVersionCode = '1'
17}
18
19def flutterVersionName = localProperties.getProperty('flutter.versionName')
20if (flutterVersionName == null) {
21    flutterVersionName = '1.0'
22}
23
24apply plugin: 'com.android.application'
25apply plugin: 'kotlin-android'
26apply from: &quot;$flutterRoot/packages/flutter_tools/gradle/flutter.gradle&quot;
27
28def keystoreProperties = new Properties()
29def keystorePropertiesFile = rootProject.file('key.properties')
30if (keystorePropertiesFile.exists()) {
31    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32}
33
34android {
35    compileSdkVersion 31
36
37    sourceSets {
38        main.java.srcDirs += 'src/main/kotlin'
39    }
40
41    lintOptions {
42        disable 'InvalidPackage'
43    }
44
45    defaultConfig {
46        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47        applicationId &quot;*********&quot;
48        minSdkVersion 30
49        targetSdkVersion 30
50        versionCode flutterVersionCode.toInteger()
51        versionName flutterVersionName
52        testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
53    }
54
55
56
57    signingConfigs {
58        release {
59            keyAlias keystoreProperties['keyAlias']
60            keyPassword keystoreProperties['keyPassword']
61            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
62            storePassword keystoreProperties['storePassword']
63        }
64    }
65    buildTypes {
66        release {
67            signingConfig signingConfigs.release
68        }
69    }
70
71}
72
73flutter {
74    source '../..'
75}
76
77dependencies {
78    implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
79    testImplementation 'junit:junit:4.12'
80    androidTestImplementation 'androidx.test:runner:1.1.1'
81    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
82    implementation 'com.google.firebase:firebase-analytics:17.2.2'
83}
84apply plugin: 'com.google.gms.google-services'
85

Build output:

1def localProperties = new Properties()
2def localPropertiesFile = rootProject.file('local.properties')
3if (localPropertiesFile.exists()) {
4    localPropertiesFile.withReader('UTF-8') { reader -&gt;
5        localProperties.load(reader)
6    }
7}
8
9def flutterRoot = localProperties.getProperty('flutter.sdk')
10if (flutterRoot == null) {
11    throw new GradleException(&quot;Flutter SDK not found. Define location with flutter.sdk in the local.properties file.&quot;)
12}
13
14def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15if (flutterVersionCode == null) {
16    flutterVersionCode = '1'
17}
18
19def flutterVersionName = localProperties.getProperty('flutter.versionName')
20if (flutterVersionName == null) {
21    flutterVersionName = '1.0'
22}
23
24apply plugin: 'com.android.application'
25apply plugin: 'kotlin-android'
26apply from: &quot;$flutterRoot/packages/flutter_tools/gradle/flutter.gradle&quot;
27
28def keystoreProperties = new Properties()
29def keystorePropertiesFile = rootProject.file('key.properties')
30if (keystorePropertiesFile.exists()) {
31    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32}
33
34android {
35    compileSdkVersion 31
36
37    sourceSets {
38        main.java.srcDirs += 'src/main/kotlin'
39    }
40
41    lintOptions {
42        disable 'InvalidPackage'
43    }
44
45    defaultConfig {
46        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47        applicationId &quot;*********&quot;
48        minSdkVersion 30
49        targetSdkVersion 30
50        versionCode flutterVersionCode.toInteger()
51        versionName flutterVersionName
52        testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
53    }
54
55
56
57    signingConfigs {
58        release {
59            keyAlias keystoreProperties['keyAlias']
60            keyPassword keystoreProperties['keyPassword']
61            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
62            storePassword keystoreProperties['storePassword']
63        }
64    }
65    buildTypes {
66        release {
67            signingConfig signingConfigs.release
68        }
69    }
70
71}
72
73flutter {
74    source '../..'
75}
76
77dependencies {
78    implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
79    testImplementation 'junit:junit:4.12'
80    androidTestImplementation 'androidx.test:runner:1.1.1'
81    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
82    implementation 'com.google.firebase:firebase-analytics:17.2.2'
83}
84apply plugin: 'com.google.gms.google-services'
85BUILD FAILED in 8s
86[!] Your project requires a newer version of the Kotlin Gradle plugin.
87    Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update project/android/build.gradle:
88    ext.kotlin_version = '&lt;latest-version&gt;'
89Exception: Gradle task assembleDebug failed with exit code 1
90

ANSWER

Answered 2022-Jan-30 at 21:52

change build gradle to this :

1def localProperties = new Properties()
2def localPropertiesFile = rootProject.file('local.properties')
3if (localPropertiesFile.exists()) {
4    localPropertiesFile.withReader('UTF-8') { reader -&gt;
5        localProperties.load(reader)
6    }
7}
8
9def flutterRoot = localProperties.getProperty('flutter.sdk')
10if (flutterRoot == null) {
11    throw new GradleException(&quot;Flutter SDK not found. Define location with flutter.sdk in the local.properties file.&quot;)
12}
13
14def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15if (flutterVersionCode == null) {
16    flutterVersionCode = '1'
17}
18
19def flutterVersionName = localProperties.getProperty('flutter.versionName')
20if (flutterVersionName == null) {
21    flutterVersionName = '1.0'
22}
23
24apply plugin: 'com.android.application'
25apply plugin: 'kotlin-android'
26apply from: &quot;$flutterRoot/packages/flutter_tools/gradle/flutter.gradle&quot;
27
28def keystoreProperties = new Properties()
29def keystorePropertiesFile = rootProject.file('key.properties')
30if (keystorePropertiesFile.exists()) {
31    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32}
33
34android {
35    compileSdkVersion 31
36
37    sourceSets {
38        main.java.srcDirs += 'src/main/kotlin'
39    }
40
41    lintOptions {
42        disable 'InvalidPackage'
43    }
44
45    defaultConfig {
46        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47        applicationId &quot;*********&quot;
48        minSdkVersion 30
49        targetSdkVersion 30
50        versionCode flutterVersionCode.toInteger()
51        versionName flutterVersionName
52        testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
53    }
54
55
56
57    signingConfigs {
58        release {
59            keyAlias keystoreProperties['keyAlias']
60            keyPassword keystoreProperties['keyPassword']
61            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
62            storePassword keystoreProperties['storePassword']
63        }
64    }
65    buildTypes {
66        release {
67            signingConfig signingConfigs.release
68        }
69    }
70
71}
72
73flutter {
74    source '../..'
75}
76
77dependencies {
78    implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
79    testImplementation 'junit:junit:4.12'
80    androidTestImplementation 'androidx.test:runner:1.1.1'
81    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
82    implementation 'com.google.firebase:firebase-analytics:17.2.2'
83}
84apply plugin: 'com.google.gms.google-services'
85BUILD FAILED in 8s
86[!] Your project requires a newer version of the Kotlin Gradle plugin.
87    Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update project/android/build.gradle:
88    ext.kotlin_version = '&lt;latest-version&gt;'
89Exception: Gradle task assembleDebug failed with exit code 1
90classpath 'com.android.tools.build:gradle:4.1.0'
91

and gradle-wrapper to this :

1def localProperties = new Properties()
2def localPropertiesFile = rootProject.file('local.properties')
3if (localPropertiesFile.exists()) {
4    localPropertiesFile.withReader('UTF-8') { reader -&gt;
5        localProperties.load(reader)
6    }
7}
8
9def flutterRoot = localProperties.getProperty('flutter.sdk')
10if (flutterRoot == null) {
11    throw new GradleException(&quot;Flutter SDK not found. Define location with flutter.sdk in the local.properties file.&quot;)
12}
13
14def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15if (flutterVersionCode == null) {
16    flutterVersionCode = '1'
17}
18
19def flutterVersionName = localProperties.getProperty('flutter.versionName')
20if (flutterVersionName == null) {
21    flutterVersionName = '1.0'
22}
23
24apply plugin: 'com.android.application'
25apply plugin: 'kotlin-android'
26apply from: &quot;$flutterRoot/packages/flutter_tools/gradle/flutter.gradle&quot;
27
28def keystoreProperties = new Properties()
29def keystorePropertiesFile = rootProject.file('key.properties')
30if (keystorePropertiesFile.exists()) {
31    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32}
33
34android {
35    compileSdkVersion 31
36
37    sourceSets {
38        main.java.srcDirs += 'src/main/kotlin'
39    }
40
41    lintOptions {
42        disable 'InvalidPackage'
43    }
44
45    defaultConfig {
46        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47        applicationId &quot;*********&quot;
48        minSdkVersion 30
49        targetSdkVersion 30
50        versionCode flutterVersionCode.toInteger()
51        versionName flutterVersionName
52        testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
53    }
54
55
56
57    signingConfigs {
58        release {
59            keyAlias keystoreProperties['keyAlias']
60            keyPassword keystoreProperties['keyPassword']
61            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
62            storePassword keystoreProperties['storePassword']
63        }
64    }
65    buildTypes {
66        release {
67            signingConfig signingConfigs.release
68        }
69    }
70
71}
72
73flutter {
74    source '../..'
75}
76
77dependencies {
78    implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
79    testImplementation 'junit:junit:4.12'
80    androidTestImplementation 'androidx.test:runner:1.1.1'
81    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
82    implementation 'com.google.firebase:firebase-analytics:17.2.2'
83}
84apply plugin: 'com.google.gms.google-services'
85BUILD FAILED in 8s
86[!] Your project requires a newer version of the Kotlin Gradle plugin.
87    Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update project/android/build.gradle:
88    ext.kotlin_version = '&lt;latest-version&gt;'
89Exception: Gradle task assembleDebug failed with exit code 1
90classpath 'com.android.tools.build:gradle:4.1.0'
91distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
92

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

QUESTION

Error when trying to run my React Native app on Android

Asked 2022-Mar-06 at 07:58

I've built my React Native app and tested and troubleshooted with my iOS devices for months. Now I'm trying to built and test the app on Android for the first time. The thing is, that I keep getting errors trying to run the Android-version of my app. After hours of debugging and troubleshooting, I tried to create a new RN project and see if that could run on my emulator and device. I got that part working and then I wanted to copy/paste the files of my existing app project into the new project.

I pasted my existing assets, styles, the source JS-files and the package.json file into the new project, ran npm install and then I ended up with the exact same error message as I had in the original project when I run react-native run-android.

The full error message is here:

1error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
2Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
3Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
4Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
5Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
6Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
7Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
8
9FAILURE: Build failed with an exception.
10
11* What went wrong:
12Execution failed for task ':app:mergeDebugAssets'.
13&gt; Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
14   &gt; Could not find com.facebook.yoga:proguard-annotations:1.14.1.
15     Searched in the following locations:
16       - https://dl.google.com/dl/android/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
17       - https://repo.maven.apache.org/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
18       - file:/Users/MyUser/.m2/repository/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
19       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
20       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
21       - https://www.jitpack.io/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
22     Required by:
23         project :app &gt; com.facebook.react:react-native:0.64.2
24   &gt; Could not find com.facebook.fbjni:fbjni-java-only:0.0.3.
25     Searched in the following locations:
26       - https://dl.google.com/dl/android/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
27       - https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
28       - file:/Users/MyUser/.m2/repository/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
29       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
30       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
31       - https://www.jitpack.io/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
32     Required by:
33         project :app &gt; com.facebook.react:react-native:0.64.2
34   &gt; Could not find com.yqritc:android-scalablevideoview:1.0.4.
35     Searched in the following locations:
36       - https://dl.google.com/dl/android/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
37       - https://repo.maven.apache.org/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
38       - file:/Users/MyUser/.m2/repository/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
39       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
40       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
41       - https://www.jitpack.io/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
42     Required by:
43         project :app &gt; project :react-native-video
44
45* Try:
46Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
47
48* Get more help at https://help.gradle.org
49
50BUILD FAILED in 10s
51
52    at makeError (/Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:174:9)
53    at /Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:278:16
54    at processTicksAndRejections (node:internal/process/task_queues:96:5)
55    at async runOnAllDevices (/Users/MyUser/MyAppFolder/MyApp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
56    at async Command.handleAction (/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:186:9)
57

I've tried to run ./gradlew clean in the android-folder without any luck. My build.gradle-file looks like this:

1error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
2Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
3Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
4Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
5Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
6Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
7Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
8
9FAILURE: Build failed with an exception.
10
11* What went wrong:
12Execution failed for task ':app:mergeDebugAssets'.
13&gt; Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
14   &gt; Could not find com.facebook.yoga:proguard-annotations:1.14.1.
15     Searched in the following locations:
16       - https://dl.google.com/dl/android/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
17       - https://repo.maven.apache.org/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
18       - file:/Users/MyUser/.m2/repository/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
19       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
20       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
21       - https://www.jitpack.io/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
22     Required by:
23         project :app &gt; com.facebook.react:react-native:0.64.2
24   &gt; Could not find com.facebook.fbjni:fbjni-java-only:0.0.3.
25     Searched in the following locations:
26       - https://dl.google.com/dl/android/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
27       - https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
28       - file:/Users/MyUser/.m2/repository/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
29       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
30       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
31       - https://www.jitpack.io/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
32     Required by:
33         project :app &gt; com.facebook.react:react-native:0.64.2
34   &gt; Could not find com.yqritc:android-scalablevideoview:1.0.4.
35     Searched in the following locations:
36       - https://dl.google.com/dl/android/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
37       - https://repo.maven.apache.org/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
38       - file:/Users/MyUser/.m2/repository/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
39       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
40       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
41       - https://www.jitpack.io/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
42     Required by:
43         project :app &gt; project :react-native-video
44
45* Try:
46Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
47
48* Get more help at https://help.gradle.org
49
50BUILD FAILED in 10s
51
52    at makeError (/Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:174:9)
53    at /Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:278:16
54    at processTicksAndRejections (node:internal/process/task_queues:96:5)
55    at async runOnAllDevices (/Users/MyUser/MyAppFolder/MyApp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
56    at async Command.handleAction (/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:186:9)
57// Top-level build file where you can add configuration options common to all sub-projects/modules.
58
59buildscript {
60    ext {
61        buildToolsVersion = &quot;30.0.2&quot;
62        minSdkVersion = 21
63        compileSdkVersion = 30
64        targetSdkVersion = 30
65        ndkVersion = &quot;20.1.5948944&quot;
66        kotlinVersion = &quot;1.3.72&quot;
67    }
68    repositories {
69        repositories {
70            google()
71            maven { url 'https://maven.google.com' }
72            mavenLocal()
73            mavenCentral()
74
75           // jcenter()
76            maven {
77                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
78                url &quot;$rootDir/../node_modules/react-native/android&quot;
79            }
80        }
81    }
82    dependencies {
83        classpath(&quot;com.android.tools.build:gradle:4.2.1&quot;)
84        classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion&quot;
85        // NOTE: Do not place your application dependencies here; they belong
86        // in the individual module build.gradle files
87    }
88}
89
90allprojects {
91    repositories {
92        google()
93        mavenCentral()
94
95        mavenLocal()
96        maven {
97            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
98            url(&quot;$rootDir/../node_modules/react-native/android&quot;)
99        }
100        maven {
101            // Android JSC is installed from npm
102            url(&quot;$rootDir/../node_modules/jsc-android/dist&quot;)
103        }
104
105        maven { url 'https://www.jitpack.io' }
106    }
107}
108

Please let me know if you know what to do or if you have experienced a similar issue!

ANSWER

Answered 2021-Aug-21 at 13:43

I've hit this same issue and have temporarily resolved it by uninstalling react-native-video (npm uninstall --save react-native-video). That's not a great answer as I need that component, but I don't have a full solution yet. I think somehow com.yqritc:android-scalablevideoview:1.0.4. is required by react-native-video but has gotten lost or removed. Other thoughts are welcome.

UPDATE: Resolved! In your build.gradle in your Android folder you need to add the repository "jcenter()" in allprojects (not in build dependencies) like this...

1error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
2Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
3Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
4Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
5Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
6Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
7Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
8
9FAILURE: Build failed with an exception.
10
11* What went wrong:
12Execution failed for task ':app:mergeDebugAssets'.
13&gt; Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
14   &gt; Could not find com.facebook.yoga:proguard-annotations:1.14.1.
15     Searched in the following locations:
16       - https://dl.google.com/dl/android/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
17       - https://repo.maven.apache.org/maven2/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
18       - file:/Users/MyUser/.m2/repository/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
19       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
20       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
21       - https://www.jitpack.io/com/facebook/yoga/proguard-annotations/1.14.1/proguard-annotations-1.14.1.pom
22     Required by:
23         project :app &gt; com.facebook.react:react-native:0.64.2
24   &gt; Could not find com.facebook.fbjni:fbjni-java-only:0.0.3.
25     Searched in the following locations:
26       - https://dl.google.com/dl/android/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
27       - https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
28       - file:/Users/MyUser/.m2/repository/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
29       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
30       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
31       - https://www.jitpack.io/com/facebook/fbjni/fbjni-java-only/0.0.3/fbjni-java-only-0.0.3.pom
32     Required by:
33         project :app &gt; com.facebook.react:react-native:0.64.2
34   &gt; Could not find com.yqritc:android-scalablevideoview:1.0.4.
35     Searched in the following locations:
36       - https://dl.google.com/dl/android/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
37       - https://repo.maven.apache.org/maven2/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
38       - file:/Users/MyUser/.m2/repository/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
39       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/android/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
40       - file:/Users/MyUser/MyAppFolder/MyApp/node_modules/jsc-android/dist/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
41       - https://www.jitpack.io/com/yqritc/android-scalablevideoview/1.0.4/android-scalablevideoview-1.0.4.pom
42     Required by:
43         project :app &gt; project :react-native-video
44
45* Try:
46Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
47
48* Get more help at https://help.gradle.org
49
50BUILD FAILED in 10s
51
52    at makeError (/Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:174:9)
53    at /Users/MyUser/MyAppFolder/MyApp/node_modules/execa/index.js:278:16
54    at processTicksAndRejections (node:internal/process/task_queues:96:5)
55    at async runOnAllDevices (/Users/MyUser/MyAppFolder/MyApp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
56    at async Command.handleAction (/Users/MyUser/MyAppFolder/MyApp/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:186:9)
57// Top-level build file where you can add configuration options common to all sub-projects/modules.
58
59buildscript {
60    ext {
61        buildToolsVersion = &quot;30.0.2&quot;
62        minSdkVersion = 21
63        compileSdkVersion = 30
64        targetSdkVersion = 30
65        ndkVersion = &quot;20.1.5948944&quot;
66        kotlinVersion = &quot;1.3.72&quot;
67    }
68    repositories {
69        repositories {
70            google()
71            maven { url 'https://maven.google.com' }
72            mavenLocal()
73            mavenCentral()
74
75           // jcenter()
76            maven {
77                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
78                url &quot;$rootDir/../node_modules/react-native/android&quot;
79            }
80        }
81    }
82    dependencies {
83        classpath(&quot;com.android.tools.build:gradle:4.2.1&quot;)
84        classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion&quot;
85        // NOTE: Do not place your application dependencies here; they belong
86        // in the individual module build.gradle files
87    }
88}
89
90allprojects {
91    repositories {
92        google()
93        mavenCentral()
94
95        mavenLocal()
96        maven {
97            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
98            url(&quot;$rootDir/../node_modules/react-native/android&quot;)
99        }
100        maven {
101            // Android JSC is installed from npm
102            url(&quot;$rootDir/../node_modules/jsc-android/dist&quot;)
103        }
104
105        maven { url 'https://www.jitpack.io' }
106    }
107}
108allprojects {
109    repositories {
110        mavenCentral()
111        mavenLocal()
112        jcenter()
113}
114

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

QUESTION

What is the hot flow and cold flow in coroutines and the difference between them?

Asked 2022-Feb-26 at 04:09

I am mastering Kotlin coroutines and trying to figure out

1- what is hot flow and cold flow ?

2- what is the main difference between them?

3- when to use each one?

ANSWER

Answered 2022-Feb-26 at 04:09

A cold stream does not start producing values until one starts to collect them. A hot stream on the other hand starts producing values immediately.

I would recommend to read below to understand hot and cold steams with usage:

https://balwindersinghrajput.medium.com/complete-guide-to-livedata-and-flow-answering-why-where-when-and-which-6b31496ba7f3

https://developer.android.com/kotlin/flow/stateflow-and-sharedflow

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

QUESTION

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

My second manifest file:

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

My gradle file:

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

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Kotlin

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

Share this Page

share link

Get latest updates on Kotlin