2014-03-24 47 views
0

在android上:應用程序有時會給出[應用程序錯誤]存在網絡錯誤(file:// /android_asset/www/index.html)。IBM Worklight 6.1 [應用程序錯誤]出現網絡錯誤(file:///android_asset/www/index.html)

在其他人的搜索答案但沒有工作。

下面是我Appname.js路徑:

的Android /本地/ src目錄/通用/ APPNAME/Appname.java

public class appName extends WLDroidGap { 

    @Override 
    public void onCreate(Bundle savedInstanceState){ 
     super.onCreate(savedInstanceState); 
    } 

    /** 
    * onWLInitCompleted is called when the Worklight runtime framework initialization is complete 
    */ 
    @Override 
    public void onWLInitCompleted(Bundle savedInstanceState){ 
     super.loadUrl(getWebMainFilePath()); 
     // Add custom initialization code after this line 
    } 

} 

我怎樣才能做到這一點?

+1

什麼時候顯示錯誤?莫名其妙地影響你的代碼?另外,您是在啓動時連接到服務器,還是在連接到服務器時的任何時候?如果是這樣,你有從設備/模擬器到服務器的網絡訪問嗎? 此外,你粘貼你的Appname.java,除非你從那個文件中得到一個特定的Android錯誤,它是沒用的,我想你的意思是顯示main.js文件。 最後,您是否使用從6.1之前升級的應用程序或6.1中創建的應用程序? –

回答

0

什麼是index.html和appname.java/js?
在工作燈6.1.0.x,新的應用程序給出的index.html和main.js/main.css的/ appname.java

你重命名任何項目文件?
application-descriptor.xml中mainFile的值是什麼?確保它是「index.html」。

+0

它只是index.html,我提供的代碼是appname.js,因爲http://stackoverflow.com/questions/17268760/application-error-there-was-a-network-errorfile-assets- www-index-html does not work – user3361504

+0

沒有幫助。 Pleas提供完整的Worklight項目(從Eclipse導出),以便在此處重新創建。 –

相關問題