Search code examples
androidexpansion-files

Getting error "download failed because the resources could not be found"


I have made simple sample project like SampleDownloaderActivity, I set BASE64_PUBLIC_KEY and expansion files version and lengths, uploaded apk and expansion files to Google Play, saved them and... received a such message after running the app: "download failed because the resources could not be found"


Solution

  • You must upload a draft of your application and expansion files to Google Play.

    While your app is publishing (the time between you pressing publish and it actually going live on Play) the expansion files are also unavailable, which can lead to some confusion.

    From the docs:

    Because your application must sometimes manually download the expansion files when it first opens, it's important that you test this process to be sure your application can successfully query for the URLs, download the files, and save them to the device.

    To test your application's implementation of the manual download procedure, you must upload your application to Google Play as a "draft" to make your expansion files available for download:

    1. Upload your APK and corresponding expansion files using the Google Play Developer Console.
    2. Fill in the necessary application details (title, screenshots, etc.). You can come back and finalize these details before publishing your application. Click the Save button. Do not click Publish. This saves the application as a draft, such that your application is not published for Google Play users, but the expansion files are available for you to test the download process.
    3. Install the application on your test device using the Eclipse tools or adb.
    4. Launch the app.

    If everything works as expected, your application should begin downloading the expansion files as soon as the main activity starts.

    See the testing guidelines for full details.