42

when upgrading to android-studio 3.4.x/gradle build plugin 3.4.x /gradle 5.3 ... wondering if its an issue with the android plugin.

ERROR: No value has been specified for property 'manifestOutputDirectory'.

My gradle script does not use manifest related variables, nor has it changed the manifest. The version before my upgrade is Android-Studio: 3.3/Gradle pulgin: 3.3.2/Gradle: 5.3


First Update(20190508):Fix method(temporary)

Find a temporary fix method, but the method of correcting the error is still unknown. Ways to avoid: I am a Mac OS X system: Click Android Studio->Preperences...->Experimental uncheck: Only sync the active variant.

I have studied the documentation. This feature can improve the compilation speed. If I find the fix method, I still want to continue to check “Only sync the active variant”.


Second Update(20190518):

Looking through some documents did not find a solution.

But probably find some recurring conditions for your reference.

The process of this problem is to take the initiative to start Gradle's project synchronization operation. For example, two places in the figure will occur when clicked. If there is a problem, you need to uncheck "Only sync the active variant." enter image description here

However, after successfully compiling and installing, check "Only sync the active variant.", this problem will not appear again, even if you change the build.gradle file, the top notification that needs to be synchronized again, do not click "Sync now", directly use run 'app' or debug 'app', Android-studio will automatically perform the synchronization and then compile and run, and this problem will not occur again. enter image description here

At first I thought that changing the code of build.gradle can correct this problem. Now I feel like Android-studio or gradle-plugin has some problems in executing project sync. I hope that the subsequent version will solve this problem.


Third Update(20190821):

Android-studio 3.5.0/ gradle build plugin 3.5.0/ gradle 5.4.1

Current latest stable version fixed this issue.

Enable “Only sync the active variant” is ok.

1
  • 1
    This error is occurring for me on Android Studio 3.6 Beta 3. Have tried everything mentioned here with no joy. Any help at all would be greatly appreciated.
    – paul_f
    Nov 8, 2019 at 13:03

12 Answers 12

51

Mac OS - Click Android Studio > Preferences > Experimental then you have to uncheck - Only sync the active variant.

Windows - File > settings > Experimental then you have to uncheck - Only sync the active variant.

Uncheck the option is checked

1
  • Lol. On Android 3.5 this was already checked and unchecking it fixed my problem.
    – Displee
    Jan 15, 2020 at 9:20
18

On clean PC installation I tried every trick here and nothing worked. I noticed there was logged message that licence was not accepted. I opened SDK manager, downloaded some packages that prompted me to accept licence and it started to sync.

1
  • I accidentally canceled a fresh install of android studio and I never got to the license agreements agree/cancel part. Installing a random api prompted the license agreement and fixed the issue.
    – em_
    Jan 4, 2021 at 18:23
12

This happened to me when I got a new laptop and did a fresh install of Android Studio.

I solved this by installing the proper Android SDK version that my project targets. Only API 29 was installed on my new machine when doing a fresh install of Android Studio, but my project targets API 28.

Open the SDK manager and download the proper Android SDK for your app and this error should resolve itself.

0
9

Same with @user3407078 answer.

In my case. This is due the Android Studio 3.5 updates, and I haven't installed or accepted the license & agreement for the build tools & SDK platform 29.

Checking the license for package Android SDK Build-Tools 29.0.2 in ~/Library/Android/sdk/licenses
Warning: License for package Android SDK Build-Tools 29.0.2 not accepted.
Checking the license for package Android SDK Platform 29 in ~/Library/Android/sdk/licenses
Warning: License for package Android SDK Platform 29 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> No value has been specified for this provider.

It is recommended to update the latest SDK tools & platform, in this case, version 29. Even we only develop the lower version, it is mandatory step to get working on your Android Studio.

EDITED:

  1. In a rare case, you might wanna also disable Gradle feature here thx @waqas-khalid-obeidy
  2. Or if you're using a gradlew command-line task, please navigate here for the full explanation. thx @amir-ziarati
1
  • 1
    Very similar to my problem, I didn't have the compileSDK installed for the project I was opening.
    – rob5408
    Nov 19, 2019 at 23:44
7

I just upgraded to AS 3.4 and had the same issue. This occurs when cold starting the application. Build > Make Project works fine, as does building from the command-line.

1
  • 1
    I tried, when this problem occurs, trying to clean the project, and then compiling is also successful, but every time you need a clean project, it is really annoying. . .
    – Bingerz
    May 13, 2019 at 2:56
2

After wasting my whole day, I got the solution for this problem.

Just

  1. go to the SDK manager in android studio
  2. install some SDK packages
  3. Rebuild the project

Resolved!

0

In my case the problem was I opted in for incremental option

To solve the problem

open gradle.properties file and remove line

kapt.incremental.apt=true   //remove or comment this line
0

Could be missing Java JDK, might want to check tha

0

for my case it was because some sdk licenses were not accepted. i figured it out when i ran the gradlew through the command line. the link below shows you how to accept all the licenses through sdkManager tool.

You have not accepted the license agreements of the following SDK components

0

In my case, I haven't installed compileSdkVersion supported SDK.

eg: If you have mentioned your compileSdkVersion 28. make sure it is installed in your SDK manager. Install it if you don't have it already.

0

In my case, I used the other folder for the Android SDK and found the error when syncing with gradle. When I change folder to the default ("/Users/xxx/AppData/Local/Android/Sdk"), it's solved!.

-2

start Android Studio by "Run as Amdinistrator"

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.