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
}
}
Related
updated my project to gradle 3 and generated this error
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
in another questions says "libraries having transitive dependency " but i don't find the library with this transitive dependency
in gradle 2.3 don't show this error
build.gradle app
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
compileOptions.encoding = 'UTF-8'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.my.my"
minSdkVersion 17
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
jni.srcDirs = ["libs"]
}
}
packagingOptions {
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':dd-plist')
compile project(':Emojicon')
compile project(':CameraModule')
compile project(':ScapeUtils')
compile project(':circleimageview')
compile project(':FFMPG')
compile project(':PdfViewer')
compile project(':LibLinphone')
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.github.bumptech.glide:glide:3.6.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.ornolfr:rating-view:0.1.1#aar'
compile 'cat.ereza:customactivityoncrash:1.5.0'
compile 'com.writingminds:FFmpegAndroid:0.3.2'
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile "com.android.support:appcompat-v7:26.1.0"
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'org.apache.commons:commons-io:1.3.2'
}
apply plugin: 'com.google.gms.google-services'
build.gradle project
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.0.0'
}
I am battling also with this or similar problem. I have set to use the old gradle version manually. From File/Project structure/projet I have put gradle version 3.4.1 and plugin version 2.3.3
I have also added multiDexEnabled true in app/build.gradle inside defaultConfig Hth
While adding below dependency in build.gradle
compile 'com.facebook.android:audience-network-sdk:4.+'
The run project is giving error
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzf.class
App, build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.xyz.abc"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
pickFirst 'META-INF/maven/com.squareup.picasso/picasso/pom.properties'
pickFirst 'META-INF/maven/com.squareup.picasso/picasso/pom.xml'
}
}
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.android.support:recyclerview-v7:23.0.+'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.firebase:firebase-core:9.0.2'
compile 'com.google.firebase:firebase-messaging:9.0.2'
compile 'com.facebook.android:audience-network-sdk:4.+'
compile 'com.squareup.picasso:picasso:2.5.2'
}
apply plugin: 'com.google.gms.google-services'
What can be possible solution for it?
Try this
compile('com.facebook.android:audience-network-sdk:4.13.0')
{
exclude group: 'com.google.android.gms'
}
Update Gradle and Android Studio to latest version and it starts working.
I have used searchview in my project with dependency compile 'com.lapism:searchview:3.0.2' in build.gradle file. But while I'm trying run the application I'm getting an error
Error: package com.lapism.searchview.view does not exist
Error:
cannot find symbol class SearchView
Error:Execution failed for task
':app:compileDebugJavaWithJavac'.
My current android version is 2.1
My Build.gradle File:
buildscript {
repositories
{
maven { url 'https://maven.fabric.io/public' }
}
dependencies
{
classpath 'io.fabric.tools:gradle:1.+'}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
multiDexEnabled true
applicationId "pingo.betnek.mobigrab"
minSdkVersion 16
targetSdkVersion 15
versionCode 2
versionName "1.1"
}
dexOptions
{
incremental true
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
repositories {
jcenter()
mavenCentral()
maven {
url "https://jitpack.io"
}
maven { url 'https://maven.fabric.io/public' }
}
dependencies
{
provided fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/mail.jar')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'io.realm:realm-android:0.87.2'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.lapism:searchview:3.0.2'
compile 'com.googlecode.libphonenumber:libphonenumber:7.2.7'
compile 'com.android.support:multidex:1.0.1'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar')
{
transitive = true;
}
}
Show us your code usage..
In any case, change com.lapism.searchview.view.SearchView to com.lapism.searchview.SearchView, or just remove the imports and let Android Studio re-import them with the correct namings.
It has been refactored since 2.3 or whatever version..
hi i'm newbie with Android studio, after updating from android studio 1.4 to 2.1, I am getting the following build error when I try and sync my project:
Gradle sync failed: Gradle DSL method not found: 'classpath()'
and Here is the build.gradle:
apply plugin:'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "android.arisa.---------"
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
//multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
exclude module: 'support-v4'
}
compile('com.afollestad.material-dialogs:core:0.8.1.0#aar') {
transitive = true
}
compile('com.afollestad.material-dialogs:commons:0.8.1.0#aar') {
transitive = true
}
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.google.android.gms:play-services-maps:7.8.0'
compile 'com.google.android.gms:play-services-location:7.8.0'
//compile 'com.android.support:multidex'
//compile 'com.mcxiaoke.volley:library-aar:1.0.0'
//compile 'com.mcxiaoke.volley:library:1.+'
compile files('/Users/Bmaster/AndroidStudioProjects/KalahroodFinal/.idea/libraries/jsoup-1.8.3.jar')
compile files('/Users/Bmaster/AndroidStudioProjects/KalahroodFinal/jsoup-1.8.3.jar')
compile files('/Users/Bmaster/AndroidStudioProjects/KalahroodFinal/libraries/jsoup-1.8.3.jar')
compile 'com.google.android.gms:play-services:8.3.0'
}
repositories {
jcenter()
}
//repositories {
// maven { url "https://jitpack.io" }
//}
and the gradle-wrapper.properties is:
#Sat Apr 30 11:59:41 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
#distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
How can i correct this?(please help me)
edit: After editing grade, my android gradle is:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "android.arisa.kalahroodfinal"
minSdkVersion 10
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
exclude module: 'support-v4'
}
compile('com.afollestad.material-dialogs:core:0.8.1.0#aar') {
transitive = true
}
compile('com.afollestad.material-dialogs:commons:0.8.1.0#aar') {
transitive = true
}
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.google.android.gms:play-services-maps:7.8.0'
compile 'com.google.android.gms:play-services-location:7.8.0'
compile files('/Users/Bmaster/AndroidStudioProjects/KalahroodFinal/.idea/libraries/jsoup-1.8.3.jar')
compile files('/Users/Bmaster/AndroidStudioProjects/KalahroodFinal/jsoup-1.8.3.jar')
compile files('/Users/Bmaster/AndroidStudioProjects/KalahroodFinal/libraries/jsoup-1.8.3.jar')
compile 'com.google.android.gms:play-services:8.3.0'
}
but i have new error:
Error:(43, 13) Failed to resolve: com.afollestad.material-dialogs:commons:0.8.1.0
Error:(40, 13) Failed to resolve: com.afollestad.material-dialogs:core:0.8.1.0
Try to remove the classpath 'com.android.tools.build:gradle:2.1.0' string.
I also would recommend you to create new project in Android studio 2.1 and compare the gradle files generated by IDE with yours.
You are using
classpath 'com.android.tools.build:gradle:2.1.0'
in the wrong block.
More it in the top-level build.gradle file (in the root of your project)
// 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:2.1.0'
}
}
To solve the issue with the library material dialog you have to add the repository from which download the dependencies:
In your top-level build.gradle file add the jitpack repo:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
I'm building android application and I have problem to build it. My build.gradle file contains:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.nakupniseznam"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
flatDir {
dirs 'aars'
}
}
}
dependencies {
//compile fileTree(include: ['*.jar'], dir: 'libs')
repositories {
maven {
url "http://dl.bintray.com/microsoftazuremobile/SDK"
}
}
compile files('libs/notification-hubs-0.3.jar')
compile files('libs/azure-notifications-handler-1.0.1.jar')
compile 'com.google.code.gson:gson:2.4'
compile 'com.google.guava:guava:18.0'
compile 'com.microsoft.azure:azure-mobile-services-android-sdk:2.0.3'
compile 'com.microsoft.azure:azure-notifications-handler:1.0.1#jar'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:support-v4:23.2.0'
}
And the build error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/microsoft/windowsazure/notifications/BuildConfig.class
Still the same error.
Try to exclude multidex, but without success and I really don't know why :(