System Error : Unable to get a response with the specified URL

Hi,

I have been using AI2 for more than 2 years. I hadn't recompiled my project to an APK file for almost a month. But when I did it today, I got an error message: "System Error : Unable to get a response with the specified URL: http:www ... (a simple text file) after my new APK file is installed. I tried to run my older version and everything is OK.

I also recompiled my project using "Kodular", I got an error message during recompiling: "Error generating Yail for screen (number) _Screen1::this.getParameters() is undefined. Please fix and try packaging again. "getParameters()" isn't my procedure. Hope this is a hint to the solution.

By the way, the response time of the Block Editor became extremely slow in Chrome recently. I tried to switch to Firefox according to AI2's suggestion, and the speed is almost like a new project. So, without Firefox, I can't even worked with AI2. Thanks guys.

Truely,
Anthony Chow

Why not show us how you are handling / loading this file in your blocks ?

Hi Tim,

My Project already becomes "huge", and that's why I have the slow response time a long time ago. Anyway, I will try to create a small project for testing as what I did before to help you guys debugging. Thanks in advance.

truely,
Anthony

Hi Tim,

I just created a small project for the file loading problem:

file_loading_test.aia (3.4 KB)

The sequence of testing is:

create APK file --> install the app --> Test the app --> uninstall the app

When "SaveResponse" of the "Web Loader" is set to True, error appears, but data will be loaded successfully if it is set to False. That means web_loader.GotText is ok, but web_loader.GotFile fails.

I use the App Inventor About page to replace my small simple text file. Hope all these information can help.

Truely,
Anthony

What android version is on your device you are testing with?

To get you going, your blocks indicate that you want to retrieve the source of a web page and save it as a file. Testing in companion (2.61u) on Android 10, I used these blocks to achieve that:

image

For Android 10+ you cannot ask for WRITE_EXTERNAL_STORAGE permission, and for Android 10 the file will be stored in the ASD for which no permission should be required.

You mention a text file, if this is being served up by an http server (e.g. you can view in a browser if you navigate to the file) then you should be able to do the same thing. If you want to download a physical text file, then a different approach is required.

Hi Tim,

I don't have Android 11, I just can test my app on Android 9 & 10, and both aren't working. Do you mean that the new version of AI2 will not support web.GotFile ?

truely,
Anthony

It will support Got File, but that is not what your example app was trying to do. If you put an html file in your Web1.getUrl you will get back the source code for that html, you will not get a file.

Hi Tim,

OK, this time I let you have my real data path:

[mod edit link removed]

You will see the same thing happening. As I mentioned before, this won't happen in my older version.

Truely,
Anthony

The blocks I have shown work perfectly for that url as well.

The contents look like Firebase API keys.....do you want to leave that aia project up ?

Would need testing when compiled for the various android versions...

Hi Tim,

Yes, You are right, but how can I delete the link.

Truely,
Anthony

Done... :slight_smile:

Thanks very much.

Hi Tim,

I think I know what caused the error in my file_loading_test project. The problem is the path of the saved file name where I tried to save the file in the SDcard (external storage). It is just that the error message doesn't show exactly what's wrong. If I save the data with a simple file name, such as "test.txt", things will be OK.

But then I have a few questions:

  1. What scope type should we define for "File" if it is designed for External Storage ?
  2. Is scope type "App" same as "Private" in version nb187, and are used only for Internal Storage ?
  3. Can we create directories (folders) with scope type "Private" ? If not, which scope type can do this for us ?
  4. If I want to upload a file through E-mail, what scope type should I define for File ?
  5. Is "Shared" the scope type of File for reading file in the System's "Download" folder ?

Thanks in advance.

Truly,
Anthony

Hello, I have been using MIT for more than a year. I am trying to build a video calling app. but when I am trying to run it is showing google error 404 the requested URL was not found on this server. Please help me. I need it for a school project

Now it is showing Your client has issued a ,malformed or illegal request please help me

im using the url https://meet.google.com/jpp-mivm-sjb
please help