How to update AndroidSDK tools using Nexus Repository Manager - android

I'm trying to update build-tools for AndroidSDK. My machine locate in private network and we using Nexus Repository Manager. I have proxy repository to https://dl-ssl.google.com/android/repository and I can manually download for example https://nexus-ci.company/repository/proxy-group/addons_list-3.xml.
Also I know about SDK_TEST_BASE_URL environment variable, so I can override repository for resources.
My variable:
export SDK_TEST_BASE_URL=https://ci_dos_user:*******#nexus-ci.company/repository/proxy-group/
So yes, only way I can connect - with credentials.
But when I put path to my proxy repository I have error log:
Warning: IO exception while downloading manifest
java.io.IOException: Server returned HTTP response code: 401 for URL: https://ci_dos_user:*******#nexus-ci.company/repository/proxy-group/repository2-1.xml
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1932)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1528)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openUrl(DownloadCache.java:248)
at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.downloadAndCache(DownloadCache.java:624)
at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openCachedUrl(DownloadCache.java:547)
at com.android.sdklib.repository.legacy.LegacyDownloader.downloadAndStream(LegacyDownloader.java:61)
at com.android.repository.impl.manager.RemoteRepoLoaderImpl.lambda$fetchPackages$0(RemoteRepoLoaderImpl.java:139)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
How can I update my build-tools using nexus?
P.S.
I also know about --proxy flags to sdkmanager. But I have not access to proxy on my machine.

Related

Not able to git push or pull in android studio 3.6

I'm getting the following error while trying to push or pull or anything with ssh in android studio 3.6
Update failed Invocation failed Unexpected Response from Server: Unauthorized java.lang.RuntimeException: Invocation failed Unexpected Response from Server: Unauthorized at org.jetbrains.git4idea.nativessh.GitNativeSshAskPassXmlRpcClient.handleInput(GitNativeSshAskPassXmlRpcClient.java:34) at org.jetbrains.git4idea.nativessh.GitNativeSshAskPassApp.main(GitNativeSshAskPassApp.java:30) Caused by: java.io.IOException: Unexpected Response from Server: Unauthorized at org.apache.xmlrpc.LiteXmlRpcTransport.sendRequest(LiteXmlRpcTransport.java:231) at org.apache.xmlrpc.LiteXmlRpcTransport.sendXmlRpc(LiteXmlRpcTransport.java:90) at org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:72) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:194) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:185) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:178) at org.jetbrains.git4idea.nativessh.GitNativeSshAskPassXmlRpcClient.handleInput(GitNat..................
looks like the problem is with native ssh and we cannot change it to built-in like previous versions... how to fix this ???
any help would be appreciated
WORKAROUND:
1. In Android Studio go to Help - Find Action - Registry...
2. Find git.use.builtin.ssh and enable it
3. Check that git works again
Not straight solution - but you can change your git url from ssh to https, and it will work.
git remote set-url origin YOUR_REPOSITORY_HTTPS_URL
I have found an alternative way to make SSH actually work...
rate up if it worked for you!!!
using putty plink for ssh instead of the Git ssh(openSSH)
1.set the system env-variable GIT_SSH and let it point to plink.exe
download links available here: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
2.start pageant and add your private key to it (needs to be converted to another format to be used)(use puttygen to convert id_rsa to ppk)
3.use command in terminal based on github or gitlab : plink -v git#github.com or plink -v git#gitlab.com
congrats now you can work with ssh

How do I configure Androids sdkmanager command line tool to use custom repository?

Is it possible to configure Google's Android sdkmanager to download dependencies through a custom repository instead of dl.google.com/android/repository?
Background:
I'm setting up an Android build agent behind a corporate firewall with no direct Internet access. I can access a repository server on LAN that acts as a mirror to pre-configured remote repositories.
I've downloaded SDK Tools from here https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
On a machine with Internet access I've tried to configure ~/.android/repositories.cfg like this:
### User Sources for Android Repository
#Fri Nov 30 12:36:38 CET 2018
enabled00=true
count=1
disp00=DB Artifactory
src00=https://dl.google.com/android/repository/repository2-1.xml
Which is the configuration I get if I set up a custom SDK Update Site in Android Studio.
The xml file downloaded here is exactly the same as configured by Android Studio - and its also the same I observe with Charles Proxy when running the sdkmanager command line tool.
It works just fine for the default "Android Repository" configuration in Android Studio, but my custom configuration fails both in Android Studio and from the command line.
I see this error:
Step 25/34 : RUN yes | sdkmanager --licenses --proxy=http --
proxy_host=host.docker.internal --proxy_port=3128
---> Running in 8d8923c76ba7
Picked up _JAVA_OPTIONS: -XX:+UnlockExperimentalVMOptions -
XX:+UseCGroupMemoryLimitForHeap
Warning: Errors during XML parse: ] 42% Downloading sys-img.xml... Parse X
Warning: cvc-elt.1: Cannot find the declaration of element 'sdk:sdk-repository'.
,,Warning: org.xml.sax.SAXParseException; lineNumber: 17; columnNumber: 139; cvc-elt.1: Cannot find the declaration of element 'sdk:sdk-repository'.
Warning: javax.xml.bind.UnmarshalException - with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 17; columnNumber: 139; cvc-elt.1: Cannot find the declaration of element 'sdk:sdk-repository'.]
Warning: Additionally, the fallback loader failed to parse the XML.
Any help would be much appreciated...
Looking at the sdkmanager's source code - there seems to be an alternative method of overriding the repository - via SDK_TEST_BASE_URL environment variable:
For testing, the env var can be set to replace the default root
download URL.
It must end with a / and its the location where the
updater will look for the repository.xml, addons_list.xml and such
files.
Thus, you could do something like this:
SDK_TEST_BASE_URL=https://your.company/artifactory/android/ sdkmanager "platform-tools"
The example above will attempt to install platform-tools package using the provided repository URL.
Just make sure the URL ends with a /

Opening MobileFirst Console throws errors (Eclipse)

I'am using Eclipse JUNO 4.2.2 for JAVA EE Developers with IBM Mobile First 6.3 Developer Edition.
I am also using Java 1.7 and the ADT plug-in in Eclipse.
My problem is when i try to visualize my App in the MobileFirt Console i have an error that says
Server error. Contact the server administrator.
And i have the following logs in my eclipse console:
[ERROR ] C:\Users\Aokiji\IBM%20Workspace\MobileFirstServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\73\data\cache\com.ibm.ws.app.manager_108\.cache\WEB-INF\lib\ibm_web20_wink_no_abdera_no_jackson-1.1.0.0-20110422.jar (The system cannot find the path specified)
C:\Users\Aokiji\IBM%20Workspace\MobileFirstServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\73\data\cache\com.ibm.ws.app.manager_108\.cache\WEB-INF\lib\ibm_web20_wink_no_abdera_no_jackson-1.1.0.0-20110422.jar (The system cannot find the path specified)
[ERROR ] C:\Users\Aokiji\IBM%20Workspace\MobileFirstServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\73\data\cache\com.ibm.ws.app.manager_108\.cache\WEB-INF\lib\ibm_web20_wink_no_abdera_no_jackson-1.1.0.0-20110422.jar (The system cannot find the path specified)
C:\Users\Aokiji\IBM%20Workspace\MobileFirstServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\73\data\cache\com.ibm.ws.app.manager_108\.cache\WEB-INF\lib\ibm_web20_wink_no_abdera_no_jackson-1.1.0.0-20110422.jar (The system cannot find the path specified)
[ERROR ] Uncaught.init.exception.thrown.by.servlet
ManagementServlet
WorklightServices
java.lang.NoClassDefFoundError: Could not initialize class org.apache.wink.common.internal.i18n.Messages
at org.apache.wink.server.internal.DeploymentConfiguration.initAlternateShortcutMap(DeploymentConfiguration.java:386)
at org.apache.wink.server.internal.DeploymentConfiguration.init(DeploymentConfiguration.java:167)
at org.apache.wink.server.internal.servlet.RestServlet.getDeploymentConfiguration(RestServlet.java:202)
at org.apache.wink.server.internal.servlet.RestServlet.createRequestProcessor(RestServlet.java:138)
at org.apache.wink.server.internal.servlet.RestServlet.init(RestServlet.java:103)
at javax.servlet.GenericServlet.init(GenericServlet.java:161)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:325)
at [internal classes]
at com.ibm.worklight.admin.services.RestFilter.doFilter(RestFilter.java:61)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
at [internal classes]
at com.ibm.worklight.admin.common.filter.HSTSFilter.doFilter(HSTSFilter.java:110)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
at [internal classes]
Whenever there are unexplained Mobilefirst Studio errors, such as yours, it is typically best to:
Create a new workspace
Import the project
Re-build
If it fails still you should install the latest 6.3 plugin. You can obtain it from the following location: https://mobilefirstplatform.ibmcloud.com/downloads/#past-releases

access denied or repository not exported when download android source code

I am trying to download android_4.2_r1 source code. And I am using Ubuntu 12.04. I've installed jdk 1.6, Python 2.7, Git..
I downloaded repo use this code "$ curl http://code.google.com/p/git-repo/downloads/detail?name=repo-1.12 ~/bin/repo" (Since the official one is forbidden in China... )
Anyway, I initiated repo successfully.
But when I try to 'repo sync' I meet the error:
brendon#brendon-Lenovo:~/android4.2/.repo$ repo sync
fatal: remote error: access denied or repository not exported: /platform/abi/cpp.git
error: Cannot fetch platform/abi/cpp
Does Anyone know the reason? Thank you!
It is because some fetch link is forbidden in China...
We just need to choose the one that can be used here.
I recommend this one: git://Android.git.linaro.org/

Eclipse Android cannot connect to public repository - what am I doing wrong?

I am using a Mac with Eclipse Galileo, trying to load Android code from a public repository.
I tried 'Checkout from SVN' and the URL is:
http://secrets-for-android.googlecode.com/svn/trunk/secrets-for-android-read-only
This is from the website:
http://code.google.com/p/secrets-for-android/source/checkout
I get the error:
Error validating location: "org.tigris.subversion.javahl.ClientException: Bad URL passed to RA layer
svn: URL 'http://secrets-for-android.googlecode.com/svn/trunk/secrets-for-android-read-only' non-existent in revision 114"
Keep location anyway?
I'm currently using this svn client in Eclipse to manage my own secure repository on another website, so I know it's installed correctly and works.
Any ideas why checking out the public repo doesn't work?
Use http://secrets-for-android.googlecode.com/svn/trunk/ location to check out. Read the page http://code.google.com/p/secrets-for-android/source/checkout carefully. I've just tried the location and all works perfectly.

Categories

Resources