I can't build my android project due to this error. Gradle failed to GET https://www.jitpack.io/com/github/Raizlabs/DBFlow/dbflow/3.1.1/dbflow-3.1.1.pom . Strange enough I am able to view the pom file behind this URL in my browser. What might be the problem here?
My gradle.properties look like this:
systemProp.http.proxyHost=myproxy.local
systemProp.http.proxyPort=3210
systemProp.https.proxyHost=myproxy.local
systemProp.https.proxyPort=3210
systemProp.http.proxyUser=usr
systemProp.http.proxyPassword=pwd
When I remove the proxyUser/Password I get an 407 Proxy Authentication Required.
For me this worked
1. Invalidate caches/restart
2. Sync project with gradle files
Check the local 'gradle.properties'. My problem was on there. Somehow there was some proxy informations and they was wrong. I deleted it and problem solved.
Your proxy needs authentication and the authentication you supply is invalid or your proxy does not allow to request that URL with the authentication details you supply.
You've only provided user/password for systemProp.http. You likely need to provide the same for systemProp.https
See accessing the web via proxy
You need to reset android studio because we cannot get the sever response due to proxy matters.
Close Android Studio.
Please Go to C://Users/Username/.
Then delete .gradle file and .Android Studio File.
After Open Android Studio and set settings.
I solved this problem using above steps.
check gradle offline mode under settings and check local gradle then specify the path of you gradle.zip file its under
Upgrading to Android X can fix the Forbidden! response problem.
Open your project on Android Studio
Top menu > Refactor > Migrate to AndroidX
Don't forget backup your entire project before migrating.
Late answer, but useful, i suppose. I realised that it is not allowed to read jitpack artifacts from a private repository without having a paid subscription:
https://jitpack.io/private
So that's might be a cause for 403 error.
You have an option either upgrade or make the repository public
Subscription must be bought for the repository's owner account.
Related
Steps that I made so far.
Downloaded an install the graphql plugin to execute the queries internally.
Created this config file for executing local queries for the expected behavior.
Which is working fine with performing general query. But with this config I am getting following error while building project and run it on a device.
Failed to parse GraphQL file E:\...\src\main\graphql\schema.graphql (9:13) Unsupported token `!`
FYI, I have already gone through this ticket from apollo-kotlin github page. Doesn't resolve my problem or I don't understand the solution there.
For now,
By deleting the E:\...\src\main\graphql\schema.graphql file, the project builds and runs just fine.
If anyone has more idea on this, let me know and I will update if I find anything else as well. Thanks
I tried new Firebase Crashlytics SDk after migrating from Fabric and seem to run into a weird issue.
Crash logs are not captured in dashboard after upgrading firebase-crashlytics to 17.0.0 and I get this error in log:
E/FirebaseCrashlytics: Failed to retrieve settings from https://firebase-settings.crashlytics.com/spi/v2/platforms/android/gmp/XXXX/settings
and I followed all instructions from firebase console quickstart guide. Please help me if any one have faced similar issue.
In my case, I had migrated the release version but I guess I never enabled Crashlytics on the Firebase console for the debug variant.
A simple mistake, but putting it here in case it helps out someone else.
If you enabled multiple apps in single project, ensure you choose the correct one (left drop down menu choose the correct project which hold the multiple apps, right drop down menu choose the correct running app). I made such mistake and keep looking on the wrong app page and enabling Crashlytics on the wrong app and of course I get that error "Failed to retrieve settings from https://...:
In my case, There was a legacy firebase project which using same package name of app. When I deleted legacy firebase project and It's works like a charm!
Firebaser here -
We often see these kinds of errors after upgrading due to some sort of configuration error when you were switching out your dependencies. Did you make sure to follow all the steps in this guide?
You may also want to enable Crashlytics debug logging and force a test crash to see if the logs give you any other output. And it may help to edit your original question with your Gradle files and any other relevant Crashlytics setup.
Same problem here with 17.2.1, one of my app flavours didnt't work throwing above error. Removing current apps and re-adding them in firebase project settings solved the problem for me.
We had an issue with the firebase apps and had to re-create the android app on firebase. This meant I had to update the google-services.json file.
After doing this, firebase remote config worked but analytics and crashlytics did not.
Turns out android studio was using-an auto generated file values.xml. This contained
<string name="google_app_id" translatable="false">1:xxxxxxx:android:yyyyyyyy</string>
The yyyyyy part of it was still using the old value from the previous google-services.json file. Deleting this file for all flavors, debug and release builds, coupled with an invalidate caches + restart
might do the trick, but just to be safe, what fixed it for me was:
commenting all the firebase libs from all gradle files
syncing gradle
project will not compile at this points since it cant find Firebase dependencies
invalidate caches + restart
uncomment firebase libs in all gradle files
sync gradle
run app and check if firebase crashlytics works
I am using Android studio 4.1.2
If you have changed the google-services.json file, i.e changed it with a one from a different project, you should do the following:
Comment out all the crashlytics dependencies in the gradle files
Build the app
Invalidate cache and restart
Uncomment crashlytics dependencies and rebuild app
This should fix the problem if it's caused by cached values from the previous json file for crashlytics.
I am working behind a strict proxy and struggling with identification of URLs which need to be accessible for android developement.
I know for SDK updates https://dl-ssl.google.com/ should be accessible.
I need answer to following queries:
What are the URLs for resolving dependencies using gradle also for updating gradle itself?
Are there any additional urls apart from sdk update and gradel dependencies which need to be accssible?
After a quick search,I also found below urls-
http://download.gradle.com
http://services.gradle.com
https://repo1.maven.org/maven2/
https://jcenter.bintray.com/
http://repo.jfrog.org
May be these will work.
This link provides with requirement for usage of gradle in android studio. with this following are answers to queries:
Following are the urls need to be accessible for basic gradle functionality:
https://repo1.maven.org/maven2/
https://jcenter.bintray.com/
Apart from these any URL required for access of custom libraries hosted on other then default location.
Getting exceptional access from network admin team for said URLs will solve the problem
if your'e running gradle behind a proxy. try adding the proxy settings to your gradle.properties file e.g.
systemProp.http.proxyUser=myusername
systemProp.http.proxyPort=yourport
systemProp.http.proxyPassword=proxypasswordhere
systemProp.http.proxyHost=proxy url/ip here
I have corporate environment with all http and https calls are behind the proxy.
I was able to fix some issues with command line downloads by putting exporting http_proxy environment variable into .profile file.
But with Robolectric 2.2 which is downloading android sources or classes before first run I failed. I don't have CI setup yet so I'm just trying to run tests from idea.
Does anyone know hot to fix it?
I've tried to provide proxy in IDEA settings, I've tried to provide additional environment variable in run configuration. Nothing helps
UPD When I specify proxy in Mac settings it is producing another error:
Unable to find resource 'org.sonatype.oss:oss-parent:pom:7' in repository sonatype (https://oss.sonatype.org/content/groups/public/)
It looks like I'm probably using or missing wrong transitive dependency for Robolectirc (I don't use maven or ivy, I've just downloaded jars from maven central)
UPD2 Nope, It is just timeout again: Error transferring file: Operation timed out
I know that this is a little bit old Question but if you want to use proxy you should put the following file in your home/.m2 directory:
settings.xml
<settings>
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>your_host_here</host>
<port>your_port_here</port>
</proxy>
</proxies>
</settings>
For gradle look here https://docs.gradle.org/current/userguide/build_environment.html
To add another late answer to an old question :) Since Robolectric 2.4 two properties were introduced to help in the scenario when your Robolectric tests in CI run behind a proxy server:
You have to specify robolectric.offline and robolectric.dependency.dir in your build.gradle file. Something like this:
afterEvaluate {
project.tasks.withType(Test) {
systemProperties.put('robolectric.offline', 'true')
systemProperties.put('robolectric.dependency.dir', "${project.rootDir}/.robolectric/")
}
}
Then you need to download the necessary jars from maven or sonatype and place it in the directory you specified...
I wrote a blog post with more details.
In case this helps someone. Setting the proxy in settings.xml (I tried both possible paths for this file) did not work for me. I ended up passing that as a gradle arguments:
gradle cleanTest test -Dhttps.proxyHost=<proxy-host> -Dhttps.proxyPort=<proxy-port>
EDIT: This problem has not already been resolved in the other suggested SO question
I had a fully working app on the market for over a year, with very few crash reports. Then recently I changed my app into a library, so that it could be included within multiple different "wrapper" projects. This was so that I could easily make different version - free, paid, non-google markets, with/without in-app purchasing etc etc.
The new "library+wrapper" app appeared to work fine. I could run it multiple times, without error. But then a day later (when presumably the OS had closed some or all of the app's activities) I tried to run it and it reported
Unable to instantiate application com.mycompany.mygamelibrary.MyGameApplicationClass: java.lang.ClassNotFoundException: com.mycompany.mygamelibrary.MyGameApplicationClass
The class it failed to find is the first class that runs when the program starts up, MyGameApplicationClass - which extends Application. This class is part of the library.
I suspect something goofy in one of the two manifest files.
The manifest of the wrapper project contains the lines...
<application android:icon="#drawable/mygame_icon"
android:screenOrientation="portrait" android:label="My Game Name"
android:name="com.mycompany.mygamelibrary.MyGameApplicationClass">
Any ideas what could have gone wrong?
EDIT: The library was referenced "the correct way" as defined by yorkw's answer to this SO question.
EDIT: I can not repeat the crash at the moment :-( I don't know what it is the OS does when the app is not used for a day or two.
There are two possibilities. Either you, like me, have a spelling error in your manifest file. Have a co-worker or friend read it to make sure the name is correct. Or you have not referenced the project correctly.
The official document describes how to properly link projects in its documentation.
Why it would first seem to work and later stop working is a bit of a mystery. However, I guess that the VM might still have had the necessary references ready to resolve the classes in the library just fine. A restart of the VM removed all those references and trying to resolve them was unsuccessful.
Update: Regarding the edits in the OP: As you confirm that you have correctly referenced the other project, you can check if the project is included in APK, just to be sure. You can rename and open an APK as any other archive (.rar works fine for me). Sometimes, it happened to me, the project is not correctly included in the APK. A cleaning of your workspace usually remedies the problem and so could a restart of your IDE depending on what you are using. To manually conduct a clean in Eclipse for example, use Project->Clean... or try Android Tools->Fix Project Properties by right-clicking on your project.
As you seem to also have fixed the problem by restarting your device, it could be that the libraries were linked incorrectly. A problem that I have never seen myself but as a very common quote says: "Have you tried turning it off and on again?".
For Android Studio:
Build --> Clean Project
Fixed issue.
Have you tried to make a new subclass of MyGameApplicationClass in your 'main' project and set it in the manifest as Application class?
I had a slew of bugs with Android Studio 3.0 Canary 4 and the way I fixed them was by editing the AndroidManifest.xml by adding in some jibberish to the application name. Then, I clicked build. Obviously, a whole mess of new error messages appeared. I changed the name back to what it should be, built the app, and it just ran.
Sometimes, I just don't know...
EDIT: Just ran into this issue on Android Studio 3.0 Canary 4 on my laptop when switching over. I again went through the same process of changing AndroidManifest.xml file to contain a typo, building, and changing back. That didn't work.
I then noticed that instant run was still enabled. Going into settings (by clicking command + , (comma key)) and typing "instant run", I was able to disable instant run, built the app, and the error of class not found went away.
Summary of Steps to Fix [FOR ME]
Invalidate cache / restart
Clean the project
Manually delete the build folder (need to be in project view for this one)
Make an intentionally errant edit to your AndroidManifest.xml file, build the app, observe the errors, remove the errant edit and build again
Disable instant run
Again, I don't mean to insinuate that this will fix everyone's error, but I have now used some combination of these steps on two different machines (MacOS Sierra) and it has been resolved for me. Hope it helps.
In my case, application id and package were mismatched. This should be same as presented in following images...
AndroidManifest.xml
app/build.gradle
In this case you can see, applicationId and package both are same that is com.mycompany.mygamelibrary
May be its a Build Path Configuration problem.I did the following to solve the issue.
1.Right click on your project and go to Java Build Path.
2.Click on Order and Export tab.
3.Check Android Private Libraries and other 3rd part libraries if you have added.
4.Press ok and clean the project.
I hope it will solve the issue.
Once I had the same error message, but maybe the cause isn't the same.
I did a code and worked for a while, then I wanted to improve it and got the same error and I couldn't run it.
I could fix the problem with
the correct Build Path order (as I can see you've already did this)
I check on the Order and Export tab the android-suppor-v4.jar
and the key was the Android SDK Managert->Upgrade everything and (next) Eclipse->Help->Check for updates.
After I upgraded to the latest android plugin and SDK my app compiled and ran again.
I hope this will help you!
I'm not very sure about this but it might be that your system's debug.keystore license validity has expired as it is valid for only 365 days. You just need to delete the debug.keystore from your computer. The debug.keystore will be generated automatically by Eclipse when you compile your Android App.
Same message seen ... this time it turned out to be different output folders for MyApp/gen and MyApp/src in the Build Path (caused by Maven integration).
Unchecking "Allow output folders for source folders" solved the problem.
I had this issue in an Android application that needed an Application class which was created in wrong path inside the Android Studio project. When I moved the class file to the correct package, it was fixed.
This all Process work for me to solve application class Exception.
Step 1: Open Run(window+R) Search -> Prefetch Remove all file (Some file not Delete)
Step 2: Open Run(window+R) Search -> %temp% Remove all file (Some File not Delete)
Step 3: Open Android Studio -> Build -> Clean Project
OR
Select File > Invalidate Caches / Restart > Invalidate and Restart from Android Studio toolbar.
OR
Close and reopen Android project.
OR
Restart System
I ran into this issue several times and both times it seemed to be caused by some instant run feature.
In my case, deleting the application from the device and then installing it from Android Studio again resolved the issue.
I ran into this problem today. The project runs well for over a year but today it reports this issue, and cannot debug on my testing device.
I fixed it by updating to latest gradle version. Hope this can solve your problem.