之前将tf模型落地安卓了,其实就是clone一下官方的代码,然后配置下环境就打包了,没啥技术含量,现在再看,问题就在环境配置了。
1,Unable to start the daemon process. Q Group 277356808
The project uses Gradle 4.1 which is incompatible with Java 11 or newer.
Possible solution:升级,我就点这里了,然后第二个问题出来了
2,Cause: module java.base does not open java.lang to unnamed module @53aac487
这特么不是java里面的bug么??由于找不到哪里设置VM,这个思路作罢。
有相关博文说在build gradle里面设置classpath,版本改成3.1.4,3.0.0的已经太老了,
但仍旧出错,
08:44 Gradle sync failed: Cause: module java.base does not open java.lang to unnamed module @53aac487 (833 ms)
3,尝试修改jdk版本,降级,如下:
但出现了这个问题,
09:07 Gradle sync failed: The project is using an incompatible version (AGP 3.1.4) of the Android Gradle plugin. Minimum supported version is AGP 3.2.0.
好,按照上述2的修改方式,修改为3.2.0
多次sync后发现出现这个标志,点击选择环境版本,我随意选的,
只选择了下面的这个,其他没得选,没有选项啊。
再次sync后竟然Okay了,我擦,可以啊。BUILD SUCCESSFUL in 0s
但是下面的是错误还是warnings啊,如下:
The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.2) for Android Gradle Plugin 3.2.0.
Android SDK Build Tools 28.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Remove Build Tools version and sync project
Affected Modules: app
Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app
针对第一个问题,那我就升级为28.0.2呗,sync后解决,
第二个问题,就点击这里即可
就会直达影响的模块,人家写的说明很清楚,
然后修改后,调了下其他标记为红线的东西,但是这个版本不要调了
targetSdkVersion 28,改成其他高版本有新的错误出现,如下
新的错误(调高版本,不调则没有)
- Unsupported class file major version 55
make project时(🔨符号),还是会有上面一行错误,我擦,咋整啊
降低JDK为1.8,结果如下:
A problem occurred evaluating project ':app'.
> Could not find method compileSdk() for arguments [27] on object of
放弃,世上无难事,只要肯放弃。
重新在github上找来项目,make project后找不到apk安装包了,或者说还需要再打包??
需要,但在Mac客户端版本上没有找到生成apk的啊,在下面放大镜中搜
然后再日志(event log)中点击locate,也就是找到apk的意思
15:35 Build APK(s) Q group 277356808
APK(s) generated successfully for 1 module:
Module 'android.app': locate or analyze the APK.
4,之前见过有些java VM可以在xml里面设置,比如,Apache-spark中的项目。但对应在Android studio中我没找到能设置的xml。
愿我们终有重逢之时,而你还记得我们曾经讨论的话题