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

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".

Related

Building React Native source for Android NDK

I'm trying to build React Native locally. I followed the Facebook instructions from Building React Native from source
but when I do the command react-native run-android, I receive the following error:
:ReactAndroid:downloadBoost
Invalid cookie header: "Set-Cookie: sf_mirror_attempt="boost:iweb:boost/1.57.0/boost_1_57_0.zip"; expires=120; Path=/". Invalid 'expires' attribute: 120
:ReactAndroid:downloadBoost FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':ReactAndroid:downloadBoost'.
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Any ideas as to what I may have done wrong?
The problem is that your computer is not able to download boost_1_57_0.zip file with the https path that is in your settings (invalid certificate).
Go to your project's project_root/node_modules/react-native/ReactAndroid/build.gradle file and change the src attribute on the task downloadBoost part to any proxy that you find to boost_1_57_0.zip and it should work.
I received a similar error and the error went away after using the correct Android NDK (currently android-ndk-r10e). But if you've followed the instructions, as you've said, then that is most likely not your problem.

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

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://.."

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.

Encountering errors of obtaining dependencies when starting grails application

I'm new to Grails web framework. I got this error when running my first grails app from the terminal. Below is the error I got.
> | Downloading:
> org/apache/commons/commons-parent/17/commons-parent-17.pom | Error
> Resolve error obtaining dependencies: Failed to read artifact
> descriptor for org.hamcrest:hamcrest-core:jar:1.3 (Use --stacktrace
> to see the full trace)
>
> | Error Required Grails build dependencies were not found. This is
> normally due to internet connectivity issues (such as a misconfigured
> proxy) or missing repos itories in grails-app/conf/BuildConfig.groovy.
> Please verify your configuration to continue.
I'm running this app with the internet connection but this error still occurs. How can I fix this error?
are u sure you are using a the correct download for grails, it seems that your trying to connect to the internet and your grails can't ? may be check your proxy settings? or what you are really trying to do in the command line ?
Your console log says, you can not connect to internet for downloading dependencies.
But its not the case. Maven has stopped http repositories and that is the root cause.
You have to use https. If you could not connect to https for some reason, here is workaround to that:
mavenRepo "http://insecure.repo1.maven.org/maven2/"
Putting above line in BuildConfig.groovy will resolve your issue and start downloading dependencies.
What mavenRepo's do you have in your BuildConfig.groovy. I found that I had to add a few, here's mine:
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()
// uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
mavenRepo "http://repository.codehaus.org"
mavenRepo "http://download.java.net/maven/2/"
mavenRepo "http://repository.jboss.com/maven2/"
mavenRepo 'http://repo.spring.io/milestone'
}
Have you tried running:
grails refresh-dependencies
before you try to run your app?
What version of Grails, SO and JDK do you have?, in Windows 8 with JDK Java SE 7u45 and Grails 2.3.1 i have a lot of problems; I had to make a downgrade to JDK

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