I have just downloaded latest Android Studio 3.0 Preview Canary 2. It has updated my project with latest gradle com.android.tools.build:gradle:3.0.0-alpha2. And now I have a lot of compile crashes like:
ERROR: C:\Users\??????\\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.3.1.aar\a33e01f0d19405567201ecab1e032796\res\drawable-xhdpi-v4\notification_bg_low_normal.9.png not a valid resource file
ERROR: C:\Users\??????\\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.3.1.aar\a33e01f0d19405567201ecab1e032796\res\drawable-xhdpi-v4\notification_bg_low_normal.9.png not a valid resource file
ERROR: C:\Users\??????\\.gradle\caches\transforms-1\files-1.1\design-25.3.1.aar\ab2edc05ef7bbad4b3861a867a381098\res\drawable-xxxhdpi-v4\design_ic_visibility.png not a valid resource file
ERROR: C:\Users\??????\\.gradle\caches\transforms-1\files-1.1\design-25.3.1.aar\ab2edc05ef7bbad4b3861a867a381098\res\drawable-xxxhdpi-v4\design_ic_visibility.png not a valid resource file
ERROR: C:\Users\??????\\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.3.1.aar\a33e01f0d19405567201ecab1e032796\res\drawable-mdpi-v4\abc_menu_hardkey_panel_mtrl_mult.9.png not a valid resource file
ERROR: C:\Users\??????\\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.3.1.aar\a33e01f0d19405567201ecab1e032796\res\drawable-mdpi-v4\abc_menu_hardkey_panel_mtrl_mult.9.png not a valid resource file
ERROR: C:\Users\??????\\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.3.1.aar\a33e01f0d19405567201ecab1e032796\res\drawable-xxxhdpi-v4\abc_spinner_mtrl_am_alpha.9.png not a valid resource file
ERROR: C:\Users\??????\\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.3.1.aar\a33e01f0d19405567201ecab1e032796\res\drawable-xxxhdpi-v4\abc_spinner_mtrl_am_alpha.9.png not a valid resource file
ERROR: C:\Users\??????\\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.3.1.aar\a33e01f0d19405567201ecab1e032796\res\drawable-mdpi-v4\abc_btn_check_to_on_mtrl_000.png not a valid resource file
FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':app:mergeDebugResources'.
> Error: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed: aapt2 compile -o D:\AndroidProjects\GetPet\app\build\intermediates\res\merged\debug C:\Users\user\\.gradle\caches\transforms-1\files-1.1\design-25.3.1.aar\ab2edc05ef7bbad4b3861a867a381098\res\layout\design_navigation_item.xml Issues:
- ERROR: C:\Users\user\\.gradle\caches\transforms-1\files-1.1\design-25.3.1.aar\ab2edc05ef7bbad4b3861a867a381098\res\layout\design_navigation_item.xml not a valid resource file
I have tried to clean project and gradle cache, but useless.
My build.gradle
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And app\build.gradle
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'alias'
keyPassword 'pass'
storeFile file('release_keystor.jks')
storePassword 'pass'
}
}
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.org.app"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.config
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.3.1'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.3.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.vk:androidsdk:1.6.5'
}
Try to change service directory path to something without cyrillic symbols, like "C:/gradle" in
Settings > Build, Execution, Deployment > Gradle
And don't forget to invalidate caches.
Related
i'm having an issue with my code when i try to run the app these errors shows up but i really don't know how to solve this all the dependencies Update tried to clean rebuild and validate chache but nothing happened here is the gradle file and the project gradle of the app any help is appreciated
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://jitpack.io'
}
maven {
url 'https://maven.google.com'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.amiapp.videodownloader"
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 {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile files('libs/glide-3.6.0.jar')
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:27.0.2'
compile 'com.google.android.gms:play-services-ads:11.8.0'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.firebase:firebase-crash:11.8.0'
compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:recyclerview-v7:27.0.2'
compile 'com.github.turhanoz:reactivedirectorychooser:2.0.1'
compile 'com.timqi.sectorprogressview:library:2.0.1'
compile 'com.geniusforapp.fancydialog:FancyDialog:0.1.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Error:(10, 32) error: cannot find symbol class TransportMediator
Error:(98, 31) error: cannot find symbol variable TransportMediator
TransportMediator can be found in the v4 Support Library.
Include 'compile com.android.support:support-v4:27.0.2' in your module-level build.gradle file.
I'm getting a grade build error when i want to launch my project. It goes like that:
Error:Execution failed for task ':app:processDebugResources'.
> java.lang.IllegalArgumentException (no error message)
I copy pasted some stuff into this project, which caused a few errors before, so it might be an error because of copy/pasting...
Here is my build.grade files:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and another build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.leodr.upgradeadmin"
minSdkVersion 15
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 {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile files('libs/gson-1.4.jar')
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
I hope you can help me, TY for your help!
Update your project level build.grade:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and your module level build.gradle :
Change these line:
compileSdkVersion 26
buildToolsVersion "26.0.2"
to:
compileSdkVersion 27 //buildToolsVersion is not needed
and:
targetSdkVersion 26
to:
targetSdkVersion 27
and the dependency line:
compile 'com.android.support:appcompat-v7:26.+'
to:
compile 'com.android.support:appcompat-v7:27.0.1'
Now sync your project and if it prompts your to download just click on the link in the error to download.
I'm trying to send an e-mail like in this post:
Sending Email in Android using JavaMail API without using the default/built-in app
And adding in my build.gradle and app file this lines: https://javaee.github.io/javamail/Android
Error:
Error:Execution failed for task
':app:transformClassesWithDexForDebug'. >
com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException: com.android.dex.DexException:
Multiple dex files define
Lcom/sun/activation/registries/LineTokenizer;
But with the following app file I have a execution failed and don't know why.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.github.ocaparrostortosa.MyApplication"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
pickFirst 'META-INF/LICENSE.txt' // picks the JavaMail license file
}
}
dependencies {
compile 'com.sun.mail:android-mail:1.5.5'
compile 'com.sun.mail:android-activation:1.5.5'
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.google.firebase:firebase-database:10.2.1'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.android.gms:play-services-auth:10.2.1'
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
And this one is my Project gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.java.net/content/groups/public/"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Can someone help me please? I'm close to finish the project :D
P.D: Sorry for my English and for the presentation, I'm new in stackoverflow.
this error is quite tricky. i also had a hard time on this. I solve my problem somehow by adding this multiDexEnabled true on my gradle build.config
android {
defaultConfig {
minSdkVersion 14 x
targetSdkVersion 23
multiDexEnabled true
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
Take note, this solution is case to case basis.
One scenario is - my app was very large that it exceeds 64MB limit. If this does not work, check your dependencies.
Other scenario was caused by Google Maps API dependencies that the version needs to be inline with the APP target SDK.
Well I have some errors when I put the MySQL connector and I don`t know why.
I have researched in here(stackoverflow) and I've tried to change the build.gradle app or the modules and it doesn't working. If anyone knows what's the problem it would help me a lot.. Thank You..
Errors:
Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process
Errors in Android Studio
I add my code to:
build.gradle app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.example.informatica.xabiagame"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9'
compile 'com.android.support:design:24.2.1'
compile 'com.google.android.gms:play-services-maps:9.6.1'
compile 'com.google.android.gms:play-services-ads:9.6.1'
compile 'com.google.android.gms:play-services:9.6.1'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-auth:9.6.1'
compile project(':MySQL')
}
apply plugin: 'com.google.gms.google-services'
Project module:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
MySQL module:
configurations.maybeCreate("default")
artifacts.add("default", file('mysql-connector-java-5.1.37-bin.jar'))
My be a bit late, but I have just found the solution for this problem:
MySQL connector 5.1 is compiled with Java 8.
Even now Android Studio 2.3 is not directly supporting Java 8.
You could write in the app/build.gradle this code:
android {
defaultConfig
{
jackOptions
{
enabled true
}
compileOptions
{
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
https://developer.android.com/guide/platform/j8-jack.html
I want to migrate from GCM to FCM. I have upgraded the version my libraries to implement FCM. I got this error after click on Sync Now.
Note: JDK 1.7,Android Studio 2.2, and Adndroid version 23.
Error
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
Error:Execution failed for task ':app:processDebugGoogleServices'.
> No matching client found for package name 'healysta.tenwave.com.doctor'
Information:BUILD FAILED
Information:Total time: 0.521 secs
Information:1 error
Information:2 warnings
Information:See complete output in console
build.gradle
apply plugin: 'com.android.application'
android {
signingConfigs {
release {
storeFile file("/home/jenkin/5.1.2/docapp.jks")
storePassword "*****"
keyAlias "Tenwave"
keyPassword "*******"
}
}
/*compileSdkVersion 21*/
compileSdkVersion 23
buildToolsVersion '22.0.1'
sourceSets.main {
jniLibs.srcDir 'libs'
jni.srcDirs = [] //disable automatic ndk-build call
}
defaultConfig {
applicationId "healysta.tenwave.com.doctor"
minSdkVersion 14
//targetSdkVersion 21
targetSdkVersion 23
versionCode 7
versionName "2.1.2"
signingConfig signingConfigs.release
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
productFlavors {
}
}
dependencies {
//compile 'com.google.android.gms:play-services-analytics:7.5.0'
compile 'com.google.android.gms:play-services-analytics:9.6.1'
//compile 'com.google.android.gms:play-services-gcm:7.5.0'
compile "com.google.firebase:firebase-messaging:9.0.2"
//compile 'com.google.android.gms:play-services-location:7.5.0'
compile 'com.google.android.gms:play-services-location:9.6.1'
//compile 'com.google.android.gms:play-services-drive:7.5.0'
compile 'com.android.support:support-v13:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:cardview-v7:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.google.code.gson:gson:2.+'
compile('com.google.api-client:google-api-client:1.+') {
exclude group: 'xpp3', module: 'shared'
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'junit', module: 'junit'
exclude group: 'com.google.android', module: 'android'
}
compile 'com.google.api-client:google-api-client-android:1.17.+'
compile 'com.google.apis:google-api-services-plus:+'
compile 'com.github.japgolly.android:svg-android:2.0.6'
compile fileTree(dir: 'libs', include: '*.jar')
compile files('../third_party/glide/library/libs/glide-3.2.0a.jar')
compile files('../third_party/basic-http-client/libs/basic-http-client-android-0.88.jar')
// Google Maps Android API utility library
compile('com.google.maps.android:android-maps-utils:0.3+') {
exclude group: "com.google.android.gms"
}
compile 'com.google.http-client:google-http-client-gson:1.+'
//compile 'com.google.apis:google-api-services-drive:+'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
//for apprtc
compile files('libs/autobanh.jar')
//compile files('libs/libjingle_peerconnection_java.jar')
compile files('libs/libjingle_peerconnection.jar')
//compile files('../third_party/webrtc/autobanh.jar')
//compile files('../third_party/webrtc/libjingle_peerconnection.jar')
compile 'com.android.support:multidex:1.0.0'
//for firebase cloud messaging
//compile 'com.google.firebase:firebase-core:9.6.1'
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
Top level gradle.build
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'http://dl.bintray.com/amulyakhare/maven'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.google.gms:google-services:1.3.0-beta1'
classpath 'com.google.gms:google-services:3.0.0'
// classpath 'com.google.gms:google-services:1.5.0-beta2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
There seems to be a problem with your gradle settings. try the following change:
compileSdkVersion 23
buildToolsVersion "23.0.3"
Then Sync again
The problem is that you don't a node that defines healysta.tenwave.com.doctor in your google-services.json.
Also, you have multiple classpath declarations of the google services plugin. Just use 3.0.0