-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error loading version from resource "sdk-version.txt": Not found. #140
Comments
|
[Cross-linking for reference: https://www.dropboxforum.com/t5/API-support/Error-loading-version-from-resource-quot-sdk-version-txt-quot/m-p/239258#M13288 ] The Dropbox Java SDK contains a "sdk-version.txt" file with the version number for the SDK in it, e.g., for use in the Did you get the jars from the official dropbox-core-sdk-3.0.3 release here? If not, where did you download it from? I ask because the release includes "jackson-core-2.7.4.jar", but you mentioned "jackson-core-2.9.0.pr3.jar". Also, can you make sure you added "dropbox-core-sdk-3.0.3.jar" and not "dropbox-core-sdk-3.0.3-sources.jar"? |
|
Yes, i have included jar from official dropbox release. Yes you are right previously I had added "jackson-core-2.7.4.jar" from release. But after that i have included latest one by searching from internet version "jackson-core-2.9.0.pr3.jar". BTW, error is also same with 2.7.4 version. Yes, i am sure that i have added "dropbox-core-sdk-3.0.3.jar" and not "dropbox-core-sdk-3.0.3-sources.jar" version. |
|
test_dropbox_2.0.zip I have replace my original key with "APP-KEY" keyword in Manifest and String.xml file. |
|
I'm not set up for Android development in Eclipse unfortunately, as support for that ended some time ago, so I can't run that. Are you able to reproduce this with Android Studio? (Also, we highly recommend using Gradle or Maven to manage your dependencies anyway. That's generally easier than manually managing the jar files, especial to keep them up to date over time. If you can, please try that instead and let us know if that helps.) |
|
I think there is a bug somewhere in Android Studio 3.0 (+ Android gradle plugin 3.0). The apk built by Android Studio when I hit "Run" does not have Java resource files merged correctly (Java resources, not Android I haven't been able to pinpoint what exactly causes this bug in AS but I disabled both Instant Run and gradle daemon and that seems to make the problem go away. |
|
I experienced this as well, @tdtran. Build after build was made without any issues and all of a sudden the sdk-version.txt file was missing. Rebuilding and everything was fine again. |
|
This still occurs sometimes (once every 15 release builds I'd say), even when using the latest Dropbox SDK dependency from Gradle. The sdk-version.txt file simply isn't included in the APK upon inspection. @greg-db maybe you could look into this? |
|
@jacobras Based on what tdtran tried, and the fact that is only occurs sporadically, it sounds like this is an issue in the build system, so I'm not sure if we'd be able to fix this on our side. I can ask the team to investigate anyway, but we still haven't seen it occur in our testing. Is there any chance you could provide a small test project for Android Studio that does reproduce it? Thanks! |
|
This is a serious issue though, since as far as our build system is concerned, we're doing what we've always done in the past - build an apk and deploy. It's only when these reports started coming in from every other user that we realised it's broken. Saving the version in a .txt file is strange though - txt files aren't supposed to be bundled any way (I'd have thought) and if they are, that's pretty clumsy. Can you not embed that into a static variable in the source code instead? |
|
I should add I'm not using a jar file, I'm instead using the gradle dependency. |
|
I wonder if this is because of multi-dex support? Note that with multi-dex enabled (which we do) the actual source code may be in a different dex file, so |
|
For those looking for an immediate fix:
|
|
@guidedways Thanks a lot! I was thinking about the same thing. Can you submit a pull request? |
|
@jiuyangzhao would love to but I'd consider this a bit of a hack at this point, given you'd need to manually update the string each time you push a release. Could this not be automated to simply generate a string and update the version number in a .java file that gets included as part of the source code? At least then we'd certain be the SDK Version won't ever escape the code itself. |
|
I agree but this is strictly better than what we have right now. I don't have any bandwidth developing SDK but I can live with update the code each time. |
|
@jiuyangzhao done :) |
|
Any news about this? |
|
@chrisonline try my solution above |
|
Thanks I have seen this. So I wonder why Dropbox does ignore this. |
|
Seems the last version of Dropbox fixes this problem: This version is not listed at the main page here. There is still 3.0.10 The commit who fixed this problem is: |
|
@guidedways Your hacky commit is now also merged for the next version. I think this is not needed anymore after the 3.0.11 version. |
|
Apologies, the Gradle instructions had an old version number. I just fixed that. Anyway, yes, we have a workaround for this that will be in the next release. |
|
@jiuyangzhao: It might be a good idea to revert the hard-coded version hack (040bc46). The change that moved "sdk-version.txt" in a subdirectory (b3a1e4f) appears to have fixed the issue for @chrisonline, so there's a good chance it fixed the issue for everyone. (If someone encounters the issue when using version 3.0.11 or later, then we can give up and use the hard-coded version hack :-) |
|
@cakoose Yes I would remove the hard-coded version hack. I have tried it with 3.0.11 and mutlidex and all is working so far. The updated version with 3.0.11 is since yesterday live and no crashes so far anymore. |
|
Thanks for the notes! cc/ @jiuyangzhao |
I am migrating Dropbox Android V2 API from V1 in my existing project. I have follow this documentation. I have existing project developed with Eclipse. So i have downloaded "dropbox-core-sdk-3.0.3.jar" and "jackson-core-2.9.0.pr3.jar" files and added under lib folder. The V2 dropbox login process works fine and also
Auth.getOAuth2Token()method return correct token.But i am getting issue on calling
DropboxClient.getClient(ACCESS_TOKEN)method. I am receiving follwing error...java.lang.RuntimeException: Error loading version from resource "sdk-version.txt": Not found.
Full Error Stack:
The text was updated successfully, but these errors were encountered: