I'm importing JellyRefreshLayout as modul (for some updates)
check this link :
https://github.com/allan1st/JellyRefreshLayout
but I always get this gradle build error :
Information:Gradle tasks [:app:generateDebugSources,
:app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :jellyrefresh:generateDebugSources, :jellyrefresh:mockableAndroidJar, :jellyrefresh:prepareDebugUnitTestDependencies, :jellyrefresh:generateDebugAndroidTestSources]
extractDebugAnnotations is incompatible with java 8 sources and has been disabled.
extractReleaseAnnotations is incompatible with java 8 sources and has been disabled.
:jellyrefresh:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:jellyrefresh:compileReleaseJavaWithJavac UP-TO-DATE
:jellyrefresh:compileRetrolambdaRelease FAILED
Error:Execution failed for task ':jellyrefresh:compileRetrolambdaRelease'.
> Could not resolve all dependencies for configuration ':jellyrefresh:retrolambdaConfig'.
> Could not resolve net.orfjackal.retrolambda:retrolambda:2.0.3.
Required by:
JellyRefreshLayout-master:jellyrefresh:unspecified
> No cached version of net.orfjackal.retrolambda:retrolambda:2.0.3 available for offline mode.
> No cached version of net.orfjackal.retrolambda:retrolambda:2.0.3 available for offline mode.
project gradle build :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'me.tatarka:gradle-retrolambda:3.2.0'
}
}
allprojects {
repositories {
jcenter()
}
}
App gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "uk.co.imallan.jellyrefreshlayout"
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
compile project(":jellyrefresh")
}
Library model :
repositories {
mavenCentral()
}
apply plugin: 'com.android.library'
apply plugin: 'me.tatarka.retrolambda'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
}
Note : my project JDK selection and Default JDK is:
/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home
Please Advice !
Thanks !
it's solved now .
The problem was : the internal_impl.jar is not on the retrolambda classpath sometimes.
because one of the following :
because dependencies might be updated in 2nd execution.
Maybe it is a bug in the Gradle Android plugin.
The Solution is :
I run gradle cleaning and assembling in commands from gradle terminal befor syncing gradle :
./gradlew clean assembleDebug
from Gradle terminal .
please check this helpful conversation :
https://github.com/evant/gradle-retrolambda/issues/105
Related
In application I have an error:
Error:Execution failed for task
':buildPropTweakerPro:transformClassesWithInstantRunForDebug'.
> java.lang.RuntimeException: Method code too large!
but I don't have any classes, that was bigger than 64KB.
Gradle version, what I use, is 2.3.3
When I use gradle version 3.0.0 I have an error:
Error:Execution failed for task
':buildPropTweakerPro:transformClassesWithInstantRunForDebug'.
> java.lang.ClassFormatError (no error message)
My build.gradle file:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.24.4'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 26
buildToolsVersion '27.0.1'
defaultConfig {
applicationId "com.xxx"
minSdkVersion 16
versionCode 19
versionName "1.3.3"
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "8g"
}
lintOptions {
checkReleaseBuilds false
abortOnError true
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.startapp:inapp-sdk:3.6.6'
compile 'com.google.android.gms:play-services-ads:11.4.2'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-core-utils:26.1.0'
compile 'com.jakewharton:butterknife:8.6.0'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
}
I searched many questions on internet, but do not have any answers, but in the error, I do not have answer, in what file I have too large method.
Any advice?
disable instant run in android studio settings
Just Enable Multidex
android {
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
}
This is the error:
Error:(23, 13) Failed to resolve: com.android.support.constraint:constraint-
layout:1.1.0-beta1
Upgrade plugin to version 2.3.3 and sync project
Show in File
Show in Project Structure dialog
When i click in upgrade plugin, nothing happens. I dont know how to fix this. I have tried adding the repository maven google but it doesn't work.
Here is the app code:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.google.googleio"
minSdkVersion 22
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.1.0-beta1'
}
To use ConstraintLayout 1.1.0 beta1 you have to add the google maven repo:
repositories {
maven {
url 'https://maven.google.com'
}
}
More info here.
This question already has answers here:
Error:(23, 17) Failed to resolve: junit:junit:4.12
(47 answers)
Closed 6 years ago.
I am using Android Studio 1.4 and every time I create a new project same error happen
Error:(23, 17)"Failed to resolve: junit:junit:4.12".
I read previous post about same problem
Error:(23, 17) Failed to resolve: junit:junit:4.12
and done all the the given answer but despite adding URL ('http://repo1.maven.org/maven2' and 'http://jcenter.bintray.com/') for missing repository the error remains
here is my latest build.gradle code
apply plugin: 'com.android.application'
android {
compileSdkVersion 14
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 14
targetSdkVersion 14
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.+'
}
If you are adding them to buildscript you will get an error.
It is a difference between the buildscript repository and the repositories for the dependencies. The buildscript is used for gradle build dependencies.
You will need to add the following to your build.gradle file and it should work fine.
repositories {
maven { url 'http://repo1.maven.org/maven2' }
jcenter { url "http://jcenter.bintray.com/" }
}
Following should work:
apply plugin: 'com.android.application'
repositories {
maven { url 'http://repo1.maven.org/maven2' }
jcenter { url "http://jcenter.bintray.com/" }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.application"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}
For me it was that allprojects section was missing in the top level gradle build file:
buildscript {
[...]
}
allprojects { // <-- required!!!
repositories {
jcenter()
}
}
go to the android studio libs directory
(C:\Program Files\Android\Android Studio\lib)
find junit-4.12.jar file
copy the jar file to your project libs folder
(myproject\app\libs)
open android studio and delete(comment) this line
(testCompile 'junit:junit:4.12') in build.gradle file
in android studio open (libs) directory and right click the jar file then choose add as a library
just build your project (for more info see below picture)
solved Error:(23, 17) Failed to resolve: junit:junit:4.12
I've been receiving the following error:
Error:Execution failed for task ':app:dexDebug'.>
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
'/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java''
finished with non-zero exit value 2
This is my current dependency. I have been trying to figure out how to resolve this error but I just can not figure it out. Any suggestions or help will be greatly appreciated.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.vokanovich.myapplication"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile ("com.magnet.mmx:magnet-mmx-client-android:1.9.1#aar") {
transitive=true
}
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.android.gms:play-services-base:7.8.0'
compile 'com.google.android.gms:play-services-gcm:7.8.0'
compile('com.mikepenz:materialdrawer:4.3.7#aar') {
transitive = true
}
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
}
And this is my other build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
maven {
url "https://repo.magnet.com/artifactory/public"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The issue was that it exceeded 65k methods. It was resolved by applying the following solution: https://stackoverflow.com/a/31759781/1371041
I had the same problem. Just write inside defaultConfig in build.gradle
defaultConfig {
multiDexEnabled true
}
Hope this help you!)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.0.2"
defaultConfig {
applicationId "com.sample.app"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
apply plugin: 'maven'
repositories {
maven {
url "http://mycompany.com/nexus/content/repositories/mobile/Android/common/rest-api/1.0/"
artifactUrls "http://mycompany.com/nexus/content/repositories/mobile"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'Android.myApp:rest-api:1.0'
}
above the build.gradle file. When I execute gradle tasks I'm getting
A problem occurred configuring root project 'app'.
Could not resolve all dependencies for configuration ':_debugCompile'.
Could not resolve Android.myApp:rest-api:1.0.
Required by:
:app:unspecified
Target host must not be null, or set in parameters.
confirmed pom files and jar files are present in the maven repo.
Its silly.
maven {
url 'http:////mycompany.app.com/nexus/content/repositories/mobile'
}
url should contain 4 //// after http. We are using nexus and this fixes the issue.