I updated Android Studio and now gradle project sync fails - android-studio

I updated Android Studio and now I get these errors:
1. Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly.
2. Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Request blocked by Privoxy"

I add this line "systemProp.http.nonProxyHosts=*|localhost" in gradle.properties. Works !!!

Just 1.close your IDE(Android Studio) 2.delete .gradle folder in C:/Users/Your User.gradle in Windows and 3.open your IDE and enjoy
Updated: 2020/04/21
this problem could be fixed by delete gradle.properties file in C:/Users/Your User/.gradle folder

following option solved "Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Request blocked by Privoxy" issue
In Android Studio: From the menu bar, click File > Settings (on macOS, click Android Studio > Preferences). In the left pane, click Appearance & Behavior > System Settings > HTTP Proxy. Select No proxy radio button.
deleted gradle.properties file in C:/Users/Your User/.gradle folder

In my case I was using two proxies at a time (even though I disabled first)
If you have a $HOME/.gradle/gradle.properties files, make sure your proxy matched the content of this file.
then:
Prefer a proxy [that bypasses the link giving 403]
Or a strong protocol of VPN (Kerio, ...)
(Discovered it by running with --debug option

Related

IIS always search file in the wrong directory

On my PC (Windows 10) I wrote a new website (VB windows forms, .aspx files).
If I run the site from inside Visual Studio 2019, all OK, it starts and run correctly.
Now I need to have this site always "ON", I installed IIS, configured a "new website", name, directory and so on. I configured the new website in IIS to the directory where I develop, not in wwwroot.
Nothing works: I always have a 404 error.
To simplyfy everything I wrote a simple .HTML file, "prova.html", I placed it in the real website directory, and I tested it with Firefox: http://127.0.0.1/test.html.
Still 404:
URL requested http://127.0.0.1:80/prova.html
Physical path C:\inetpub\wwwroot\prova.html
It seems that IIS ALWAYS searches the file in the wrong path, but I configured the correct directory where the file is.
Of course if I place my test file in "inetpub\wwwroot ..." IIS finds and opens the file.
Any suggestion?
You can refer to the following steps to deploy the project in IIS:
Right click on your project and select publish:
Then add the site in IIS:
Solved ... installing IIS I didn't install the .NET part ... I feel very stupid.

How to run sdkmanager behind a proxy?

At my workplace, we have a corporate proxy that signs every incoming connections and we need to authenticate to be able to connect to Internet. I've configured the proxy in way too many places, and I got most software to use it. Now, the only program left (for now) that disrespect my config is sdkmanager. So, how do I make sdkmanager respect my proxy/authentication/certificate config?
sdkmanager
Warning: File /home/users/n.gendron/.android/repositories.cfg could not be loaded.
Warning: java.net.ConnectException: Connection timed out (Connection timed out)
Warning: Failed to download any source lists!
[=======================================] 100% Computing updates...
Android Studio / Appearance & Behaviour / System Settings / HTTP Proxy is correctly configured, and Check connection says Connection successful.
Android Studio / Appearance & Behaviour / System Settings / Android SDK does fetch updates without errors. I can even install new Android SDK Platforms.
Android Studio / Tools / Server Certificates has the correct certificate imported
http_proxy, https_proxy and no_proxy are correctly configured in my .profile.
Certificate is added to multiple keystores with sudo /usr/lib/jvm/default-java/bin/keytool -importcert -file /etc/ssl/certs/guardianCA.pem -keystore /usr/lib/jvm/default-java/jre/lib/security/cacerts.
~/.android/androidtool.cfg has yet another copypasta of my settings
I guess it's too late for a reply, I was going through the same problem. So answering now so that others can get help from it.
Basically SDK manager proxy hasn't been set so using command line proxy tunneling is helpful in this case.
This post has been helpful for me installing android command line tools using sdkmanager on windows.
If all the path variables are set properly
"%ANDROID_HOME%\tools\bin\sdkmanager" "emulator" "platform-tools" "platforms;android-28" "build-tools;28.0.3" "extras;android;m2repository" "extras;google;m2repository" --no_https --proxy=http --proxy_host=10.60.11.11 --proxy_port=8080
or
you can navigate to the directory where sdkmanager.bat file is set it in the path variable, or run this command directly from that location
sdkmanager "emulator" "platform-tools" "platforms;android-28" "build-tools;28.0.3" "extras;android;m2repository" "extras;google;m2repository" --no_https --proxy=http --proxy_host=10.60.11.11 --proxy_port=8080

Can't build Android app using crashlytics behind VPN and proxy

As a teleworker I use a VPN with a proxy.pac (config file is available at http://proxy.mycompany.com/proxy.pac).
To update packages Android SDK Manager, the following proxy settings work properly:
HTTP Proxy Server: proxy.mycompany.com
HTTP Proxy Port: 80
In Android Studio I work on an Android-Gradle project using crashlytics. I have set the same parameters in Proxy HTTP.
A gradle assembleDebug command fails when checking crashlytics apikey:
:myproject-project:compileDebugNdk UP-TO-DATE
:myproject-project:preBuild
:myproject-project:preDebugBuild
:myproject-project:checkDebugManifest
:myproject-project:prepareDebugDependencies
:myproject-project:compileDebugAidl UP-TO-DATE
:myproject-project:compileDebugRenderscript UP-TO-DATE
:myproject-project:generateDebugBuildConfig UP-TO-DATE
:myproject-project:processDebugManifest UP-TO-DATE
> Building 32% > :myproject-project:crashlyticsCleanupResourcesDebug
then after timeout:
ERROR - Crashlytics Developer Tools error.
com.crashlytics.reloc.org.apache.http.conn.HttpHostConnectException: Connect to api.crashlytics.com:443 [api.crashlytics.com/54.225.193.37, api.crashlytics.com/54.243.69.50, api.crashlytics.com/54.243.106.90, api.crashlytics.com/54.243.136.142, api.crashlytics.com/54.243.186.185, api.crashlytics.com/107.21.114.251, api.crashlytics.com/184.72.240.69, api.crashlytics.com/54.225.68.102] failed: Connection timed out: connect
at com.crashlytics.reloc.org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:138)
...
I have tried to set gradle properties in ~/.gradle/gradle.properties file:
systemProp.http.proxyHost=proxy.mycompany.com
systemProp.http.proxyPort=80
... but it not seems to be a great idea as I have a warning in HTTP Proxy settings (those settings are obsolete).
I have ask people from network to snif what happens, and there are access failure on URLs like http://dl-ssl.google.com (same that are used in Android SDK manager), or EC2 on Amazon (possibly used by crashlytics, isn't it?).
Of course all this runs perfectly when I'm directly connected in my company's LAN.
Any idea of what could happen? Any workaround?
Thanks for support. Jean
EDIT:
Solution is to set https proxy server and port in ~/.gradle/gradle.properties file. In my case, http parameters seems useless.
systemProp.https.proxyHost=proxy.mycompany.com
systemProp.https.proxyPort=80
Thanks for you help!
Hemal from Crashlytics here. Can you set https.proxyHost and https.proxyPort? In addition, if you have one, go ahead and set https.proxyUser and https.proxyPassword as well! This should take care of it for ya :)

Tomcat Intellij Idea: Remote deploy

RackSpace Cloud Server Ubuntu-12.04, Intellij Idea-11.1.2, Windows-8, Tomcat-7.0.26, JDK-6.
On Intellij Idea when i try to run jsf project on my remote Tomcat 7 server it says:
Error running servername: Unable to connect to the ip-address:1099
It seems problem is about JNDI port which is 1099 but I couldn't activate it I guess. Tomcat config is sth. like that:
What I've tried?
Setting CATALINA_OPTS or JAVA_OPTS on the server side with:
CATALINA_OPTS=-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
and
JAVA_OPTS=-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
But this one did not work, any ideas?
My answer to my question:
The correct way to deploy remotely is editing JAVA_OPTS environment variable on the remote server. Just enter the command below:
export JAVA_OPTS="-Dcom.sun.management.jmxremote=
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"
If that's not going to work and if you don't have any obsession to deploy your website via Intellij Idea, I've got the solution for this problem. To be able to run your website under Tomcat, you can/should get artifact in form of .war file.
It can be done in Intellij from project settings(ctrl+alt+shift+s) then hit the plus button and add new artifact(web:application archieve)
After rebuilding the artifact, .war file can be seen in project-folder\out\artifacts. Next, you should place this file into your tomcat/webapps folder.
For example if you are using Tomcat-7, the folder that I mean exists in /var/lib/tomcat7/webapps. Before copying your .war file you should rename it as ROOT.war. This provides to access your site directly by http://youripaddress:8080. After restarting Tomcat7 service you can access the site.
But not finished yet, you can debug your project remotely like you are debugging your project at your local machine with Intellij Idea. Open Run/Debug Configuration in Idea, hit the plus button and there must be Remote. This is the way to debug your projects for application servers like JBoss, Glassfish as well in Idea. Enter your host and port numbers, select your project as a module.
Before starting to debug, as Intellij says you should give the following parameter to your server JVM:
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
To be able to do that in Ubuntu and for Tomcat-7, modified the catalina.sh file in usr/share/tomcat7 folder. I inserted the parameter above of the if [ -z "$LOGGING_MANAGER" ]; then line. It must be on the middle part of the file. Then you should be able to debug your project with Intellij Idea.

Netbeans and Xdebug in Linux

I have installed Xdebug, and I can confirm from phpinfo() that it is correctly installed. I have taken all the steps given in all of the sites that come up with I google "netbeans xdebug install, etc".
It still does not work in Netbeans.
Is there any advice that someone can offer?
Here is my php.ini debug section...
[xdebug]
zend_extension = /usr/lib/php5/20090626/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_mode = "req"
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9000
xdebug.idekey = "netbeans-xdebug"
Any help would be greatly appreciated!
Since the information available to me is very sparse, I have to describe the settings in more detail.
Netbeans and xdebug settings.
Ubuntu 12.04 LTS Precise Pangolin
What ought to be installed.
Global settings:
Tools -- Options
PHP settings:
With phpinfo() you get.. see below image.
Only one php.ini is important ! Look at Loaded Configuration File
If you wrote a xdebug entry into another "php.ini" file be sure to clear all these entries again. ( xdebug ONLY in one php.ini ). Look also at Additional .ini files parsed. We come to this later.
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
Additional .ini files parsed.
Add or controlling, only the first line must be the same as in the "php.ini".( Without " " )
Make sure that the file is really there!
Make sure that the session.save_path is really there!
Control the xdebug version that should be equal to or greater.( Matching PHP Version-5.3.10-1 ). If everything was done as described in this answer, and it does not work, then it is with great probability of an incorrect or defective "xdebug.so".
Create a new Php Project:
Project Properties:
Sources
In our test program, it is important the Project Folder and Source Folder are exactly alike!
Run Configuration
Start Debug: -- press Debug button
The default Browser opens and remains at Connecting .. stand while Netbeans in debug mode is.
(If Netbeans do not open a Browser or can not connect, go back to Advanced Web Configuration and select Do Not Open Web Browser. Close an reopen the browser and type the URL as seen below)
Go through your code. You will see only something in the browser when you're done with the debugging. Don't forget to press the Stop Button . If you forget this xdebug is running on.
Done:
Try using xdebug.remote_connect_back=1 instead of xdebug.remote_host to avoid security issues
In fact,
zend_extension=path/to/xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=1
Must be enough.
Make sure that project properties->run configuration->advanced->do not open web browser option is NOT selected (in netbeans project config).
Also, check project url value in run configuration
The issue wasn't with the configuration of xdebug itself, but how I had NetBeans configured. It was a simple error... basically I was having NetBeans navigate to my /var/www/Application directory, which I hadn't actually set up yet.
Thanks to everyone for their help. I learned a lot about how xdebug works!
Make sure the remote port is set to 9000 in the xdebug.ini file, mine was set to 8000 and once I changed it, xdebug worked immediately.

Resources