Android Studio cant find or install play-services 7 /wearable - android-studio

I have a new windows 8.1 machine, and am trying to get my android IDE environment installed. But there seems to be some issues that i have never encountered before. my existing projects are not compiling because the system can not find or even download the proper play services libs..
Error:A problem occurred configuring project ':mobile'.
Could not resolve all dependencies for configuration ':mobile:_debugCompile'.
A problem occurred configuring project ':wear'.
Could not resolve all dependencies for configuration ':wear:_debugCompile'.
Could not find com.google.android.gms:play-services-wearable:7.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-wearable/7.0.0/play-services-wearable-7.0.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services-wearable/7.0.0/play-services-wearable-7.0.0.jar
file:/C:/Users/Erik/AppData/Local/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-wearable/7.0.0/play-services-wearable-7.0.0.pom
file:/C:/Users/Erik/AppData/Local/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-wearable/7.0.0/play-services-wearable-7.0.0.jar
file:/C:/Users/Erik/AppData/Local/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-wearable/7.0.0/play-services-wearable-7.0.0.pom
file:/C:/Users/Erik/AppData/Local/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-wearable/7.0.0/play-services-wearable-7.0.0.jar
Required by:
AndroidClickDogTrainer:wear:unspecified
So i tried using the SDK manager to insure i had the proper play services but
I keep getting the following error from my SDK manager in Android Studio on my Windows 8.1 machine.
This is a clean install, and i thought it may be my firewall settings but after turning off my firewall completely it is still happening:
Refresh Sources: Fetched Add-ons List successfully Refresh Sources
Failed to fetch URL
https://dl.google.com/android/repository/addon.xml, reason: File not
found Failed to fetch URL
https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml,
reason: File not found Failed to fetch URL
https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml,
reason: File not found Failed to fetch URL
https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml/addon.xml,
reason: File not found Refresh Sources: Failed to fetch URL
https://dl.google.com/android/repository/addon.xml, reason: File not
found Failed to fetch URL
https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml,
reason: File not found Failed to fetch URL
https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml,
reason: File not found Failed to fetch URL
https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml/addon.xml,
reason: File not found Ignoring unknown package filter
'extra-google-m2repository'Warning: The package filter removed all
packages. There is nothing to install.
Please consider trying to update again without a package filter.
No matter what i do.. TURN OFF FIRE WALL, RUN AS ADMIN.. etc etc.. it just won't install the play services libs..
please help

So I searched high and low for an answer to this, and it seems a lot of people are having this and similar issues and creating really cumbersome workarounds that include everything from re-writing parts of the android.bat file to uninstalling the SDK and re-installing it from scratch.. for me none of those solutions worked.. but what seems to have fixed the problem was actually quite simple.
hope this helps others..
open the Android SDK Manager.. click on TOOLS>Options and check "Force https://.. sources to be fetched using http://.."

Related

Android Studio 3.6.3 How to get rid of ERROR: Unable to resolve dependency for ':app#debug/compileClasspath' (androidx.fragment:fragment)

I'm tired of getting this error every third/fourth time I try to build project:
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve androidx.fragment:fragment:[1.2.0].
Show Details
Affected Modules: app
It also effects ':app#debugUnitTest/compileClasspath' and ':app#debugAndroidTest/compileClasspath' (shows the same error for them).
Also sometimes it goes after the following build error (internet connection is surely stable):
Unknown host 'repo.maven.apache.org: nodename nor servname provided, or not known'. You may need to adjust the proxy settings in Gradle.
Enable Gradle 'offline mode' and sync project
Learn about configuring HTTP proxies in Gradle
There were no changes in build.gradle files or any other gradle files before this error came.
It would be nice if you help to get rid of it. Gradle-plugin version = "1.3.71".

Npm package install failure

Trying to learn nodejs following a few articles. I'm able to download and make sure its working using a video from youtube. But now I'm trying to incorporate that in Visual Studio .net 4.5.2. I've tried to added it via new get package manager and the PM console each come back to same error.
"Install-Package: The specified path, file or both are to long. Less than 260 and directory name less than 248" Self explanatory, found this article
So I tried:
npm-flatten
npm-dedupe
also Enable Win32 long paths
It starts adding package npm 3.5.2 files and folders then bombs out and spits the same error. What else am I missing in order to get this package installed?
Thanks for any help

Facebook and google maps plugins don't work together in PhoneGap app

I am going to create the app that shows google map and required social login with facebook.
I decided to use:
https://github.com/Wizcorp/phonegap-facebook-plugin
and
https://github.com/wf9a5m75/phonegap-googlemaps-plugin
I don't know what is a reason, but these plugins perfectly work alone, but when I installed them together I got next error:
BUILD FAILED
C:\Users\{USER_NAME}\AppData\Local\Android\sdk\tools\ant\build.xml:577: Jar mismatch! Fix your dependencies
Total time: 1 second
{APP_PATH}\platforms\android\cordova\node_modules\q\q.js: 126
throw e;
^
Error code 1 for command: cmd with args: /s /c "ant debug -f {APP_PATH}\platforms\android\build.xml -Dout.dir=ant-build -Dgen.absolute.dir=ant-gen"
ERROR running one or more of the platforms: Error: {APP_PATH}\platforms\android\cordova\run.bat: Command failed with exit code 8
You may not have the required environment or OS to run this project
I am not experienced in PhoneGap development, but I guess that both plugins are doing some changes in platform dependencies (and rewriting changes of another plugin).
Could anybody help me with this?
I got the answer of google-maps plugin creator:
The facebook plugin contains android-support-v4.jar, and the map
plugin installs another android-support-v4.jar.
Remove one of them.
I took off android-support-v4.jar from com.phonegap.plugins.facebookconnect folder and left it in libs folder. It was solved my issue (fb and g-maps work together).
So I can mark this question as closed now.
I leave this answer for anybody who meets this issue like me.

A library uses the same package as this project

For 2 days, I have been trying to fix my Android Studio setup, but despite a lot of googling have had no luck fixing this problem. Gradle keeps giving me the error
Error:Execution failed for task ':Android-Tabbedout-30:processQaReleaseResources'.
Error: A library uses the same package as this project
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0
If I add in the enforceUniquePackageName=false to the gradle file, then the project can be successively refreshed by Gradle, but once I try to run it I get this error:
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define
Any ideas on how to fix this?
I was searching for that same problem and i find this on github
https://github.com/DWorkS/AStickyHeader/issues/12
And this solved my problem.
All this says is to rename the package name on the AndroidManifast.xml file.
And its done.

When building blackberry10 cordova/phonegap project many files are missing

When building a blackberry10 cordova/phonegap project, a number of files are not included in the build. A number of splash screen images and the file "DEFAULT_BAR_NAME.bar" are not included.
However, if the same process is repeated on another device (desktop PC) all files are included. As far as I can tell, both have identical software setups.
C:\Users\USER\hello>cordova emulate blackberry10
[Error: An error occurred while emulating/deploying the blackberry10 project.
[BUILD] Populating application source
[BUILD] Parsing config.xml
[BUILD] Generating output files
[WARN] Failed to find debug token. If you have an existing debug token, please copy it to %HOME%/.cordova/blackberry10debugtoken.bar. To generate a new debug token, execute the 'run' command.
[ERROR] Error: Attribute image: file cannot be found in the list of packaged files: res/screen/blackberry/splash-1280x768.png
[ERROR] Native Packager exception occurred
[WARN] Failed to find debug token. If you have an existing debug token, please copy it to %HOME%/.cordova/blackberry10debugtoken.bar. To generate a new debug token, execute the 'run' command.
[ERROR] Error: Attribute image: file cannot be found in the list of packaged files: res/screen/blackberry/splash-1280x768.png
[ERROR] Native Packager exception occurred
[ERROR] Error: File does not exist or not a file or cannot read: C:\Users\USER\hello\PLATFO~1\BLACKB~1\build\simulator\DEFAULT_BAR_NAME.bar
If any more information will help then please ask, thanks!
I saw this message a bit late.
But I have a solution for this problem.
Browse to the root of your phonegap project (the one containing these folders merges,platforms,www & plugins)
Open the www folder
Open config.xml
Now carefully remove all the declarations for splash and icon for those platforms those are not added using cordova platform add command. For e.g if you have created a project only for blackberry remove all the icon and splash declarations for ios, android, webos, bada, windows-phone
Now run cordova build. Your blackberry app should be built without any errors.
I was able to compile my blackberry 10 app in phonegap 3.3
If you face any errors regarding p12 file then you need to follow the blackberry signing guidelines. Or if you got any doubts then mail me
hansolo.amey#gmail.com

Resources