I am using JSoup to parse my HTML response in my Java application but when I add the implementation I get the following:
Program type already present: org.jsoup.Connection$KeyVal
Message{kind=ERROR, text=Program type already present:
org.jsoup.Connection$KeyVal, sources=[Unknown source file], tool
name=Optional.of(D8)}
I am wondering has anyone experienced this before? I will add my full build.gradle below, I am running the most current SDK.
apply plugin: 'com.android.application'
android { compileSdkVersion 28 defaultConfig {
applicationId "uareloadedapp"
minSdkVersion 26
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} } productFlavors { } }
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation (name: 'wikitudesdk', ext:'aar') implementation 'com.google.ar:core:1.1.0' implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'org.altbeacon:android-beacon-library:2.15.2' 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 'com.android.support:recyclerview-v7:28.0.0' implementation 'com.squareup.picasso:picasso:2.5.2' implementation "com.android.support:support-core-utils:28.0.0" implementation 'com.android.support:support-v4:28.0.0' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.+' implementation 'org.jsoup:jsoup:1.11.3'
} repositories { flatDir{
dirs 'libs' } }
Check if there is anything that you have added as a dependency and is also in the libs folder. That was my problem. deleting the file from the lib folder fixed it
Related
i'm developing an Android Studio App and trying to create a user register activity. I already added firebase into the project but when i try to add the firebase database dependencies, the app crashes instantly and not a single error is reported. However, when i remove the 3 implements from the build gradle, it runs correctly. Here i leave both build gradle codes. Thanks.
Build gradle project:
// 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:3.6.4'
classpath 'com.google.gms:google-services:4.3.8'
// 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
}
Build gradle app (this works properly):
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.jota02"
minSdkVersion 26
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
//new implements
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.google.android.material:material:1.4.0-beta01'
implementation platform('com.google.firebase:firebase-bom:28.0.1')
}
Build gradle app (this crashes):
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.jota02"
minSdkVersion 26
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
//new implements
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.google.android.material:material:1.4.0-beta01'
implementation platform('com.google.firebase:firebase-bom:28.0.1')
implementation 'com.google.firebase:firebase-auth:21.0.1'
implementation 'com.google.firebase:firebase-core:19.0.0'
implementation 'com.google.firebase:firebase-database:20.0.0'
}
SOLVED
The problem just was that i was running an old Android Studio version. I updated Android Studio and checked the gradle versions and now it's all working properly, thanks.
When you use firebase-bom dependency, you no need to mention version for firebase-database and other firebase library.
firebase-bom will choose right version for you or if you want particular version of firebase remove firebase-bom.so add dependency like below
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:28.0.1')
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-database'
When I hover over my 'com.android.support:appcompat-v7:28.0.0' in my build.gradle , it says that the support libaries must use the exact same version specifications. I got this error out of no where where after pulling in some files from my repo on github. I first referred to All com.android.support libraries must use the exact same version specification where many of the solutions were posted but after trying many of them, I could not still resolve my issue. I will list the steps below that I took to try to resolve the issue. Any help would be great on this. I will also post my build.gradle below.
steps taken to resolve issue
Sync project with Gradle File
Invalidate caches and Restart
Created a new project and basically copied everything from the one with issues into it
I also added the following code into my build.gradle and it did not work either.
configurations.all {
resolutionStrategy.eachDependency {
DependencyResolveDetails details ->
def requested = details.requested
if (requested.group ==
'com.android.support') {
if
(!requested.name.startsWith("multidex")) {
details.useVersion '28.0.0'
}
}
}
}
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "losdos.help4hire"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0 '
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
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.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-firestore:17.1.2'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.firebase:firebase-client-android:2.5.2+'
implementation 'com.google.firebase:firebase-auth:16.0.5'
}
apply plugin: 'com.google.gms.google-services'
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '28.0.0 '
}
}
}
}
I am getting this error, Failed to resolve: com.android.support:appcompat-v7.28.0.0 I have been looking on here and tried changing it to other variations of that line but so far no luck, why do I keep getting this error?
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
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'
The issue is with the appcompat-v7 dependency that you have added to the build.gradle.
Change implementation 'com.android.support:appcompat-v7.28.0.0' to implementation 'com.android.support:appcompat-v7:28.0.0'
Notice the : between appcompat-v7 and 28.0.0 that separates the artifact name and the version.
If we don't consider the typo in :
implementation 'com.android.support:appcompat-v7.28.0.0'
Change it to:
implementation 'com.android.support:appcompat-v7:28.0.0'
Then, you probably should use the latest version for the Firebase dependencies to avoid those Please fix the version errors:
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
Then rebuild the project. Also, remember to use latest gradle to avoid couldn't found such dependency or etc.
Inside build.gradle of the project (inside your project root directory):
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
// replace it with the 3.2.0 version
...
classpath 'com.google.gms:google-services:4.1.0' // update this too
}
I just cannot understand what error is this. I got it when I tried to test my app on a device from the Firebase Test Lab. When I test the app on my phone and on the android emulator in Android Studio, everything works fine, but here, at the first activity created, I get this error that I don't know what means. If you know the problem, or how to solve it, please help me out. Thanks
Here is my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "edurbrito.SuperLigaUsers"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'org.apache.commons:commons-lang3:3.7'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:support-annotations:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.android.support:design:26.1.0'
implementation 'com.shawnlin:number-picker:2.4.6'
implementation files('libs/activation.jar')
implementation files('libs/additionnal.jar')
implementation files('libs/mail.jar')}
apply plugin: 'com.google.gms.google-services'
Can you please join the #test-lab channel at https://firebase-community.slack.com and then post a sample matrix-id of a test with this failure? A new Firebase Test Lab bug was filed a couple days ago that might be the same as this, but we can't tell without inspecting your test matrix.
I'm trying to make a simple android application interface in Android studio. I'm following few tutorials online.
here some images about something that i'm trying to accomplish:
I'm simply do not know where exactly where i'm wrong. I've checked multiple times, but my application won't run.
here's the link for the code:
MainActivity.java,
activity_main.xml
here is inside my build.gradle (module.app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "pam.pohat_4"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
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'
//Libary
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'info.hoang8f:fbutton:1.0.5'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
}
apply plugin: 'com.google.gms.google-services'
but i get this un-ending error:
There is a miss type match between your XML button(line no: 30 and 45) and button initialization you have done in your MainActivity.onCreate() (Line no: 10, 17 and 18).
Choose which type you want to use info.hoang8f.widget.FButton or Button.