Error with implementing OpenBeans openbeans-1.0.jar - java

My project is in Java on android studio on IntelliJ.
I downloaded openbeans-1.0.jar, put it in my libs folder, went to Project Structure, and added it to the dependencies. Here is my build.gradle (:app) code:
apply plugin: 'com.android.application'
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.gotimejavaversion"
minSdkVersion 15
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'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
implementation 'com.google.android.material:material: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'
implementation 'com.opencsv:opencsv:5.2'
implementation 'com.googlecode:openbeans:1.0'
implementation 'com.univocity:univocity-parsers:2.9.0'
}
This is the MVN Repository info I found online for OpenBeans using gradle(this is just a visual reference I am using to create the line implementation 'com.googlecode:openbeans:1.0' in my build.gradle file. I am not using Maven):
// https://mvnrepository.com/artifact/com.googlecode/openbeans
compile group: 'com.googlecode', name: 'openbeans', version: '1.0'
I get the error:
Could not determine the dependencies of task ':app:compileDebugRenderscript'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not find com.googlecode:openbeans:1.0.
Required by:
project :app
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
I couldn't make out what I am doing wrong in the documentation. I've checked how I've typed it in multiple times and have tried implementation 'com.googlecode.openbeans:openbeans:1.0' I'm new to working with repositories and programming at that. Any help is appreciated.
Thank you!

Related

Failed to resolve: lifecycle-runtime-2.2.0

I'm trying to add android-youtube-player to my android project. When I add it to the gradle dependencies, gradle sync finishes with this warning:
Failed to resolve: lifecycle-runtime-2.2.0
Trying to run the app produces the following error:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find recyclerview-1.1.0.jar (androidx.recyclerview:recyclerview:1.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/recyclerview/recyclerview/1.1.0/recyclerview-1.1.0.jar
> Could not find lifecycle-runtime-2.2.0.jar (androidx.lifecycle:lifecycle-runtime:2.2.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-runtime/2.2.0/lifecycle-runtime-2.2.0.jar
My build.gradle file:
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.****.********"
minSdkVersion 22
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.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation "androidx.fragment:fragment-ktx:1.2.0"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.5'
}
It has no problems without implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.5'
I have tried cleaning the project and deleting .gradle folder, but it hasn't helped. Is there anything I'm doing wrong?
if all reps are true
then from android studio files invalidate cache and restart
solve the problem for me

Could not resolve com.amitshekhar.android:android-networking:1.0.2

i am trying to import network library , but android studio shows up with this meessage:ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.amitshekhar.android:android-networking:1.0.2.
here is the build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.myfaild"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.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.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.amitshekhar.android:android-networking:1.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
I know this is the old question, but I saw such a problem after removing jcenter() from repositories in gradle file:
repositories {
google()
jcenter()
}
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
this worked for me ,i had to add jitpack.io
Try this
compile 'com.amitshekhar.android:android-networking:1.0.2'
When using it with Jackson Parser
implementation 'com.amitshekhar.android:jackson-android-networking:1.0.2'
When using it with RxJava
implementation 'com.amitshekhar.android:rx-android-networking:1.0.2'
When using it with RxJava2
compile 'com.amitshekhar.android:rx2-android-networking:1.0.2'
add this line in gradle.properties:
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

ERROR: Failed to resolve: androidx.appcompat:design:1.1.0

when i implementation 'androidx.appcompat:design:1.1.0' code in build gradle(module app)
it says ERROR: Failed to resolve: androidx.appcompat:design:1.1.0
i have try to change the implementation 'androidx.appcompat:appcompat:1.1.0'
in appscompact version it again shows error
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.bottomnavigation"
minSdkVersion 15
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.1.0'
implementation 'androidx.appcompat:design:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
ERROR: Failed to resolve: androidx.appcompat:design:1.1.0
Show in Project Structure dialog
Affected Modules: app
To you Design Support Library for androidx you need to use
Use this
implementation 'com.google.android.material:material:1.0.0'
Instead of
implementation 'androidx.appcompat:design:1.1.0'
The library androidx.appcompat:design doesn't exist.
Check the artifact mapping:
com.android.support:design -> com.google.android.material:material:1.0.0
You can find here the documentation of the Material components library.
To eliminate error,
Instead of this:
implementation 'androidx.appcompat:design:1.1.0'
Write this:
implementation 'com.google.android.material:material:1.2.1'

Why i am getting error on this code implementation 'com.android.support:appcompat-v7:27.1.1'

All com.android.support libraries must use the exact same version specifications ( mixing versions can lead to runtime crash). Found versions 27.1.1, 26.1.0.
I am getting this error while placing banner ads when I use this dependency
implementation 'com.google.android.gms:play-services-ads:15.0.1'
Please look at the image and codes I provided and please help me.
I am currently using 3.1.2 android studio version.
these are the all codes.
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.rbtcomedy.maharashtraresult"
minSdkVersion 15
targetSdkVersion 27
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:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.android.gms:play-services-ads:15.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'
}
Image link-https://drive.google.com/open?id=19WhSgZ2aTz_kZsFYeEVtejvAGBnPHJ0S
The library defined with this dependency implementation 'com.google.android.gms:play-services-ads:15.0.1' containts library of version 26.1.0, and you defined 27.1.1. So there are two same libs with different versions, you can fix this by excluding old one: exclude group: 'com.android.support'
Exlcude support library from espresso-Core as follows:
androidTestImplementation('com.android.support.test.espresso:espresso-
core:3.0.2') {
exclude group: 'com.android.support', module: 'support-annotations'
}

Error:java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

I'm creating wallpaper app in the android studio with firebase.
I got an error while compiling
Error:java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Error:com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Error:com.android.dex.DexException: Multiple dex files define Landroid/arch/lifecycle/LiveData$1;
i added "multiDexEnabled true" and
"implementation 'com.android.support:multidex:1.0.3'"
and also i clean and rebuild my project
nothing happens
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.jimdo.saifstudios.wallpfeb"
minSdkVersion 19
targetSdkVersion 26
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'
}
}
}
dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.firebaseui:firebase-ui-database:3.1.2'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:recyclerview-v7:27.1.0'
implementation 'com.android.support:cardview-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-database:11.8.0'
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'
}
apply plugin: 'com.google.gms.google-services'
Take a look at the docs of the firebase-ui.
https://github.com/firebase/FirebaseUI-Android
For the version you are using you have to use com.google.firebase:firebase-database:11.6.2
If you are extending Application in your app. in my case i fixed it by adding MultiDex.install(this); to attachBaseContext(Context context) method.
you can take a look at:
https://developer.android.com/studio/build/multidex.html

Categories