我正在创建一个以 Android 为目标的项目,我希望它附带一个 .json 文件,从中加载一些数据。
我将 .json 文件放入 Android 文件夹。运行“ tns run android --device 1 ”(这是我的物理设备)时,我得到:
-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found new input file
[aapt] Generating resource IDs...
[aapt] invalid resource directory name: /Users/konrad/Desktop/NativeScript/hello-world/platforms/android/res res
[aapt] invalid resource directory name: /Users/konrad/Desktop/NativeScript/hello-world/platforms/android/res small.json
BUILD FAILED
/usr/local/Cellar/android-sdk/24.3.3/tools/ant/build.xml:649: The following error occurred while executing this line:
/usr/local/Cellar/android-sdk/24.3.3/tools/ant/build.xml:694: null returned: 1
Total time: 0 seconds
Command ant failed with exit code 1
该文件名为small.json
编辑:即使我删除了文件,问题仍然存在。