Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Anderson_O_
Beginner
290 Views

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

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.

Tags (2)
0 Kudos
5 Replies
PaulF_IntelCorp
Employee
290 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.

290 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...

 

290 Views

é gerado esse arquivo com esta extensão

lednordeste.cordova.crosswalk.201701025351

PaulF_IntelCorp
Employee
290 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:

290 Views

Thank you very much my friend, problem solved, because I program in an imac.

 

@Paul F 

Reply