Android Build

JWB

New member
Joined
Oct 22, 2021
Messages
7
Hi,
Trying to do an Android Build but getting error:-

------------------------------------------------------------------------------------------------------------
FAILURE: Build failed with an exception.



* What went wrong:

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

> Failed to install the following Android SDK packages as some licences have not been accepted.

patcher;v4 SDK Patch Applier v4

platforms;android-30 Android SDK Platform 30

emulator Android Emulator

build-tools;30.0.3 Android SDK Build-Tools 30.0.3

platform-tools Android SDK Platform-Tools

tools Android SDK Tools

To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.

Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html



Using Android SDK: C:\Program Files\Android\Android Studio
------------------------------------------------------------------------

I've tried numerous internet suggestions, including accepting all Licenses with cmd sdkmanager --licenses
which accepted 100% all licenses, but still get this error.

My Config.winnt is attached (and I did try using 'JDK_PATH="C:\Program Files (x86)\Java\jdk1.8.0_172" but made no difference.

I'm totally out of ideas and would greatly appreciate any help.

Thanks
 

Attachments

  • config.winnt.txt
    3 KB · Views: 13

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
698
Did you try the suggestion of copying the licence files like described here?
 

JWB

New member
Joined
Oct 22, 2021
Messages
7
Yes ! Thank you very much 'Phil7'.

But now I have a new error as follows:-

-------------------------------------------

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

> Failed to install the following SDK components:

patcher;v4 SDK Patch Applier v4

platforms;android-30 Android SDK Platform 30

emulator Android Emulator

build-tools;30.0.3 Android SDK Build-Tools 30.0.3

platform-tools Android SDK Platform-Tools

tools Android SDK Tools

The SDK directory is not writable (C:\Program Files\Android\Android Studio)
------------------------------------------------------------------------------------------
This appears to be because the Android Studio directory is set to Read Only in Windows 10.
But when I uncheck the Read Only attribute (as per attachment), it just will not save and reverts back again to Read Only.
There are many proposed solutions on Google and I spent nearly all day trying them all.
But although I am Administrator, either they don't work, or what they are asking me to do, does not exist on my windows computer.
This is a common issue according to the internet - Windows 10 is so annoying sometimes.
 

Attachments

  • Read Only attribute not saved Windows 10.JPG
    Read Only attribute not saved Windows 10.JPG
    49.6 KB · Views: 11

dawlane

Well-known member
CX Code Contributor
Tutorial Author
Joined
Jun 21, 2017
Messages
937
The SDK directory is not writable (C:\Program Files\Android\Android Studio)
------------------------------------------------------------------------------------------
This appears to be because the Android Studio directory is set to Read Only in Windows 10.
But when I uncheck the Read Only attribute (as per attachment), it just will not save and reverts back again to Read Only.
There are many proposed solutions on Google and I spent nearly all day trying them all.
But although I am Administrator, either they don't work, or what they are asking me to do, does not exist on my windows computer.
This is a common issue according to the internet - Windows 10 is so annoying sometimes.
Something tells me that the actual Android SDK is installed in the same location as Android Studio files, or it would help if the ANDROID_PATH is pointing to the Android SDK location and not the Android Studio installation.

You should never ever store SDK's or files on the main hard drive where all folders with require elevated privileges.
The only way to gain access to any folder in those locations is to change the security settings and add your systems login user name with full access.

Usually during Android Studio's first run, you can change the location of where the Android SDK is to be installed. The default is normally in the users home directory located in %APPDATA%\Local\Android\Sdk. To change the location, use the Android SDK manager that you can access from the Android Studio Welcome dialog (more options), or through the Tools menu when a project is loaded into Android Studio. It is also from here that you should install any addition API and virtual devices.

Using Android Studio to do the setup for the Android SDK is a lot easier that having to do things manually, plus you can import the resulting Cerberus project into Android Studio for any fine tuning.
 

JWB

New member
Joined
Oct 22, 2021
Messages
7
Thanks 'dawlane' for good thinking outside the square.
But the Android SDK is indeed in 'C:\Users\badow\AppData\Local\Android\Sdk' (as installed by Android Studio itself).
I've checked and re-checked all the System Variables that this is indeed what is being referenced.

In 'config.winnt' I have ANDROID_PATH="C:\Program Files\Android\Android Studio"
As far as I can see, this is the only reference to this file.
But if I change it to 'ANDROID_PATH="C:\Users\bado\AppData\Local\Android\Sdk"
then the Build says 'Invalid Target'.


I'll have to give up, at least for now.
 

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
698
Did you open the Cerberus Project from within AndroidStudio? I remember getting good information on the issue and AndroidStudio also solved it for that project localy.

Does a (non Cerberus) AndroidStudio project, like one of the templates work as expected?
 

dawlane

Well-known member
CX Code Contributor
Tutorial Author
Joined
Jun 21, 2017
Messages
937
@Phil7
I had to do a clean install on a Windows machine, so I reinstalled Android Studio then Cerberus. So I'll be adding a new guide on how to do it.
Oh and there's a lovely bug in LoadState that stops compilation.
 

MikeHart

Administrator
3rd Party Module Dev
3rd Party Target Dev
3rd Party Tool Dev
Joined
Jun 19, 2017
Messages
3,349
Sorry about that bug. Will fix asap. Means remove that code.
 

JWB

New member
Joined
Oct 22, 2021
Messages
7
I resolved my building for Android error, whereby it wanted to write to the Android Studio directory which is Write-Protected.

1. In "config.winnt" I made this entry :- ANDROID_PATH="C:\Users\Android Studio"
and commented-out all the other ANDROID_PATH entries.

2. created empty directory "C:\Users\Android Studio".

3. copied everything UNDER the Android Studio installation directory (C:\Program Files\Android\Android Studio\bin\studio64.exe)
to "C:\Users\Android Studio" .

4. copied from my "C:\Users\me\AppData\Local\Android\Sdk", the following two directories to C:\Users\Android Studio :-
4.1 "build-tools" containing "30.03", which the android build process was asking for.
4.2 "platform-tools" containing "adb.exe" which the build process was asking for.

That's it - works perfectly!
==================================================================================================
 

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
698
Hey, I'm glad you got it working! :)
 
Top Bottom