How to workaround autoomitting fiiles/folders starting with “_” (underscore) in assets folder

此生再无相见时 提交于 2019-12-17 19:46:12

问题


I want to deploy PhoneGap app on the Android simulator provided with eclipse. I decided to use Dojo Toolkit which heavily relies on the " _ " convention (starting a file/folder with " _ " means this is a private/internal module).

Basically the problem is that while deploying the app, every file/folder starting with "_" is omitted. This completely messes things up, Dojo toolkit as exptected fails to work.

Is there a way to fix this?


回答1:


First go star this issue so Google will fix the bug eventually. If you are running on Mac or Linux there is a patched aapt that fixes the bug here. Other than that your only choice is to do a build of Dojo so that it is only in one file.




回答2:


aaptOptions{
    ignoreAssetsPattern  '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}

add the above lines in the application build.gradle file inside android block for android app




回答3:


From the previous answer I ended making changes on ant.properties which is located at root of project with this:

aapt.ignore.assets=!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~

Here, I overwrote aapt.ignore.assets property defined on sdk-android directory. It works




回答4:


A work around is to use dojo.js from the CDN

<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dojo/dojo.js"></script>

Also, I started looking for a minify app or service, which could create a single file from all the required dojo files, but did not find one easily.




回答5:


For any Dojo developers out there, or anyone having issues with this in general.

What fixed it for me in Android Studio is opening the build.gradle, then adding to the android block:

android {
    compileSdkVersion 26

    ...

    aaptOptions {
        ignoreAssetsPattern '!._'
    }
}


来源:https://stackoverflow.com/questions/9206117/how-to-workaround-autoomitting-fiiles-folders-starting-with-underscore-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!