在ionic app中找不到cordova.js文件?

时间:2016-07-22 06:07:07

标签: angularjs cordova ionic-framework inappbrowser

当我在Android设备上运行应用程序时,我收到此错误,并且inappbrowser无法帮助我...

错误

#define EMPTY -1
struct CHAMPION{
    int champ_ID;
    int weaponL_ID;
    int weaponR_ID;
}

vector<string> Champions;

int getChampIndex("struct_obj" obj, int value){
    for(int i=0; i<Champions.size(); i++){
        if(Champions[i].obj == value){return i;}
    }
}

int main(){
    //fill Champions vector

    SearchedChamp = getChampIndex(champ_ID, 17);
    //process SearchedChamp

    NoWeaponL = getChampIndex(weaponL_ID, EMPTY);
    //process NoWeaponL

    NoWeaponR = getChampIndex(weaponR_ID, EMPTY);
    //process NoWeaponR

}

2 个答案:

答案 0 :(得分:1)

当你运行 cordova平台添加android 然后 cordova build android 时,你应该得到一个 cordova.js添加的项目/ platforms / android / assets / www文件夹即可。您不需要在js文件中添加它。所以,只需在index.js文件中声明它,如下所示,

<script src="cordova.js"></script> 

答案 1 :(得分:0)

更改此

<script src="js/cordova.js"></script> 

 <script src="cordova.js"></script>