Android studio 1.5.1 cannot build - android-studio

Lately, I encounter a lot of problems using Android Studio.
I'm using Android Studio 1.5.1, with gradle plugin 1.5.0 (corresponding to Gradle 2.2.1, I think), on Windows 7.
There is no update for Android Studio for now, and neither in standalone SDK manager.
Sometimes when I try to launch my app on an emulator, the builing process wont stop (I waited for 1 hour once...). Even after I quit the emulator and just build project on sync gradle, it launch a process that never ends. The log file is not writing and there is no error message anywhere.
For the process to end, I have to go to the taskmanager and stop every java.exe process I see, and it then shows this message :
Error:Unable to start the daemon process. This problem might be caused
by incorrect configuration of the daemon. For example, an unrecognized
jvm option is used. Please refer to the user guide chapter on the
daemon at https://docs.gradle.org/2.8/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
After that, not any build will succeed, and the only way for my project to successfuly build is to reboot my OS ! (even after taskkilling every known related task, like android64.exe, adb.exe, java.exe)
Is the bug known ? Is there any workaround ? Am I doing something wrong ?
Further details
When it bugs, the gradle console is writing
Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugAndroidTestSources]`.
, but then nothing. It's more that gradle is not working than it's stroking on one point. But there still is that java.exe process with its 66Mb of memory...
It bugs after approximately 8 successful runs.
Last updates
I know now the real troublemaker ! It is C:\Users\Me\.gradle\daemon\2.8\registry.bin
I can't even right click on it without crashing Windows Explorer !

I have been facing the same problem. However, I had a previous project which had been successfully built. What I did was - changed the location of Service Directory Path(the one pointing to the '.gradle' folder) of my new app to the Service Directory Path of the successfully built app, i.e from
C:/Users/YOUR USERNAME/AndroidStudioProjects/CURRENT APP/.gradle
to
C:/Users/YOUR USERNAME/AndroidStudioProjects/SUCCESSFULLY BUILT APP/.gradle
To change the service directory path-
go to settings --> Build, Execution, Deployment --> Build Tools --> Gradle --> service directory path

Related

How do I run/build my app from Android Studio 4.1 64 bit Windows 10 laptop to Android 3.6 42 bit Windows 7 laptop

I've run into a problem. My previous laptop Acer Aspire R7 Windows 10 64 bit laptop crashed. This was the only laptop I had until I was given another one, but it's a Windows 7 32 bit Samsung. Anyway I was able to install an older version of Android Studio, but I've now run into problems. When I try to open my app that I created from the previous laptop it keeps telling me
"Gradle project sync failed". Basic functionality(e.g editing and debugging) will not work properly" and it says "Kotlin not configured".
There's nothing wrong with my code, so that's all I can say is the problem. I don't know what to do now, because this is app was how I made my income and now I can't work on it.
UPDATE
So I've made a bit more progress now, but i still have problems.
This is what my log shows when I try to clean or rebuild my project
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/6.1.1/userguide/gradle_daemon.html
Process command line: C:\Users\Rodney SA\Downloads\android-studio-ide-192.6241897-windows32\android-studio\jre\bin\java.exe -Xmx2048m -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\Rodney SA\.gradle\wrapper\dists\gradle-6.1.1-all\cfmwm155h49vnt3hynmlrsdst\gradle-6.1.1\lib\gradle-launcher-6.1.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.1.1
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
-----------------------
Check the JVM arguments defined for the gradle process in:
- gradle.properties in project root directory
“Gradle sync failed” is a very common error in Android studio.
It happens generally when your project is lacking some files which need to be downloaded.
First go to File>Setting>search Gradle keyword and uncheck offline work
Make sure you have enough high speed data
Goto Tools>Android>Sync Projects Gradle Files
It will automatically download the necessary file.
Android studio is a very data consuming IDE you will have to face frequent updates.

Android Studio 3.4 waiting for application to come online

Since upgrading to AS 3.4 I can no longer debug any of my apps. I have made no changes to any of the projects, I just upgraded AS. Now all I get is "Waiting for application to come online".
When I click on Run->Attach Debugger To Android Process, there are no processes to attach.
The apps load and run, but I cannot debug them.
Is there anything I can do to get the debugger working?
(I have tried clean, rebuild, invalidate cache and restart, make project and gradlew clean).
I found the same trobles in Android Studio Dolphin (2021.3.1) when created a new project with no activity. After the project creation I created a main activity and add a launcher intent-filter and tried to debug it. And found "Waiting for application to come online". I found that "Launch" argument in "Lunch Option" for my "Run Configuration" is "Nothing". Problem solved by changing it to "Default Activity"
To change run configuration option select Run->Edit Configurations, or "Modify Run Configuration" in Run or Debug panel.
I had the same problem, I tried: Update Android studio to 3.5, restart cache, delete cache folders, killing adb server and restart it... but nothing works.
I solved executing the next commands on ADB terminal:
On windows, you have to change to platform-tools folder path in order to excecute ADB commands, something like this:
cd C:\Users\YourUser\AppData\Local\Android\Sdk\platform-tools
Then, compile your app on debug mode. (I think shift + F9 on Windows), when you started to see "Waiting for application to come online" message, execute the next adb command:
adb shell am start -n com.example.yourPackage/com.example.yourPackage.MainActivity -D
Just change com.example.yourPackage and make sure MainActivity its your Luncher Activity inside your Manifest File.

Unable to load class 'groovy.lang.GroovyObject'

since I upgraded to android studio 3.0.1 I can not continue with my application. Gradle throws the following error: Gradle Sync Issues
Error: Unable to load class 'groovy.lang.GroovyObject'. Possible causes for this unexpected error include: Gradle's
dependency cache may be corrupt (this happens after a network
connection timeout.) Re-download dependencies
and sync project (requires network) The state of a
Gradle build process (daemon) may be corrupt. Stopping all Gradle
daemons may solve this problem. Stop
Gradle build processes (requires restart) Your
project may be using a third-party plugin which is not compatible with
the other plugins in the project or the Grade requested by the
project. In the case of corrupt Gradle processes, you
can also try to close the IDE and then killing all Java processes.
Any suggestions? Thank you very much.
If you made an update to Android 3.0+ do not forget to perform the cache invalidation in Android Studio and restart.
File > Invalidate Cache / Restart
You can try doing the compilation by command line, through the terminal that has integrated Android Studio:
./gradlew clean assemble
I have changed the following line in project's grandle.wrapper.properties file:
From:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
to
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
After that i could successfully build my project again.
Not sure why it was not working with version 4.1 since both versions exists in %HOMEPATH%\.gradle\wrapper\dists folder.

Visual Studio Doesn't Create Xamarin Bin Folder

I'm trying to build an iPad project from Visual Studio 2017 for windows, However whenever I try to debug the app I get this error
Launch failed. The app 'B2C.iPad' could not be launched on 'iPad Air
iOS 11.0'. Error: error MT0069: The app directory
'/Users/user/Library/Caches/Xamarin/mtbs/builds/B2C.iPad/acb039527d504c900b2e6c86d8d84d09/bin/iPhoneSimulator/Debug/MobiBusiness.app'
does not exist. . Please check the logs for more details.
I noticed that visual studio doesn't create bin folder on the Mac machine although it indicates the build is succeeded.
I tried building the solution without debugging and looked at the log file nothing looked suspicious and there was no error.
does anyone know what might cause this error?
Okay this is embarrassing apparently the iPad project wasn't not selected in the build configuration, so needed to select the projects from build --> Configuration Manager

Android Studio can not run or debug app on emulator

I have a very odd situation here:
I just want to run and debug my app on the emulator.
I get
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.myapp"
pkg: /data/local/tmp/com.example.myapp
Success
The app is correctly installed on the emulator, but does not start up.
I can run and debug this app on USB-Device.
I can run and debug any other app on same emulator.
I tried different AVDs (arm and intel), SDK and Target
Build finishes with 0 errors and 0 warnings. Eventlog is empty. I cleaned the gradle file and changed the only dependency com.android.support:appcompat-v7:21.+.
I can start the app normally on the AVD by clicking on it's icon.
When I start debugging, app installs, then waits endlessly on:
Waiting for process: com.example.myapp
I do not even now where to start looking (of course I tried rebuilding, synchronizing and cleaning cache). I also tried changing the project name.
Maybe try making a new project and copying your code over?

Resources