Unable to build gradle; Execution failed for task ':app:processDebugMainManifest' - android

Execution failed for task ':app:processDebugMainManifest'.
Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module #3bcb9348
I am receiving this error on building a project in Android-Studio, I have tried almost all the methods suggested on stack-overflow and youtube, I have tried completely removing all android studio files and reinstalling them but still am unable to sort it.
These are my build.gradle files
build.gradle: (Module: EmployerModule.app)
*plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.employermodule"
minSdkVersion 18
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}*
Build.gradle(EmployerModule)
*// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}*

Related

Failed to resolve library

I know there are a lot of questions like this, but none of them worked for me.
I tried using settings.Gradle, adding "www."
I'm using jitpack to publish my android library in a GitHub repo
my app-level gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.realdev.betrage"
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.github.RealDev05:ColorPickerDialog:0.2.1'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.palette:palette:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
my project level gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.Gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My jitpack logs : logs
My library : ColorPickerDialog

Problem downloading com.google.gms:google-services:4.3.10 after adding it as a classpath to the project build.gradle file

I started to get this error after trying to connect my app to firebase.
This is the error message I get after the gradle build
Could not GET 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.10/google-services-4.3.10.pom'. Received status code 405 from server: Method Not Allowed
Project build.gradle file content
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app/build.gradle file content
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.google.gms.google-services'
}
//apply plugin: 'com.google.gms.google-services'
android {
compileSdk 31
defaultConfig {
applicationId "com.daniel_sogbey.marmap"
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildToolsVersion '31.0.0'
}
dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation platform('com.google.firebase:firebase-bom:28.4.2')
implementation 'com.google.firebase:firebase-analytics-ktx'
}
googleServices { disableVersionCheck = true }
Your Gradle files look fine, but it looks like your system is unable to contact the Google repository.
Make sure you don't have a firewall running that blocks access.
You can unblock only the firewalls that are active leaving the inactive ones
still still running if you are on a windows machine.

Cant find realm dependency

So my project cant seem to resolve the realm dependency. I've used realm many times and haven't had this issue before - hopefully I'm just tired and missing something stupid and obvious.
I followed the instructions here:
https://docs.mongodb.com/realm-legacy/docs/java/latest/#installation
And other SO answers but am having no luck... here are my gradle files
project gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.0"
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "io.realm:realm-gradle-plugin:10.0.1"
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app gradle file
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
}
apply plugin: 'realm-android'
android {
compileSdkVersion 30
defaultConfig {
applicationId "ca.test.sdkpackedtest"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
api 'com.google.android.material:material:1.2.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
Error:
A problem occurred configuring root project 'SDKPackedTest'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find io.realm:realm-gradle-plugin:10.0.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/io/realm/realm-gradle-plugin/10.0.1/realm-gradle-plugin-10.0.1.pom
- https://repo.maven.apache.org/maven2/io/realm/realm-gradle-plugin/10.0.1/realm-gradle-plugin-10.0.1.pom
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Realm available in mavenCantral since version 10.4.0.
Either update the version or add jcenter

Android error: Failed to resolve: :unspecified: Affected Modules: app

I keep getting the error "Failed to resolve: :unspecified: Affected Modules: app" whenever I sync my gradle. This error is not descriptive and hence hard to figure out what's the exact cause for this.
App build.gradle:
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 29
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.sample.sample"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
//testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.clevertap.android:clevertap-xiaomi-sdk:1.0.1'
}
Project build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven {
url "https://maven.google.com"
}
maven {
url "https://jitpack.io"
}
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url "https://maven.google.com"
}
maven {
url "https://jitpack.io"
}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I am using Android Studio 4.1.3 on MacBook Air with macOS 10.15.7
This is happening because of 'com.clevertap.android:clevertap-xiaomi-sdk:1.0.1' This library is not having the correct dependency specified in their pom file.
you can check the same in the link below and scroll down to dependency tag you will see the problem.
https://search.maven.org/artifact/com.clevertap.android/clevertap-xiaomi-sdk/1.0.1/aar
You can create an issue with clevertap team on this repo
https://github.com/CleverTap/clevertap-android-sdk
for module clevertap-xps
Hope I was any help to you.
Cheers.

Failed to apply plugin [id 'com.chaquo.python'] while gradle build

I am trying to use python in my android app by using chaquopy. I found tutorial for integrating chaquopy in android here .
I update my gradle file for app and project level A problem occurred evaluating project ':app'.
Failed to apply plugin [id 'com.chaquo.python']
No such property: dslScope for class: com.android.build.gradle.internal.api.DefaultAndroidSourceDirectorySet.
Here is my code for build.gradle app level
apply plugin: 'com.android.application'
apply plugin: 'com.chaquo.python'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
sourceSets {
python {
srcDirs = ["src/main/python"]
}
}
python {
buildPython "usr/bin/python3"
buildPython "python3"
}
ndk {
abiFilters "armeabi-v7a", "x86"
}
applicationId "com.softvision.nowyouseeus"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.mlkit:face-detection:16.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
bild.gradle project level
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {url "https://chaquo.com/maven"}
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.0"
classpath 'com.chaquo.python:gradle:6.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Chaquopy 6.3.0 isn't compatible with Android Gradle plugin version 4.1.0, and you should have received a warning about that.
See here for the compatible combinations. You should probably just upgrade to the current Chaquopy version, 9.0.0.

Categories

Resources