设置Project Structure:
SDK
NDK
搜索快捷键:
Ctr+N
Ctr+Shift+N
cannot start internal http server
关闭代理Proxifier.-
Gradle sync failed: NDK not configured.
下载NDK
File>Settings> Appearance & Behavior > System Settings > Android SDK>SDK Tools>勾选NDK>Apply armeabi is no longer supported. Use armeabi-v7a.
armeabi > armeabi-v7a
文件 | 代码 | 修改 |
---|---|---|
app/build.gradle | abiFilters "armeabi" | abiFilters "armeabi-v7a", "x86" |
build.gradle.cmake | abiFilters "armeabi" | abiFilters "armeabi-v7a", "x86" |
|
https://blog.csdn.net/yin1031468524/article/details/79888063
-
更新gradle
-
Could not find method leftShift()
因为在gradle 5中task << 已经过时,所以去掉<<即可
代码task apolloFlag <<
改为task apolloFlat
https://blog.csdn.net/jincheng_921/article/details/85053986
- 找不到文件
生成android资源
切换到目录:trunk\client\build\android
空白处右键:选个Git bash here
命令行输入: ./build.sh --res-only
windows下执行sh脚本的方法:安装Git.
参考:https://blog.csdn.net/wml00000/article/details/83622474
-
java.io.IOException: com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing plugin com.android.tools.ndk
java.lang.OutOfMemoryError: Java heap space
关闭plugin :
然后调整堆栈大小:
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
http://08643.cn/p/a79290d48caa D:\DevelopKit\AndroidSdk\sdk_download\cmake\3.6.4111459\bin\cmake.exe with arguments {--build E:\RedGame\RedGame\trunk\client\cocos\frameworks\runtime-src\proj.android-studio\app.externalNativeBuild\cmake\demoDebug\armeabi-v7a --target cocos2dlua}
分析是其他报错导致的,所以先解决其他报错
- error: 'register' storage class specifier is deprecated and incompatible with C++17
在文件头加入
// -------------------Modify Start---------------------
// by chris @2019.7.26
// 解决register报错
#if __cplusplus > 199711L
#define register // Deprecated in C++11.
#endif // #if __cplusplus > 199711L
// ---------------------Modify End --------------------
参考:# Turning off the “'register' storage class specifier is deprecated” warning
error: lambda capture 'this' is not used
GCC警告当做Error处理导致的问题。
找到Android.mk文件,打开删除-Werror即可解决。
找到CMakeList.txt文件,删除-Werror.
【Android编译error】error: lambda capture 'this' is not used [-Werror]
GCC 警告选项 -Werror-
warning: unused label 'tolua_lerror' [-Wunused-label]
注释掉相应的代码:lua_xml_http_request.cpp:313
-
ninja: build stopped: .
ERROR: ABIs [armeabi] are not supported for platform. Supported ABIs are [arm64-v8a, armeabi-v7a, x86, x86_64].
Build command failed.
Error while executing process D:\DevelopKit\AndroidSdk\sdk_download\cmake\3.6.4111459\bin\cmake.exe with arguments {--build E:\RedGame\RedGame\trunk\client\cocos\frameworks\runtime-src\proj.android-studio\app.externalNativeBuild\cmake\demoDebug\armeabi-v7a --target cocos2dlua}
[1/817] Linking CXX static library GameApp\libremovelogic.a
[2/817] Building CXX object cocos/CMakeFiles/luacocos2d.dir/b2e284451482cbd05053b02fc4e398cd/lua-bindings/manual/Cocos2dxLuaLoader.cpp.o
[3/817] Building CXX object cocos/CMakeFiles/luacocos2d.dir/35600884a4486dc47964713d1f1ff2d7/scripting/lua-bindings/manual/CCLuaStack.cpp.o
[4/817] Building CXX object cocos/CMakeFiles/luacocos2d.dir/35600884a4486dc47964713d1f1ff2d7/scripting/lua-bindings/manual/CCLuaValue.cpp.o
[5/817] Building CXX object cocos/CMakeFiles/luacocos2d.dir/b2e284451482cbd05053b02fc4e398cd/lua-bindings/manual/LuaBasicConversions.cpp.o
[6/817] Building CXX object cocos/CMakeFiles/luacocos2d.dir/b2e284451482cbd05053b02fc4e398cd/lua-bindings/manual/lua_module_register.cpp.o
[7/817] Building CXX object cocos/CMakeFiles/luacocos2d.dir/35600884a4486dc47964713d1f1ff2d7/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp.o
[8/817] Building CXX object cocos/CMakeFiles/luacocos2dandroid.dir/E_/RedGame/RedGame/trunk/client/cocos/frameworks/cocos2d-x/cocos/scripting/lua-bindings/manual/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp.o
ninja: build stopped: .
ninja: error: FindFirstFileExA(e:/redgame/redgame/trunk/client/cocos/frameworks/runtime-src/proj.android-studio/app/libs/armeabi-v7a): ????????Ч??
ninja: error: FindFirstFileExA(e:/redgame/redgame/trunk/client/cocos/frameworks/runtime-src/proj.android-studio/app/libs/armeabi-v7a): ????????Ч??
ninja: error: FindFirstFileExA(e:/redgame/redgame/trunk/client/cocos/frameworks/runtime-src/proj.android-studio/app/libs/armeabi-v7a): ????????Ч??
ninja: error: FindFirstFileExA(e:/redgame/redgame/trunk/client/cocos/frameworks/runtime-src/proj.android-studio/app/libs/armeabi-v7a): ????????Ч??
ninja: error: FindFirstFileExA(e:/redgame/redgame/trunk/client/cocos/frameworks/runtime-src/proj.android-studio/app/libs/armeabi-v7a): ????????Ч??
ninja: error: FindFirstFileExA(e:/redgame/redgame/trunk/client/cocos/frameworks/runtime-src/proj.android-studio/app/libs/armeabi-v7a): ????????Ч??
ninja: error: mkdir(cocos/CMakeFiles/luacocos2dandroid.dir/E_/RedGame/RedGame/trunk/client/cocos/frameworks/cocos2d-x/cocos/scripting/lua-bindings): No such file or directory
- 将trunk\client\cocos\frameworks\runtime-src\proj.android-studio\app\libs\armeabi文件夹复制一份,改名为armeabi-v7a
- 错误核心点:Error while executing process cmake.exe --target cocos2dlua
1> 思路:单独执行cmake cocos2dlua.cmake 脚本
2>下载:cmake【https://cmake.org/download/】
3> 执行:cocos2dlua.cmake脚本。
4> 切换目录至trunk\client\cocos\frameworks\runtime-src\proj.android-studio\app\cmake\cocos
5> 右键空白处,选择在此处打开命令窗口,命令行输入cmake -P cocos2dlua.cmake
参考:https://juejin.im/post/5a73eba75188257a64266c15 - 然后还是找不到哪里的问题?
-
NDK版本换回r14b。
android-ndk-r14b-windows-x86_64
-
Gradle版本回退至4.6。
File-Project Structure
OK.
ninja: error: mkdir(cocos/CMakeFiles/luacocos2dandroid.dir/E_/RedGame/RedGame/trunk/client/cocos/frameworks/cocos2d-x/cocos/scripting/lua-bindings): No such file or directory
路径有问题Unsupported Modules Detected: Compilation is not supported for following modules
关闭Android Studio ,去项目根目录删除.idea文件,重启AS搞定
参考:启动项目出现unsupported modules detecte-
Installation failed with message 'pm install-create -r -t -S 294619457' returns error 'UNSUPPORTED'.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.
这里真的是太坑,关闭小米手机中的“启用MIUI优化”就好了,好了好了!
小米手机设置->开发者选项->启用MIUI优化,取消勾选。
解决小米手机Android Studio安装app 报错的问题It is possible that this issue is resolved by uninstalling an existi -
The CMAKE_C_COMPILER: D:/DevelopKit/AndroidNdk/AndroidNDK/android-ndk-r14b/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe is not a full path to an existing compiler tool.
NDK路径有误,Android Studio记录了一个之前的无效路径。
-
Error:Unsupported method: BaseConfig.getApplicationIdSuffix().
解决:找到build.gradle文件,将其中的classpath改为:3.0.0以上
buildscript
{
repositories {jcenter()}
dependencies {classpath 'com.android.tools.build:gradle:1.3.0'}
}
更改为:
buildscript
{
repositories {jcenter()}
dependencies {classpath 'com.android.tools.build:gradle:3.0.0'}
}
-
Sync failed:Connection timed out: connect
打开代理Proxifier软件.
参考:Proxifier使用教程 -
Gradle sync failed:Protocol family unavailable
还记得Error2中打开了代理吗?就是Proxifier,关了它。
下载相应的gradle版本,比如gradle3.4-rc-2-all.zip,把压缩包直接复制到C:\Users\chrisguo.gradle\wrapper\dists文件夹下,然后重启Android Studio即可.
http://services.gradle.org/distributions/ Unable to locate adb
我们使用的sdk是mac版本,缺少windows版本需要的adb.exe等文件
https://blog.csdn.net/qq_26626967/article/details/77848483
原因:找不到adb.exe文件
解决方法:安装Android SDK Platform-Tools,勾选Android SDK Platform-Tools. 点击Apply.
-
File>Settings>Android SDK > SDK Update Sites > Force https:
-
Missing System image .
-
Cannot start internal HTTP server. Git integration, JavaScript debugger and LiveEdit may operate with errors. Please check your firewall settings and restart Android Studio.
https://stackoverflow.com/questions/19889503/android-studio-cannot-start-internal-http-server