I m trying to build the iosched app on ubuntu 14.04 on android studio 0.8 . After importing the setting.gradle file and following the build instruction I get an error saying
Error
:FAILURE: Build failed with an exception.
* What went wrong:
Task 'assemble' not found in root project 'iosched'.
* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
The solution mentioned in this post doesn't work either.
Try to add this: task assemble{} in your root build.gradle file.
According to this thread it helps (it helped me as well).
In my case, it was because my project implemented a Module that was an android-library (deprecated) / com.android.library which used a minSdkVersion lower than my project.
Be sure that your project and android-library / com.android.library have the same minSdkVersion.
Related
After i have updated android studio to 3.4.2 and gradle,
when i run this line
gradlew publishApkappNameRelease
im getting this error :
* What went wrong: Some problems were found with the configuration of task ':app:generateappNameReleasePlayResources'.
> File 'E:\Projects\packagename\app\src\main\play' specified for property '$1' does not exist.
> File 'E:\Projects\packagename\app\src\appName\play' specified for property '$2' does not exist.
> File 'E:\Projects\packagename\app\src\release\play' specified for property '$3' does not exist.
> File 'E:\Projects\packagename\app\src\appNameRelease\play' specified for property '$4' does not exist.
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2m 47s 56 actionable tasks: 55 executed, 1 from cache
note: this line is used to auto publish apk using
apply plugin: 'com.github.triplet.play'
classpath 'com.github.triplet.gradle:play-publisher:1.1.5'
same when i run this command line gradlew --recompile-scripts i get error
Unknown command-line option '--recompile-scripts'
These commands were running fine before the updates.
UPDATE:
when i try to update the triplet.play to any of t hose versions (2.2.1 - 2.2.0 - 2.1.1 - 2.1.0 - 2.0.0 - 2.0.0-rc2) i get this error
Could not find com.github.triplet.gradle:play-publisher:2.2.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/triplet/gradle/play-publisher/2.2.1/play-publisher-2.2.1.pom
- https://dl.google.com/dl/android/maven2/com/github/triplet/gradle/play-publisher/2.2.1/play-publisher-2.2.1.jar
- https://jcenter.bintray.com/com/github/triplet/gradle/play-publisher/2.2.1/play-publisher-2.2.1.pom
- https://jcenter.bintray.com/com/github/triplet/gradle/play-publisher/2.2.1/play-publisher-2.2.1.jar
- https://repo.maven.apache.org/maven2/com/github/triplet/gradle/play-publisher/2.2.1/play-publisher-2.2.1.pom
- https://repo.maven.apache.org/maven2/com/github/triplet/gradle/play-publisher/2.2.1/play-publisher-2.2.1.jar
Required by:
project :
Apparently this can be fixed by upgrading the version of the play-publisher plugin from 1.1.5 to 2.1.1 as per the GitHub issue here: https://github.com/Triple-T/gradle-play-publisher/issues/532
However, it seems that the newer versions of the plugin aren't available on all artifact repositories. I found it here which has clear steps of doing it: https://plugins.gradle.org/plugin/com.github.triplet.play
Lastly it is advised that you check their GitHub page again to make sure that the config you currently have is still compatible: https://github.com/Triple-T/gradle-play-publisher
With regards to gradlew --recompile-scripts, this has been deprecated and removed in the new version since most of the times the gradle daemon is running and ignores this option. More info here: https://github.com/gradle/gradle/issues/1425
First, add a new repo to your repositories on build.gradle (Project)
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
Now , upgrade your classpath.
classpath 'com.github.triplet.gradle:play-publisher:2.1.1'
I'm trying to import an .aar file
to clear variable, I started a new Flutter project in android studio
than I followed the classical procedure:
file-> new-> new module-> import jar/aar package
after selecting the file I get this message:
Unable to get Gradle wrapper properties from:
C:...\myApp\gradle\wrapper\gradle-wrapper.properties
Would you like to recreate the wrapper using the latest supported Gradle version?
Click 'OK' to recreate files, or 'Cancel' to manually set the path of
a local Gradle distribution.
I tried both (every time starting a new app)
and later I'm asked to update gradle (to 4.10.1)
at this point I get the error:
The project 'myApp' is not a Gradle-based project
please not that I don't have any of this problems while importing the same .aar
in to a Kotlin project
can you help me to figure out how to import this .aar please?
thanks in advance
Francesco
[EDIT] I've tried to import manually the .aar file following this LINK
and when I run it gradle fail to build returning this error
[EDIN N°2] I've used 'api/implementation' instead of compile as suggested by ''shadowsheep'', the result is the following:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\...\myApp\android\build.gradle' line: 11
* What went wrong:
Could not compile build file 'C:\...\myApp\android\build.gradle'.
> startup failed:
build file 'C:\...\myApp\android\build.gradle': 11: expecting '}', found 'project' # line 11, column 28.
api/implementation project(':barcodeScannerLibrary')
^
1 error
* 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
BUILD FAILED in 2s
Command: C:\...\myApp\android\gradlew.bat app:properties
Any help?
I just switched to Android Studio 2 and I'm trying to use Google Play services in my app. But I faced a really strange from the very beginning. Adding to Gradle.build such dependencies:
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0
cause error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> com.android.manifmerger.ManifestMerger2$MergeFailureException: java.io.FileNotFoundException: /media/valentyn/Seagate Backup Plus Drive/workspace/Studio Projects
16.02.16/LocalVenues/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-maps/8.4.0/AndroidManifest.xml (No such file or directory) Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Can it be some conflict with installed libraries in SDK Manager or what else?
I had the same kind of problem, caused by the new Instant Run in Android Studio 2, I solved it with:
Build > Rebuild Project
Run again.
The funny thing that this issue was related to NTFS file system of my portable driver. After moved my project, this problem was solved.
I am trying to build a signed APK with Android Studio.
I am getting the following error:
java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.typehandling.ShortTypeHandling
My research leads me to understand that this is caused by one of my dependencies being compiled with an old version of Groovy. My only dependency is the Google Maps API, so that must be it.
(this is a thread that talks some on the issue)
However, I am unable to find a solution to this problem. I have tried several ways of adding the Groovy backports compat 2.3.5:
- adding it to gradle dependencies and syncing the project
- manually adding it to m2
- downloading the jar and adding it as a library
None of these have been successful. It is possible however, that one of these solutions may work, but that I am missing some key piece of information necessary.
If you know what that might be, or if you have another way to solve this, I'd like to hear from you.
Thanks.
[Edit]Here is some additional information
C:\Users\Donald\AndroidStudioProjects\ReuseAndRepairAndroid>gradle dependencies --info
Starting Build
Starting file lock listener thread.
Settings evaluated using settings file 'C:\Users\Donald\AndroidStudioProjects\ReuseAndRepairAndroid\settings.gradle'.
Projects loaded. Root project using build file 'C:\Users\Donald\AndroidStudioProjects\ReuseAndRepairAndroid\build.gradle'.
Included projects: [root project 'ReuseAndRepairAndroid', project ':app']
Evaluating root project 'ReuseAndRepairAndroid' using build file 'C:\Users\Donald\AndroidStudioProjects\ReuseAndRepairAndroid\build.gradle'.
Evaluating project ':app' using build file 'C:\Users\Donald\AndroidStudioProjects\ReuseAndRepairAndroid\app\build.gradle'.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Donald\AndroidStudioProjects\ReuseAndRepairAndroid\app\build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not create plugin of type 'AppPlugin'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 2.982 secs
[/Edit]
I'm following an article from http://fernandocejas.com/2014/09/03/architecting-android-the-clean-way/ and downloaded the sample git hub project https://github.com/android10/Android-CleanArchitecture.
The project has been build using gradle, since my previous projects was build using the default builder of android, i found this hard building the project.
I already set up the environment of the gradle. but when I tried to build the project using gradle build on the root folder i get this error.(NOTE: Im using Intellij as my IDE)
I first performed gradle build in the root folder but received this error:
* Where:
Build file '/Users/magic/Desktop/android/myProjects/TestingProjects/Android Clean Architecture/Android-CleanArchitecture-master/data/build.gradle' line: 1
What went wrong:
A problem occurred evaluating project ':data'.
Failed to apply plugin [id 'android-library']
Gradle version 1.10 is required. Current version is 2.1. If using the gradle wrapper, try editing the distributionUrl in /Users/magic/Desktop/android/myProjects/TestingProjects/Android Clean Architecture/Android-CleanArchitecture-master/gradle/wrapper/gradle-wrapper.properties to gradle-1.10-all.zip
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
So, i went to folder gradle and change the gradle-wrapper.properties to gradle-1.10-all.zip and perfomed ./gradlew build but got this error:
FAILURE: Build failed with an exception.
Where:
Build file '/Users/Magic/Desktop/android/myProjects/TestingProjects/Android Clean Architecture/Android-CleanArchitecture-master/data/build.gradle' line: 9
What went wrong:
A problem occurred evaluating project ':data'.
Could not find method applicationId() for arguments [com.fernandocejas.android10.sample.data] on ProductFlavorDsl_Decorated{name=main, minSdkVersion=-1, targetSdkVersion=-1, renderscriptTargetApi=-1, renderscriptSupportMode=null, renderscriptNdkMode=null, versionCode=-1, versionName=null, packageName=null, testPackageName=null, testInstrumentationRunner=null, testHandleProfiling=null, testFunctionalTest=null, signingConfig=null, resConfig=null}.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
and its pointing to line 9
defaultConfig {
applicationId "com.fernandocejas.android10.sample.data" //line 9
minSdkVersion 15
targetSdkVersion 19
}
I would really appreciate your inputs with this.
Thanks.
I just downloaded that project, imported it into Intellij 13.1 (using the gradle wrapper), and it worked out of the box. You have made changes to the build.gradle files that have broken it. It is hard to say what the issue is without all your gradle files posted here. One indication that the gradle files have been modified is that one of the errors you gave was:
Failed to apply plugin [id 'android-library']
But the example does not apply this plugin, it applies the correct one, i.e.:
apply plugin: 'com.android.library'
Try getting that project again and don't change the gradle build files. Also make sure you are importing with the gradle wrapper, and not your local distribution of gradle.
I hope this helps!