cocos 编译 apk 出错 resove to a path with no project.properties

打包andriod 时,出现编译错误,现象如下:

这里写图片描述
找到D:\Cgywin\home\game_proj\client_buer\cocos2d\cocos\platform\android\java 目录,发现没有project.properties文件,替换 编译目录(D:\Cgywin\home\game_proj\client_buer\proj.android)下的project.properties文件,
内容如下

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.

# Project target.
target=android-19
android.library.reference.1=../cocos2d/cocos/platform/android/java

顺便替换local.properties文件,内容如下:

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.

# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=C:\\Program Files (x86)\\Android\\android-sdk

接着开始编译,发现还是错误, 咳咳,好多java xxx 啥的错误,晕倒,应该是有问题,
上网找了 resove to a path with no project.properties file for project ,

1、 把project.properties 文件修改下 把 android.library.reference.1=../cocos2d/cocos/platform/android/java 替换成android.library=false

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.

# Project target.
target=android-19

#android.library.reference.1=../cocos2d/cocos/platform/android/java
android.library=false

2、 Stackoverflow 上说 可能是因为 android.library路径和project路径不是在同一盘符(window)!,我这个貌似是在同一目录下,pass
3、 有的网友说要把obj目录删除在试试,结果还是不行;
4、 没法了,去原先能编译的目录拷贝这两个文件试试,结果,就,就可以了,咳咳
如下,其实就是把project.properties改成android.library=true

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-19

android.library=true

local.properties改成如下(事实证明其实这个文件没有也没关系)

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.

# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=D:\\workspace\\android\\android-sdk-windows
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值