com.android.support:support-v4 搞事情

原创
2018/03/09 20:05
阅读数 1W

这是一个 com.android.support:support-v4 包不合适的错误

phonegap-plugin-barcodescanner 为例。diners-barcodescanner.gradle 文件里面 compile 'com.android.support:support-v4:+' 改为 compile 'com.android.support:support-v4:27+' 应该能好。

Android 目录下面 project.properties 里面也有类似配置。但是一般改插件里面的比较好吧。

➜  A git:(master) ✗ cordova build android
CHCP plugin after prepare hook:
    config-file set to http://.../www/chcp.json
ANDROID_HOME=/Users/felix/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
    at build_3j0awvevr86fmrv4tdel4mctj.run(/.../platforms/android/build.gradle:143)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
... 省略 ...
:processDebugManifest UP-TO-DATE
:processDebugResourcesERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.564 secs
(node:31458) UnhandledPromiseRejectionWarning: Error: /.../platforms/android/gradlew: Command failed with exit code 1 Error output:
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    at ChildProcess.whenDone (/.../platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
    at ChildProcess.emit (events.js:159:13)
    at maybeClose (internal/child_process.js:943:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
(node:31458) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:31458) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


➜  A git:(master) ✗ cordova build android
CHCP plugin after prepare hook:
    config-file set to http://.../www/chcp.json
ANDROID_HOME=/Users/felix/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
    at build_3j0awvevr86fmrv4tdel4mctj.run(/.../platforms/android/build.gradle:143)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
... 省略 ...
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 18.579 secs
Built the following apk(s):
    /.../platforms/android/build/outputs/apk/android-debug.apk

展开阅读全文
打赏
0
1 收藏
分享
加载中
郭大鹏博主

引用来自“remainer”的评论

为这个村错编译不了项目我头疼了一天
我难受了2小时……我是不是很厉害。
2018/03/10 14:26
回复
举报
为这个村错编译不了项目我头疼了一天
2018/03/10 14:00
回复
举报
哈哈哈,Android p发布引发的惨案
2018/03/09 21:03
回复
举报
更多评论
打赏
3 评论
1 收藏
0
分享
返回顶部
顶部