Execution failed for task ':app:processDebugManifest' in Android Studio 3.0 - java

I am new in Java and Android. When I apply to RUN PROJECT, this message is showing. Hence I need your help about the following problem.
Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(26.0.2) from [com.android.support:design:26.0.2] AndroidManifest.xml:28:13-35
is also present at [com.android.support:appcompat-v7:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
This is my gradle file and i have SDK Versions 26.0.2 and 28.0.0
enter code here

It has a tricky solution. Just comment out one by one in build.gradle and try to run.Then it will works and you can easily understand where is the problem. For an example:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
//androidTestImplementation 'com.android.support.test:runner:1.0.2'
//androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

Related

perfernce Sacreen color picker library unable to implement in android studioH

Hello friends i am beginner and using this library implementation'com.github.kizitonwose.colorpreference:core:'
library link is here https://github.com/kizitonwose/colorpreference
in my project for perfernceSacreen the problem is that when i tried implement this library in my project it give me this exception:
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.github.kizitonwose.colorpreference:core:<latest-version>.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve com.github.kizitonwose.colorpreference:core:<latest-version>.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve com.github.kizitonwose.colorpreference:core:<latest-version>.
Show Details
Affected Modules: app
my dependecies
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'petrov.kristiyan:colorpicker-library:1.1.5'
implementation 'com.github.kizitonwose.colorpreference:core:<latest-version>'
implementation 'com.yokkomi:seekbar-preference:1.0'
implementation 'com.github.ganfra:material-spinner:1.1.0'
implementation 'com.wdullaer:materialdatetimepicker:2.4.0'
implementation 'com.github.ganfra:material-spinner:1.1.0'
implementation 'uk.co.chrisjenx:calligraphy:2.1.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.infideap.drawerbehavior:drawer-behavior:0.1.5'
implementation 'com.github.GrenderG:Toasty:1.4.2'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.android.gms:play-services-ads:17.2.1'
}
I also had the same problem while using Toasty library.And realized that its because of a version mismatch.Try suitable version of Android.I recommend you to get the latest version!

I am having trouble with installing library

I am trying to use jlatemath library.
I have put the .jar file under libs folder,
and here is my gradle.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation files('libs/jlatexmath-android-0.1.0-sources.jar')
implementation files('libs/jlatexmath-android-font-cyrillic-0.1.0-sources.jar')
implementation files('libs/jlatexmath-android-font-greek-0.1.0-sources.jar')
}
I don't think I need both, but I put them just to be sure.
I tried clean and rebuild the project.
The building is done without a problem without runtask,
but my code still not finding the classes from the library, which means the are not finding auto import for the classes.
It's the first time I am using a library so I might have missed something stupid, but it would be much appreciated if anyone could kindly let me know what it is.
What I have just noticed is that you are trying to download and add dependencies manually. That is very long and tiresome process! You can just paste and let android studio to do it for you.
For your case you need to add these lines in build.gradle
implementation 'ru.noties:jlatexmath-android:0.1.0'
// for Cyrillic symbols
implementation 'ru.noties:jlatexmath-android-font-cyrillic:0.1.0'
And sync the project. Don't forget to delete all those lines which you used to add dependencies manually before.
so your code in the question supposed to look like this below
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//PASTE HERE DEPENDENCIES
implementation 'ru.noties:jlatexmath-android:0.1.0'
// for Cyrillic symbols
implementation 'ru.noties:jlatexmath-android-font-cyrillic:0.1.0'
}
If it didnt fix your problem let me know.
If you prefer video tutorial, You can follow this tutorial for how to add dependency in android studio here.

Incompatible library version 28 and 26.1 in Build Gradle dependencies

I'm trying to make an app that uses google maps API.
But there seems to be an error in regards to libraries, that are incompatible.
It says
'Found versions 28.0.0 and 26.1.0 examples including
com.android.support:animated_vector_drawable:28.0.0 and
com.android.support:support-media-compact:26.1.0
Would this have an effect on calling R.id by any chance?
I've tried clean and rebuild, and invalid cache reset.
I tried to add the files as version 28.0.0 in dependency and received 2 errors:
Failed to resolve: com.android.support:support-media-compact:28.0.0
Failed to resolve: com.android
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-media-compact:28.0.0'
implementation 'com.android.support:animated_vector_drawable:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
I would've thought that rewriting the versions would have fixed the problem but 'com.android.support:appcompat-v7:28.0.0' is still underlined in red.
Using the Gradle View plugin http://plugins.jetbrains.com/plugin/7150-gradle-view, I determined the issue is that play-services-location:16.0.0 has a dependency on com.android.support:support-media-compat:26.1.0. One technique I found to remove the warning is described here: https://docs.gradle.org/current/userguide/managing_transitive_dependencies.html
which led me to add this to my gradle file:
implementation("com.android.support:appcompat-v7:28.0.0") {
force = true
}
Here you can see the latest libraries update available : link to go . And if you face again an error, you have to post the Logcat.
Add all the dependencies (that is said to be conflicting with existing libraries) with same version no. of which it is conflicting with.

Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. More than one file was found with OS independent path

I've got this error on my project. Is is based on firebase-messaging API's. Before putting the:
implementation 'com.google.http-client:google-http-client-android:+'
implementation 'com.google.api-client:google-api-client-android:+'
implementation 'com.google.api-client:google-api-client-gson:+'
It was working.
dependencies
{
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.http-client:google-http-client-android:+'
implementation 'com.google.api-client:google-api-client-android:+'
implementation 'com.google.api-client:google-api-client-gson:+'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
To solve this, please add the following depenecy in your build.gradle:
implementation 'com.google.firebase:firebase-core:16.0.6'
Your build.gradle file now has to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.
Please also make sure you have in your top level (Project) build.gradle file the following Google Services plugin:
classpath 'com.google.gms:google-services:4.2.0'

Gradle libraries have different version

Last night, I did two things with my android code and now it does no longer work.
The two things I did was:
Add my first adview with the corresponding gradle implementation
Update Android Studio to the latest version (3.1.1)
Now the app can not build because of version mixing in the library versions. My gradle tells me that on the lines
implementation 'com.android.support:appcompat-v7:27.1.1'
and
implementation 'com.google.firebase:firebase-core:12.0.1'
I have no idea on how to fix this and nothing I search for gives me the answer on what to do. Is there a way to auto-generate the needed gradle for my app, or could anyone please point me in the direction of were to start when fixing this?
Thanks beforehand, my gradle dependencies are below.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.firebaseui:firebase-ui-auth:3.2.2'
implementation 'com.google.firebase:firebase-auth:12.0.1'
implementation 'com.google.android.gms:play-services-ads:12.0.1'
}
just try this one ,
"com.android.support:support-v13:27.1.1"
reference link
https://developer.android.com/topic/libraries/support-library/packages.html#v14-preference

Categories