I am facing the below error from Android studio project.
Error:Process 'command 'git'' finished with non-zero exit value 128
I was downloading source from VCS->Git, and cancelled it in the middle. Then I downloaded the same source locally and 'open existing android studio project' option. Once this project is opened in studio, I couldn't run it at all. It is still throwing error as below.
Error:fatal: Not a git repository (or any of the parent directories):
.git
FAILURE: Build failed with an exception.
Where: Script '/Users/.../functions.gradle' line: 19
What went wrong: A problem occurred evaluating project '..'.
Process 'command 'git'' finished with non-zero exit value 128
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I tried cleaning the project and run, observed the same error.
I again downloaded the same project from VCS->Git completely, still observing the same error either cases.
Could someone guide me how to solve this?
You can from the terminal, access the root of your projet then do:
git init
It will initialise your project as a git project, then try again and tell us what you have
Related
I have a problem with my Gradle and Android Studio. I reinstalled Android studio and Im working with libGDX then when I try to compile my project, the terminal says me that.
FAILURE: Build failed with an exception.
What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
Could not create service of type CrossBuildFileHashCache using BuildSessionScopeServices.createCrossBuildFileHashCache().
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED in 1s
Failed to create parent directory 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Android Studio.gradle' when creating directory 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Android Studio.gradle\4.0\fileHashes'
This error appear with this:
13:19:16: Executing task 'desktop:run'...
Download https://services.gradle.org/distributions/gradle-4.0-bin.zip (67.52M)
[ 97%] [ =====================================================> ] 66.07M
Download https://services.gradle.org/distributions/gradle-4.0-bin.zip succeeded, took 8s 734ms
Unzipping ...
My version of Gradle: 4.4
My version of Android Studio: 3.1.2
If you need more information said me to put that.
Thanks!
please try to run Android Studio as admin,
if no result try check and create the path manually
Bests )
I built an android project, and when I ran it, there was the following problem. even if I created a new project in any directory, the problem also appeared. so what's going on here?
BUILD FAILED in 0s
Executing tasks: [:app:assembleDebug]
FAILURE: Build failed with an exception.
What went wrong:
Task '–continue' not found in root project 'Demo2'.
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.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
This looks strange. The error seems to be the – character, which is not a double-dash -- but rather what happens sometimes when a text editor transforms a double in a long one.
--continue is not a task but a Gradle command line flag used to tell a build to continue executing even after a task fails.
Without more context regarding the creation and exact steps to launch the build, it is impossible to say more as to why this happens in your case.
Been trying to debug this issue for hours! Tried many solutions online, none seems to be working.
Build properties not found for package Android SDK Platform 25
File /root/.android/repositories.cfg could not be loaded.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
>
Failed to find target with hash string 'android-25' in: /home/hisham/Android/Sdk
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 39.749 secs
Error: /home/hisham/Desktop/Dev-PGDoc/ionic_app/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Failed to find target with hash string 'android-25' in: /home/hisham/Android/Sdk
How do I fix this?
Finally got it fixed! Not sure which one of the following fixed it though.
Change $ANDROID_HOME inside ~/.bashrc from ANDROID_HOME=$HOME/Android/Sdk to ANDROID_HOME=$HOME/Android/Sdk/platform-tools
Deleted version 25's folder inside platform-tools folder in the Sdk and installed version 25 again.
After doing the two above, restarted the system and I am now able to compile and build ionic app to .apk files.
PS : This might be just only in my personal computer, and you might be facing the same issue due to different issue. Hope this helps.
I created an Android platform with success, but when I run
ionic build android
I get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not create an instance of type org.gradle.invocation.DefaultGradle_Decorated.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
ERROR building one of the platforms: Error code 1 for command: /home/skylek/Ionic/conFusion/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/skylek/Ionic/conFusion/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
You may not have the required environment or OS to build this project
Error: Error code 1 for command: /home/skylek/Ionic/conFusion/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/skylek/Ionic/conFusion/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
Can anyone help me out.
I had exactly the same problem with an ionic project build with the m-ionic yeoman generator, that was uploaded to the ionic cloud.
It started after my computer crashed with a 'blue screen of death', in the middle of a compilation task
What We did to fix the project was to copy and replacing the gradle and corodova files :
.gradle
cordova
CordovaLib
gradle
gradlew.bat
from other ionic>platform>android project that I knew was working fine, beacuse we thought the Cordova files might be corrupted, and early in the project we fixed a similar compilation problem that way. It did not fixed the problem. But then removed the ionic cloud configuration files: ionic.project .
And it worked!!
I hope it could help you!
I am currently working on an app for my own personal use but have 1000001 problems with Android Studio - now R cannot be resolved - and cleaning gives the result below:
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
Error: Failed to run command:
C:\Users\William\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe s -i C:\Users\William\Dropbox\111 WORKSPACES 111\Android Studio\Legacy\Notifications Alarm\2015-03-24 AndroidStudioProject\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.3\res\drawable-xhdpi\abc_textfield_search_activated_mtrl_alpha.9.png -o C:\Users\William\Dropbox\111 WORKSPACES 111\Android Studio\Legacy\Notifications Alarm\2015-03-24 AndroidStudioProject\app\build\intermediates\res\debug\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png
Error Code:
42
Output:
C:\Users\William\Dropbox\111 WORKSPACES 111\Android Studio\Legacy\Notifications Alarm\2015-03-24 AndroidStudioProject\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.3\res\drawable-xhdpi\abc_textfield_search_activated_mtrl_alpha.9.png ERROR: Unable to open PNG file
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 17.777 secs
Above is the error message I keep on receiving when I clean my project. I can't find any XML errors, I have no foreign bodies in my resources except the launcher picture, and I can't find my R file anywhere - let alone reference it without error. The above error points to a
abc_textfield_search_activated_mtrl_alpha.9.png
That I have found and deleted - I don't think this is the right solution as the error persists. I have update Android Studio synched the Gradle and everything I have seen from my research. I really don't know how to handle this.
Thank you.