How can I remove this error with build.gradle (module app) in AndroidStudio? - android-studio-3.0

I am getting the error in following line
implementation 'com.android.support:appcompat-v7:28.0.0'
And I am getting this in description for the above error.
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0, 27.1.0, 26.1.0.)
I uninstalled Android Studio twice & again installed it again.
But it didn't help.
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-core:16.0.8'
implementation 'com.google.firebase:firebase-auth:16.2.0'
implementation 'com.google.firebase:firebase-auth:16.2.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.squareup.picasso:picasso:2.71828'
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'
}

The error is made by different jar, just use my two method, the error is resolved
Revise the picasso
implementation('com.squareup.picasso:picasso:2.71828'){
exclude group: 'com.android.support'
}
Add below item into build.gradle
implementation ('com.android.support:exifinterface:28.0.0')

Related

Why does Vaadin require a license in the Docker build?

I am using Vaadin 23.5.5 for a private project without using the Pro components of Vaadin. When I build the project in a Docker container, Vaadin aborts the build and asks for a license key file.
...
Running Vite ...
Opening the system browser to validate the license. If the browser is not open, please open https://vaadin.com/pro/validate-license?connect=UUID&productName=vaadin-board&productVersion=23.3.5 manually.
If you are working offline, please visit https://vaadin.com/pro/validate-license?getOfflineKey=ABC for an offline license.
...
This are my dependencies:
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-jersey'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'com.google.cloud:spring-cloud-gcp-starter'
implementation 'com.google.cloud:spring-cloud-gcp-starter-storage'
implementation 'com.vaadin:vaadin-spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'com.google.cloud:spring-cloud-gcp-starter-data-firestore'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
implementation 'de.jfancy:star-rating:1.0.3'
}
dependencyManagement {
imports {
mavenBom "com.vaadin:vaadin-bom:${vaadinVersion}"
mavenBom "com.google.cloud:spring-cloud-gcp-dependencies:${springCloudGcpVersion}"
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
The entire dependency tree:
https://gist.github.com/benocms/1d08207e5a89f6d50965a5136938a8a8
My understanding is that the use of the Core components is free. Am I wrong about this? Or is this a bug?

How to import a proprietary library in Grails 4.0.3

I am trying to import a proprietary jar lib (ICOMConector.jar) in my grails 4.0.3 project, but it is sending me an error.
In IntelliJ, I right-clicked the project folder and accessed Open Module Settings. Then I clicked in Libraries and chose my jar. Right after, clicked in Module / Dependencies and chose that jar in a compilation scope.
In build.gradle file I put this flatDir, because the jar in my project grails stardard structure:
repositories {
maven { url "https://repo.grails.org/grails/core" }
flatDir {
dirs 'lib'
}
}
And this in the same build.gradle, I've tried all of that, including those now commented,
but the error persists.
dependencies {
//implementation name: 'lib/ICOMConector.jar'
//runtime files('lib/ICOMConector.jar')
//runtime fileTree(dir: 'lib', include: '*.jar')
compile fileTree(dir: 'lib', include: ['*.jar'])
}
when I send grails run-app in the command line, the error is:
| Running application...
startup failed:
/media/alfredo/1TBHDD/CMB/Code projects/Grails 4/detran-mspid/grails-app/init/detran/mspid/BootStrap.groovy: 5: unable to resolve class com.workers.icom.ICOMConector
**# line 5, column 1.
import com.workers.icom.ICOMConector
^
1 error**
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileGroovy'.
> Compilation failed; see the compiler error output for details.
* Try:
Run 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.
* Get more help at https://help.gradle.org
I tried to instantiate the class in Bootstrap.groovy, to make it easier to verify if it is working as expected.
Could anyone help me to import this library. A friend of mine did this in a Spring boot project and it worked, so the problem seems to be a wrong configuration in Grails.
package detran.mspid
import com.workers.icom.ICOMConector
class BootStrap {
def init = { servletContext ->
ICOMConector icom = new ICOMConector()
}
def destroy = {
}
}
This is what I have in my build.gradle for using a library in grails 4.0.3 (been this way since at least grails 3, though). This is almost identical to one you tried with runtime scope.
compile files("lib/opencsv-2.3.jar")
runtimeOnly fileTree(dir: './lib', include: ['*.jar'])
It's entirely possible that either one or both of those is unnecessary...

Error adding CocoaPods dependency in Kotlin Multiplatform

I'm trying to setup a KMM module with Couchbase Lite as a platform dependency for both Android and iOS. I'm running into errors getting this to work with CocoaPods for iOS:
Exception in thread "main" java.lang.Error: /var/folders/pv/3_5xn0dd0v5bf6sxbfcsq_wr0000gn/T/7009311365357251921.m:1:22: error: expected ';' after module name
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:68)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:507)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:265)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:73)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:41)
The generated 7009311365357251921.m file is not present at that path afterwards, which makes this difficult to debug.
build.gradle.kts:
plugins {
kotlin("multiplatform") version "1.4.21"
kotlin("native.cocoapods") version "1.4.21"
id("com.android.library")
}
...
kotlin {
android()
ios()
cocoapods {
summary = "TBD"
homepage = "TBD"
ios.deploymentTarget = "9.0"
pod("CouchbaseLite-Enterprise") {
version = "~> 2.8.1"
}
}
...
}
...
I get a different error if I use the non-enterprise release. Same build.gradle.kts except with pod("CouchbaseLite"). I get the error:
Exception in thread "main" java.lang.IllegalArgumentException: 'CBLQueryMeta' is going to be declared twice
at org.jetbrains.kotlin.native.interop.gen.KotlinFile.<init>(KotlinCodeModel.kt:257)
at org.jetbrains.kotlin.native.interop.gen.StubIrBridgeBuilder$kotlinFile$1.<init>(StubIrBridgeBuilder.kt:44)
at org.jetbrains.kotlin.native.interop.gen.StubIrBridgeBuilder.<init>(StubIrBridgeBuilder.kt:46)
at org.jetbrains.kotlin.native.interop.gen.StubIrDriver.run(StubIrDriver.kt:122)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:315)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:73)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:41)
Both these pod specs compile without problem in an Xcode project. But Kotlin native seems to run into issues with them.
Update:
The pod("CouchbaseLite") error seems to be caused by having both a CBLQueryMeta and CBLQuery interface defined. There's a YouTrack issue for this. This error will likely still be a problem with CouchbaseLite-Enterprise, if the original error could be resolved.
Update 2:
If I remove the { version = "~> 2.8.1" } or put it in the function call directly pod("CouchbaseLite-Enterprise", "~> 2.8.1") I get a different error:
Exception in thread "main" java.lang.Error: /var/folders/pv/3_5xn0dd0v5bf6sxbfcsq_wr0000gn/T/6649487835163649080.m:1:9: fatal error: module 'CouchbaseLite_Enterprise' not found
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:68)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:507)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:265)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:73)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:41)
Update 3:
I filed a YouTrack issue for this. It seems this might have something to do with the dash - in the CocoaPod library name. There was an issue that's been closed that had a fix for this by changing the module name to replace the dash - with an underscore _, but the fix doesn't seem to be working.
Depending on which version of the toolchain you're using, seems as if you're using the wrong syntax to specify the version. Try pod("CouchbaseLite-Enterprise", "~> 2.8.1") instead.

Grails 4: Is spring-security-ldap updated for Grails 4.0?

I am upgrading my Grails 3.3.2 application to Grails 4.0.0.RC2 and all references to org.springframework.security.ldap classes are unresolved. I'm not sure if this is a matter of waiting for a later version of the plugin or if there's something different I should be doing for Grails 4. If I need to wait for a later version, is there an ETA on this?
I'm using this version in my build.gradle file:
compile "org.grails.plugins:spring-security-ldap:3.0.2"
Here's an example of some unresolved errors:
unable to resolve class org.springframework.ldap.core.DirContextOperations
unable to resolve class org.springframework.ldap.core.DirContextAdapter
Due to Gradle change:
Separation of compile and runtime dependencies when consuming POMs
To use some Grails 3 plugins in Grails 4 apps you need to include their transitive dependencies directly. Otherwise they are not brought into the classpath.
The fix is to include the dependencies directly in your build.
ext {
springSecurityVersion="5.1.6.RELEASE"
springSecurityCoreVersion="4.0.0.RC2"
springSecurityLdapVersion="3.0.2"
}
dependencies {
...
// Security
compile "org.grails.plugins:spring-security-core:$springSecurityCoreVersion"
compile ("org.grails.plugins:spring-security-ldap:$springSecurityLdapVersion") {
exclude group: 'org.grails.plugins', module:'spring-security-core'
}
compile "org.springframework.security:spring-security-ldap:$springSecurityVersion", {
['apacheds-core', 'apacheds-core-entry', 'apacheds-protocol-ldap', 'apacheds-protocol-shared',
'apacheds-server-jndi', 'commons-logging', 'fest-assert', 'jcl-over-slf4j', 'junit',
'ldapsdk', 'logback-classic', 'mockito-core', 'shared-ldap', 'slf4j-api', 'spring-beans',
'spring-context', 'spring-core', 'spring-ldap-core', 'spring-security-core',
'spring-test', 'spring-tx'].each { exclude module: it }
}
compile 'org.springframework.ldap:spring-ldap-core:2.0.4.RELEASE', {
['commons-lang', 'gsbase', 'junit', 'mockito-core', 'powermock-api-mockito',
'powermock-api-support', 'powermock-core', 'powermock-module-junit4',
'powermock-module-junit4-common', 'powermock-reflect', 'slf4j-log4j12', 'spring-beans',
'spring-core', 'spring-data-commons', 'spring-test', 'spring-tx'].each { exclude module: it }
}
I took the transitive dependencies from the plugin:
https://github.com/grails-plugins/grails-spring-security-ldap/blob/master/build.gradle#L63-L76

Grails : How to migrate dependencies upgrading from 2.x.x to 3.0.8?

I am attempting to upgrade an existing Grails application from version 2.4.4 to 3.0.8. I have a couple issues that I am currently unable to resolve.
First issue: The old version's BuildConfig.groovy referenced a jar file that was in the lib directory. I tried copying the same configuration from BuildConfig.groovy to build.gradle and created a lib directory with the jar but Grails is unable to resolve the dependency.
Second issue: The old version had a plugin defined. I tried copying the same plugin definition from BuildConfig.groovy into build.gradle, but this isn't working. I noticed that the plugin isn't currently listed in Bintray, is this the problem?
Below is the dependency section of the build.gradle file.
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:hibernate"
compile "org.grails.plugins:cache"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:scaffolding"
compile "com.stripe:stripe-java:1.32.1"
compile "com.google.code.gson:gson:2.3.1"
compile "javax.mail:mail:1.4"
runtime "org.grails.plugins:asset-pipeline"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
// Note: It is recommended to update to a more robust driver (Chrome, Firefox etc.)
testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'
console "org.grails:grails-console"
//jar file located in lib directory
runtime "com.easypost:easypost-java:2.1.2"
//grails plugin
compile ":shiro:1.2.1"
}
Thanks in advance for any guidance provided.
Issue 1: If that jar is a standard jar and you can reference it from maven then that would be good. But still if you need to include it from some local directory then you can do this:
repositories {
flatDir {
//Directory path containing Jar
dirs 'libs'
}
}
dependencies {
//Jar File Name - No need to add suffix .jar
compile name: 'someJarFile'
}
Issue 2: If the plugin is not listed in bintray then that means it has not been upgraded for Grails 3.x. Either you can upgrade it for yourself or remove the plugin if possible.

Resources