I'm working at a corporate location where we have restricted access to network. The hurdle that I'm facing is that I'm supposed to do some research on Android development and the network is not what I wanted it to be. I have installed Android Studio and created a new project. But as soon as the project is loaded, gradle sync operation starts and fails after not finding JUnit & similar dependencies.
I have already added the proxy settings in Android Studio and SDK manager, but I believe I'll have to request for unblocking some of the URLs that Android Studio needs access to. I couldn't find any such list, can someone please help me with the same?
I have tried running Fiddler to see which requests are being blocked, but I see only 1 URL and that is clients1.google.com but I'm not sure that is the only thing needed.
After lots of hits and misses, I have found the answer to this question. The build.gradle file for the project has the answer to this. It calls a function jcenter() which internally calls the libraries available at http://jcenter.bintray.com/. So, the entire list for Android Studio development including the SDK would be:
http://dl.google.com:443
http://dl-ssl.google.com:443
https://dl-ssl.google.com/android/repository/*
https://developer.android.com (for Android Studio downloads and documentations)
http://jcenter.bintray.com/
Thanks for all the help provided.
Related
My notebook died and I lost all my data and my Android Studio projects. Only what I have left is apps in my phone. Is it somehow possible to restore it in Android Studio from my phone app? Thank you.
Option 1: somehow get the original files back. You could try to:
See if the drive still works by putting it into another system
Search for some kind of backup (backup utility/cloud storage/github)
Get some professional to rescue your data (if everything fails)
Option 2: decompiling
I just tried decompiling one of my apps here and it kind of worked. You may have to remember your project structure somehow, but in the end, I think it's doable for smaller app projects.
Disclaimer: never decompile other people's software without their permission.
I have tried many solutions to run Android Studio 2.3.3 on macOS 10.12 but this error still keeps showing and won't let me start a new project.
In the Event Log it says Gradle sync failed: Host is down. When I remove the gradle directories and invalidate caches it still has no effect.
Can anybody please suggest a way around this? All of the solutions I have seen posted in the forum haven't been successful so far.
Check your firewall settings to make sure it is not blocked. I have the same issue because I have blocked this with my firewall:
In my experience Android Studio requires an internet connection and unfettered access to the internet in order for you to develop anything. Hopefully this will improve with future versions.
There may be other ways to run the application without relying on Android Studio or gradle build process. One potential way might be to use the Unity platform. Otherwise you might try a google search for "build and run android app without gradle".
After developing in Eclipse for several years I have switched to Android Studio since two days. Although I have read as much as possible about it I still have one big problem: I can not find the place to add, change, configure or whatever about the so called artifacts.
I have tried several ways from creating a new project from scratch to importing a complete Eclipse projects.
Although the IntelliJ documentation is clear about it, I can not find it.
The project structure in all cases only shows three parts in the structure:
SDK location, Project and app. I have searched them all but no artifacts.
Who can help me?
The artifact description is in the IntelliJ IDEA manual that is reached by selecting menu item 'Help, Help Topics' in Android Studio.
However, according to JetBrains Support the Android Studio documentation topics need to be updated and the Artifacts page should not be available in Android Studio.
See also: https://intellij-support.jetbrains.com/requests/58563
I am using Android studio version 0.4.2 and gradle version 1.9. I have successfully installed Studio and have created multiple projects. Today when I launched Studio without internet connection,
I got this error message:
"Gradle project sync failed. Basic functionality (e.g. editing,
debugging) will not work properly" and the Event Log window shows
"Failed to refresh Gradle project < Project Name >. Connection timed
out: connect. If you are behind an HTTP proxy, please configure the
proxy settings either in IDE or Gradle."
I need to know if internet connection is mandatory for building projects using gradle.
I think gradle checks for latest version on internet and throws Connection time out error. If so, is there any workaround to disable that.
Currently Android Studio's Gradle implementation requires a fast stable network connection. For whatever reason, the developers have decided to force this requirement on users at this time. There is a setting that you should be able to use to utilize a local gradle installation, but it doesn't hold. The developers know about both the network requirement and the broken switch, but are currently prioritizing other functionality. They may remove that requirement in the 1.0 or post 1.0 time frame.
[see: https://plus.google.com/u/0/115692564989237473252/posts/LGSbniYqj3Q ]
Gradle's offline mode, isn't. It should be properly named cached mode. All that switch does is tell gradle to not try to go online and instead utilize cached copies of the various networked resources. Unfortunately that assumes that you have had (and will have again) a network connection, preferably a fast stable one. Using Android Studio (last version tested 0.5.9) with a slow/unstable network results in watching Android Studio process Gradle ( and Maven ) processes usually for 2-5 minutes, sometimes for 10 minutes or more. Also at seemingly random times when coding the IDE will lock up and the cause usually involves one or more Gradle processes that have spun up.
As a comparison, using IntelliJ IDEA 13.1 Community edition (the IDE that Android Studio is based on) I compared a default "Hello Android" IDE generated program using the Android Gradle wizard (substantially similar to the only one in Android Studio) and the Ant based Android wizard. The results were as expected. The gradle based project experienced the same painful lock up and lag that projects in Android Studio exhibited. The ant based Android project was near instantaneous. No appreciable delay once the project was created and opened. Coding caused no random lockups. Testing was done on a Windows 8.1 update1 Pro machine with a dual Athlon x2 processor, 6GB RAM, and a 6Mb/0.75Mb DSL connection. I believe that last part is most likely the issue.
Unfortunately until Android Studio removes the network requirement I feel it will be unusable to a large number of developers. That's a shame because otherwise it looks to be a marked improvement over the existing Eclipse based development environment.
For me, I had to check and then uncheck the box in
Preferences->Gradle->Offline work.
Then I got back online.
You can download the gradle distribution locally and build the project again.
To do this, edit your gradle-wrapper.properties under gradle-> wrapper in your Android project.
Edit the
distributionUrl=https://services.gradle.org/distributions/gradle-2.2.1-all.zip
to
distributionUrl=file:///home/foo/downloads/gradle-2.2.1-all.zip
So just download the file from here as mentioned in your gradle-wrapper.properties.
There's an offline mode preference in Preferences > Compiler > Gradle. If you already have your dependencies downloaded, this will generally work for you.
In Android studio version 1.5.1 I could solve this error by following steps :
1) Go to file -> Settings -> HTTP Proxy -> & select Auto detect proxy settings.
2) After that you may get Dialog to accept or reject certificate
3) Select Accept.
That's it.
I am using Visual Studio 2012 and Xamarin.Android Beta release to develop an Android application. When I try to deploy the android application for debugging purposes onto an Android device, it deploys the previously built application on the device and not the recent changes I made and deployed (i.e No refresh of build). However, if I use Xamarin Studio to do the same, it deploys the correct build everytime (i.e refreshes the build with new code changes).
Any idea why this is happening?
Thanks in advance!
I had a similar issue: With Visual Studio 2019 the debug version of my driver was deployed while building the release version.
The cause of my problem was, that in the Properties -> Driver Install -> Package Files I had an absolute path pointing to the debug version of my driver in the column File. This setting is valid for all configurations (not separated for debug/release), and when entering macros, they are immediately expanded to absolute paths.
I fixed this by editing the .vcxproj file with my favourite editor and changed the path back to $(TargetPath).
I had the same problem. My solution was to add "deploy" to the build configuration:
BUILD => Configuration Manager... => (select "Debug" from left-hand combo-box) => (tick "Deploy" in grid)
Courtesy of this xamarin forum post.
I have no idea why it does this, I had this issue before. I also noticed that the device log was somewhat behind (ie, at 3.30pm, the last record on the device log was 11.00am).
Uninstalling the app from the device and re-deploying it seems to correct it.
Note: I had this issue in VS, didn't check with XS.
I would look at the difference in your deployment settings in VS and XS (I think it may have something to do with the Fast Deployment option).
Similar question (though for iOS Simulator) here.
I had a similar problem (though on an Android emulator).
What didn't work for me:
restarting the computer
restarting Visual Studio
deleting bin / obj folders
going into Configuration Manager (Debug / Release / Configuration Manager) and ticking everything there - everything was ticked
changing the version of the app in the manifest
What worked for me?
Uninstalling the app from the emulator and then running Debug again.
It was an Android emulator, so I uninstalled by clicking on the app icon and holidng for long, and then dragging it to "Uninstall App". On an iOS simulator it should be similar.