Software Archive
Read-only legacy content
17061 Discussions

APK retorna falha de conexão após instalado - The connection to the server was unsuccessful.

Anderson_O_
Beginner
1,238 Views

Olá pessoal.

Criei meu primeiro app no Intel XDK e usei JSON para buscar dados em um servidor remoto.No simulador o app funciona maravilhosamente bem, e se eu gerar o APK usando o software Website 2 APK também tenho sucessos depois de instalar o app, porém, o APK gerado pelo Intel XDK retorna a seguinte mensagem quando executado pela primeira vez em qualquer dispositivo real.

Application Error
The connection to the server was unsuccessful. (file:///android_asset/www/index.html)

Durante a instalação no Android o instalador de pacotes me informa que meu app tem acesso total à internet, mas logo depois de instalado o erro persiste. Tentei resolver por conta própria, adicionei um meta Content-Security-Policy, configurei o campo Network Request com o endereço do meu servidor e nada.

Alguém poderia me ajudar com esta questão?

Muito obrigado.

0 Kudos
5 Replies
PaulF_IntelCorp
Employee
1,238 Views

Try building an app with the "hello cordova" sample and see if you get the same results. I have seen this issue with large apps running on slow devices. If you do not see the problem when running the "hello cordova" sample it probably means there is something in your app that is the source of the problem. The network permission is part of all Cordova apps, even if your app does not require access to the network interface, it has to do with the way the Cordova framework jumps between the JavaScript webview environment and the native Java environment.

p.s. "file:///android_asset/www/index.html" is where your app "lives" in the package when it is installed on a real device.

0 Kudos
Bartolomeu_Uicaa_D_
1,238 Views

Boa tarde,

Minha compilação dá certo, mas não é gerado um arquivo com extensão apk, podem me dizer o porque ? Desde já agradeço...

 

0 Kudos
Bartolomeu_Uicaa_D_
1,238 Views

é gerado esse arquivo com esta extensão

lednordeste.cordova.crosswalk.201701025351

0 Kudos
PaulF_IntelCorp
Employee
1,238 Views

Bartolomeu Uicaa D. wrote:

Good afternoon,

My compile works fine, but is not generated a file with apk extension, can you tell me why? Thank you very much in advance...

This file is generated with this extension

Lednordeste.cordova.crosswalk.201701025351

Are you using Windows? You may have a hidden extension in the Windows file explorer. I suspect if you look at the file properties for that file it is a ZIP file, and Windows is hiding ZIP file extensions as a "known extension." When you create an Android app with Crosswalk the build system generates two APK files (one for x86 and one for ARM) and puts them inside of a ZIP file. See these docs for details:

0 Kudos
Bartolomeu_Uicaa_D_
1,238 Views
Thank you very much my friend, problem solved, because I program in an imac.

 

@Paul F 

0 Kudos
Reply