Could not get unknown property 'outputFile' for task ':app:packageDebug' - android

I try to execute from my terminal the command : ./gradlew testfairyDebug.
This return the next error:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:testfairyDebug'.
Could not get unknown property 'outputFile' for task ':app:packageDebug' of type com.android.build.gradle.tasks.PackageApplication.
Have you any idea to solve this problem.
For information, i work on Android Studio 3 and my gradle version is 'com.android.tools.build:gradle:3.0.0-alpha6'
My build.gradle :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.2-4'
repositories {
maven { url 'https://maven.google.com' }
maven { url 'https://www.testfairy.com/maven' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha6'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.testfairy.plugins.gradle:testfairy:1.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and my app.build.gradle :
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'testfairy'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.name.application"
minSdkVersion 15
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'
}
}
testfairyConfig {
apiKey "xxxxxxxxxxxxxxxxxxxxxxxx"
}
}
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 "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.3.1'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.lorentzos.swipecards:library:1.0.9'
compile 'com.github.rey5137:material:1.2.2'
compile 'com.squareup.picasso:picasso:2.5.2'
// Android SDK
compile 'com.facebook.android:facebook-android-sdk`enter code here`:4.+'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.android.support:recyclerview-v7:25.1.1'
compile 'testfairy:testfairy-android-sdk:1.+#aar'
}
Thanks a lot.

The error indicates that you are trying to access 'outputFile' from PackageApplication. But I didn't see it in your gradle file. Maybe it is caused by one of your modules? If that's the case, Variant API to manipulate variant outputs is broken with Gradle plugin 3.0. Only simple tasks work. Check out this page: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#variant_api

Can you please update TestFairy gradle plugin to version 2.+.
Change the classpath com.testfairy.plugins.gradle:testfairy:1.+ to com.testfairy.plugins.gradle:testfairy:2.+
in the dependencies section of your build.gradle file.

Related

having the same gradle level still throws fix the version conflict either by updating the version of the google-services plugin

I am facing this error while gradle building
Error:Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.
despite all my google versions are same
app.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.iviewlabs.mrmint"
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'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
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:26.+'
testCompile 'junit:junit:4.12'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.android.support:design:26.+'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:support-v4:26.+'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.maps.android:android-maps-utils:0.5'
compile 'com.google.android.gms:play-services-location:11.0.4'
compile 'com.squareup.okhttp:okhttp:2.6.0'
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'id.zelory:compressor:2.1.0'
compile 'com.google.firebase:firebase-messaging:11.0.4'
}
while my project level gradle is
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Please help me find the solution I have tried many solutions
in app.gradle
apply plugin: 'com.google.gms.google-services'
ADD THIS LINE AT THE END NOT AT THE TOP AS YOU HAVE DONE.
like this:-
dependencies {
}
apply plugin: 'com.google.gms.google-services'

Issues with updating my app version in gradle file

So I was using API 25 which is Nougat version, and I wanted to update my app to Version ApI27 which is newly out these days. but whenever I update to 27.0.1, this Error:
"Error:Failed to resolve: com.android.support:appcompat-v7.27.0.1"
keeps occurring. I don't know what I've done wrong and I'm struggling all day to find the resolution. Thank you very much for your time and assistance in this matter.
Oh, and I'm sure that I've downloaded SDK Versions and all the files that are needed already in SDK manager.
My Gradle File(Module App):
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.1'
defaultConfig {
applicationId "org.poream.dejaview"
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 'com.google.firebase:firebase-storage:11.6.0'
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:design:27.0.1'
compile 'com.google.android.gms:play-services-maps:11.6.0'
compile 'com.android.support:appcompat-v7.27.0.1'
compile 'com.android.support:design:27.0.1'
compile 'com.google.android.gms:play-services-maps:11.6.0'
compile 'com.android.support:cardview-v7:27.0.1'
compile 'com.google.android.gms:play-services-location:11.6.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-database:11.6.0'
compile 'com.google.firebase:firebase-crash:11.6.0'
compile 'com.google.firebase:firebase-auth:11.6.0'
compile 'com.android.support:support-v4:27.0.1'
compile 'com.android.support:recyclerview-v7:27.0.1'
compile 'com.google.android.gms:play-services-auth:11.6.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
My Gradle File(Project):
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
There is a typo (the . instead of :)
compile 'com.android.support:appcompat-v7.27.0.1'
Use:
compile 'com.android.support:appcompat-v7:27.0.1'
Add maven { url 'https://maven.google.com/' } line in your project level build.gradle
repositories {
maven { url 'https://maven.google.com/' }
}

Android Studio - Updating the Version of com.google.android.gms to 11.6.0

I always get this error in my android studio, and i dont have any idea about this, i've tried to find the solution on the Internet but i still cant find it.
This is my Gradle Image :
this is the Error Image :
In your project the errors comes like you have not add project level google classpath and not apply google plugin in app level gradle so,
Add in project level gradle
classpath 'com.google.gms:google-services:3.1.1'
Add in APP level gradle and google plugin
dependencies {
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.android.gms:play-services:11.6.0'
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
NOTE-: If you want to add more Google gradle for your requirements then add with same version.
For More https://firebase.google.com/docs/android/setup
https://developers.google.com/android/guides/setup
If you are using Google Services your Gradles should look something like this:
App level build.gradle should look like
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-crash'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.xxxxxx"
minSdkVersion 15
targetSdkVersion 26
versionCode 11
versionName "1.10"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
signingConfig signingConfigs.config
resValue("string", "PORT_NUMBER", "8081")
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
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'
})
debugCompile project(':debug-db')
compile project(':tracker')
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:multidex:1.0.2'
compile 'com.google.android.gms:play-services-location:11.6.0'
compile 'com.google.android.gms:play-services-places:11.6.0'
compile 'com.google.android.gms:play-services-maps:11.6.0'
/* compile 'com.google.android.gms:play-services:11.6.0'*/
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-crash:11.6.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.squareup.okhttp3:okhttp:3.8.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:recyclerview-v7:26.1.0'
testCompile 'junit:junit:4.12'
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
As you could see, no use for build, but it completely depends on your use /* compile 'com.google.android.gms:play-services:11.4.0'*/
And root level gradle.build is:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.1.1'
classpath 'com.google.firebase:firebase-plugins:1.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
jcenter()
mavenCentral()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Make sure your Gradle distribution in gradle-wrapper.properties is
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip

Duplicate files copied in APK lib/x86/librealm-jni.so

When I try to run my app, I get this error:
Error:Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK lib/x86/librealm-jni.so
File1: /home/redsolver/.gradle/caches/modules-2/files-2.1/io.realm/realm-android/0.84.1/b86074e6240f0f876701810a047b0261f7bd060e/realm-android-0.84.1.jar
File2: /home/redsolver/.android/build-cache/d261e339af4d29c93448691068c64db176d00257/output/jni
I got this error after adding the realm database to my project.
My app build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "net.redsolver.solver"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
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:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.vistrav:ask:2.5'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'io.paperdb:paperdb:2.1'
compile 'io.realm:realm-android:0.84.1'
compile 'com.google.firebase:firebase-crash:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
repositories {
mavenCentral()
}
My project build.gradle:
buildscript {
ext.kotlin_version = '1.1.3'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'io.realm:realm-gradle-plugin:3.5.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I think that the library destroyed something, but I don't know how to fix it.
You need to remove compile 'io.realm:realm-android:0.84.1' from app's build.gradle.
Go to build in android studio and press Clean Project
Build > Clean Project
or
Build > Rebuild Project
I got the similar issue, and fixed it with changing the dependency to provided in the module
compile 'com.amap.api:3dmap:5.5.0' -> provided 'com.amap.api:3dmap:5.5.0'
compile 'com.amap.api:search:5.5.0' -> provided 'com.amap.api:search:5.5.0'
compile 'com.amap.api:location:3.6.1' -> provided 'com.amap.api:location:3.6.1'

Gradle sync failed after switching to 3.0 canary 5

After switching to Android Studio 3.0 canary 5 I can't build my gradle after some searching i found out that the error is caused due to outdated Guava library but i am not using Guava in my project.
Project Gradle
buildscript {
ext.kotlin_version = '1.1.3'
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha5'
classpath 'com.google.gms:google-services:3.1.0'
classpath 'io.fabric.tools:gradle:1.22.2'
classpath 'com.google.firebase:firebase-plugins:1.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App Gradle
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.firebase.firebase-perf'
android {
compileSdkVersion 26
buildToolsVersion '26.0.0'
defaultConfig {
applicationId "com.nrs.nsnik.notes"
minSdkVersion 19
targetSdkVersion 26
versionCode 15
versionName "1.9.5"
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.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile 'com.android.support:appcompat-v7:26.0.0-beta2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:26.0.0-beta2'
compile 'com.android.support:design:26.0.0-beta2'
compile 'com.android.support:cardview-v7:26.0.0-beta2'
compile 'com.android.support:palette-v7:26.0.0-beta2'
compile 'com.jakewharton:butterknife:8.6.0'
compile 'com.github.fafaldo:fab-toolbar:1.2.0'
compile 'com.google.firebase:firebase-perf:11.0.2'
compile 'com.google.firebase:firebase-ads:11.0.2'
compile 'com.google.android.gms:play-services-ads:11.0.2'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
compile 'com.android.support:customtabs:26.0.0-beta2'
compile 'com.google.guava:guava:22.0-android'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
The Error :
Gradle sync failed: Cause: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
Consult IDE log for more details (Help | Show Log) (18s 189ms)
Error:(1, 0) Unable to find method 'com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V'.
Possible causes for this unexpected error include:Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
For me work
classpath ('com.google.firebase:firebase-plugins:1.1.0') {
exclude group: 'com.google.guava', module: 'guava-jdk5'
}

Categories

Resources