博客

7月服务器升级公告

因近期用户数和设备数暴增,服务器出现请求瓶颈,导致核心服务响应迟缓,影响了大量用户正常使用我们的服务,该影响可能会持续到7月12日24时。对此我们万分抱歉,目前我们已增加服务器资源,优化缓存策略,着力解决该问题。

点灯科技

7月12日

cordova-android报错

使用Cordova-android@9.1.0时,编译报错:

> Task :app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ‘:app:mergeDebugResources’.
> This project uses AndroidX dependencies, but the ‘android.useAndroidX’ property is not enabled. Set this property to true in the
gradle.properties file and retry.

直接修改gradle.properties中的配置不行,再次编译又会被还原。

解决办法:

在config.xml的 <platform name=”android”>中添加:

<preference name=”AndroidXEnabled” value=”true” />

开源规则引擎

 

https://github.com/CacheControl/json-rules-engine

https://github.com/vinzdeveloper/json-rule-editor

ionic/cordova 编译android app卡在> Task :app:preDebugBuild

原因就是因为maven源被强了。

解决办法:

将相关源改成阿里的

在andoid项目文件夹下查找“repositories {”,将其中内容替换为:

maven{url ‘https://maven.aliyun.com/repository/public’}
maven{url ‘https://maven.aliyun.com/repository/google’}
maven{url ‘https://maven.aliyun.com/repository/gradle-plugin’}

discuzX3.4数据迁移

discuz编辑器使用bbcode渲染出HTML,以下是找到的几个可以解析bbcode的程序:

https://github.com/samclarke/SCEditor

https://github.com/jordandelozier/wysibb

https://github.com/JiLiZART/bbob

cordova-android编译报错

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:mergeReleaseResources’.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.0-5013011-windows Daemon #1: Unexpected error during compile ‘E:\Git\blinker-app\platforms\android\app\src\main\res\drawable-port-xxxhdpi\screen.png’, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.

  • Try: FAILED
    20 actionable tasks: 18 executed, 2 up-to-date

Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output. Run with –scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s
Exception in thread “ForkJoinPool.commonPool-worker-13” java.lang.IllegalStateException: AAPT Process manager cannot be shut down while daemons are in use
at com.android.builder.internal.aapt.v2.Aapt2DaemonManager.shutdown(Aapt2DaemonManager.kt:96)
at com.android.build.gradle.internal.res.namespaced.RegisteredAaptService.shutdown(Aapt2DaemonManagerService.kt:61)
at com.android.build.gradle.internal.workeractions.WorkerActionServiceRegistry$shutdownAllRegisteredServices$1$1.run(WorkerActionServiceRegistry.kt:96)
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
E:\Git\blinker-app\platforms\android\gradlew: Command failed with exit code 1 Error output:
ע: E:\Git\blinker-app\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.javaʹ�û?����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:mergeReleaseResources’.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.0-5013011-windows Daemon #1: Unexpected error during compile ‘E:\Git\blinker-app\platforms\android\app\src\main\res\drawable-port-xxxhdpi\screen.png’, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.

  • Try:
    Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output. Run with –scan to get full insights.
  • Get more help at https://help.gradle.org

BUILD FAILED in 3s
Exception in thread “ForkJoinPool.commonPool-worker-13” java.lang.IllegalStateException: AAPT Process manager cannot be shut down while daemons are in use
at com.android.builder.internal.aapt.v2.Aapt2DaemonManager.shutdown(Aapt2DaemonManager.kt:96)
at com.android.build.gradle.internal.res.namespaced.RegisteredAaptService.shutdown(Aapt2DaemonManagerService.kt:61)
at com.android.build.gradle.internal.workeractions.WorkerActionServiceRegistry$shutdownAllRegisteredServices$1$1.run(WorkerActionServiceRegistry.kt:96)
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
[ERROR] An error occurred while running subprocess cordova.

    cordova.cmd build android --release exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.

一个解释:

java – com.android.builder.internal.aapt.v2.Aapt2InternalException – Stack Overflow

简单说就是gradle插件的bug,新版本已经修复。注意gradle插件不是gradle,其版本对应关系见:

Android Gradle 插件版本说明  |  Android 开发者  |  Android Developers (google.cn)

修改android项目下的build.gradle可以指定gradle插件版本

classpath 'com.android.tools.build:gradle:3.3.3'