-
-
Notifications
You must be signed in to change notification settings - Fork 136
Android Build Error #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@vchittar we released NativeScript 2.2 today, so I strongly suggest you do a Additionally I'd suggest that you update your android SDK if you haven't done that already. And finally if neither of the above helps - you could manually invoke the gradle build with an additional flag to get a more detailed output of the error. cd platforms/android
./gradlew buildapk --stacktrace |
This comment was marked as abuse.
This comment was marked as abuse.
Yeah I tried all of that and didn't work. This is the stacktrace output.
|
This comment was marked as abuse.
This comment was marked as abuse.
Yeah i installed the build version earlier but it still gives me the same error. |
This comment was marked as abuse.
This comment was marked as abuse.
/usr/local/Cellar/android-sdk/24.4.1_1/ This is my android home directory currently. I installed this version when I first installed NS. |
Hi @vchittar
You can also just paste them in a terminal and try building again, running the command in the same terminal. |
@Plamen5kov hey, that didnt work. It still keeps saying process failed for some reason even when I put in all these in the .profile file. |
@vchittar can you post the fail message you're getting? |
|
This is my error:
|
@vchittar can you run the command:
and post the result back here. Also could you post the results of the commands:
|
@Plamen5kov do you think mine is related? |
Hi @vekexasia,
So we can figure out what's wrong. Please give a ling to paste bin. @vekexasia what cli version are you using? You might need to update your build and platform tools from the android sdk manager. |
http://pastebin.com/edkZDR4x (This is the gradlew --debug command) http://pastebin.com/ZQzqvciR (first ls -la command) http://pastebin.com/eQv4MpU2 (second ls -la command) |
Hi @vchittar,
And make sure you have the correct access rights, when you try and execute a command. EDIT:
It complains about |
Hey thanks for all the help, but I checked my .profile and corrected it a little bit and I still cant run tns run android for some reason. The error I get is : "Cannot read property 'toString' of undefined" Thank you for being so patient with me and helping me solve my problems. EDIT: I edited ~/.profile and ~/bash_profile so it would point to the correct Android Home directory and it still doesnt work. |
@vchittar please link the whole error log. |
Thats the whole error even with the debug flag. |
Could you run |
Sorry I forgot about the log trace command. EDIT: I put the export commands in my terminal and that doesnt seem to work and I get the type undefined error, so do i need to put the export commands in my .bash_profile or .profile or .bashrc? |
It all leads to your sdk not being installed/set up properly
If those paths are set up properly, the following commands should run: |
which adb results in /usr/local/bin/adb which android results in /usr/local/bin/android and both adb --help and android --help work. |
@vchittar that's not normal installation of the android-sdk. I would suggest removing it and installing it manually. And setting up the path variables after the manual installation.
|
Well no, that depends on how you installed it in the first place. If you installed it using the package manager you should use the package manager to remove it. Otherwise there might be files left behind like:
|
echo $ANDROID_HOME gives me "~/tools/android-sdk-linux" but which android doesnt, do you know why? EDIT: I fixed that, and now it says "adb from the Android SDK is not installed or is not configured properly" |
Please follow these steps here. EDIT: I'm closing this issue because it's related to setting up the environment, rather than a problem with the runtime itself. |
I am getting same error as @vchittar with Error: Cannot read property 'targetNum' of undefined I have run both adb --help and android --help work. Environment vars:
This isn't exactly what @Plamen5kov mentioned, but seems this should not be a problem if everything is being found correctly. It is where the script installed everything.
The location of installation is where the script at link @Plamen5kov provided installed android-sdk. I did notice in my installation that:
My samples directory is empty. I have not been able to figure out how to populate with samples using the android-sdk tool. Reading online documentation showed there was a way to do that in the past, |
This issue was moved to NativeScript/nativescript-cli#2034 |
For those with Error: Cannot read property 'targetNum' of undefined I recommend to take a look at http://stackoverflow.com/questions/39361369/cannot-read-property-targetnum-of-undefined/39364308#39364308. This solved my problem. |
Whenever I try to build or run an android project I usually run into this problem.
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':processF0F1F2F3F4F5DebugResources'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/local/Cellar/android-sdk/24.4.1_1/build-tools/23.0.2/aapt'' finished with non-zero exit value 1
Does anyone know why this problem occurs? I have been trying for a very long time to fix this and I cannot figure out how to do so.
Thanks!
The text was updated successfully, but these errors were encountered: