Android開發(fā)錯(cuò)誤集

1.

Error:Execution failed for task ':app:mergeDebugResources'

Error:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException:

這個(gè)問題是Android打包的時(shí)候出現(xiàn)的問題:原因是你的某些圖片格式不對(duì)(例如:1.強(qiáng)轉(zhuǎn)圖片格式:jpg強(qiáng)轉(zhuǎn)成png, png強(qiáng)轉(zhuǎn)成jpg等。 2. 圖片命名不對(duì),圖片一般命名為 stamp_icon.png).

2.

Error:A problem occurred configuring root project 'rootman'.
Could not resolve all dependencies for configuration ':classpath'.
Timeout waiting to lock artifact cache (/Users/xxxx/.gradle/caches/modules-2). It is currently in use by another Gradle instance.
Owner PID: 78970
Our PID: 85378
Owner Operation:
Our operation:
Lock file: /Users/xxxx/.gradle/caches/modules-2/modules-2.lock

Error:A problem occurred configuring root project 'rootman'.
Timeout waiting to lock jars (/Users/xxxx/.gradle/caches/jars-2). It is currently in use by another Gradle instance.
Owner PID: 78970
Our PID: 85717
Owner Operation:
Our operation:
Lock file: /Users/xxxx/.gradle/caches/jars-2/jars-2.lock

出現(xiàn)上面兩種情況(當(dāng)前是Mac電腦,所以文件路徑是這樣的),
解決辦法:在這個(gè) /Users/xxxx/.gradle/caches/文件夾下刪除 重復(fù)的jars,例如會(huì)出現(xiàn) jars-1、jars-2,這種的。

3

Error:Could not create service of type FileCollectionSnapshotterRegistry using TaskExecutionServices.createFileCollectionSnapshotterRegistry().
Could not create service of type CachingFileHasher using TaskExecutionServices.createFileSnapshotter().

解決辦法: Android Studio -> File -> Invalidate Caches and Restart

4

0/ com. xxx. xxxx E/JavaBinder: !U! FAILED BINDER TRANSACTION !U! (parcel size = 554788)
java.lang.Runt imeException: android.os.Transact ionTooLargeException data parcel size 554788 bytes


QQ20180825-110411.png

QQ20180825-110434.png

出現(xiàn)上面兩種錯(cuò)誤情況:1), Intent傳參超過1M,一般超過1M大部分傳圖片了,或者很多字符串,2), 從當(dāng)前頁分享,或者其他跳出A客戶端到B客戶端的行為,跳出A客戶端之后A客戶端奔潰,說明A客戶端的當(dāng)前頁內(nèi)容過多,已超出系統(tǒng)對(duì)A客戶端可緩存內(nèi)容的界限。
解決辦法:檢查A客戶端當(dāng)前頁面數(shù)據(jù)吧

5

Error:Could not create service of type FileCollectionSnapshotterRegistry using TaskExecutionServices.createFileCollectionSnapshotterRegistry().
Could not create service of type CachingFileHasher using TaskExecutionServices.createFileSnapshotter().

解決辦法:刪除項(xiàng)目根目錄下的 .gradle文件

6

當(dāng)前環(huán)境:
Android Studio 3.4
buildToolsVersion = "28.0.3"
buildToolsVersion = "28.0.3"
classpath 'com.android.tools.build:gradle:3.3.0'
distributionUrl=https://services.gradle.org/distributions/gradle-4.10.2-all.zip
react native 0.59.9

問題:

AndroidRuntime: FATAL EXCEPTION: mqt_native_modules

java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/util/Pools$SynchronizedPool;
    at com.facebook.imagepipeline.platform.PlatformDecoderFactory.buildPlatformDecoder(PlatformDecoderFactory.java:30)
    at com.facebook.imagepipeline.core.ImagePipelineFactory.getPlatformDecoder(ImagePipelineFactory.java:304)
    at com.facebook.imagepipeline.core.ImagePipelineFactory.getPlatformBitmapFactory(ImagePipelineFactory.java:296)
    at com.facebook.imagepipeline.core.ImagePipelineFactory.getAnimatedFactory(ImagePipelineFactory.java:159)
    at com.facebook.imagepipeline.core.ImagePipelineFactory.getImageDecoder(ImagePipelineFactory.java:219)
    at com.facebook.imagepipeline.core.ImagePipelineFactory.getProducerFactory(ImagePipelineFactory.java:319)
    at com.facebook.imagepipeline.core.ImagePipelineFactory.getProducerSequenceFactory(ImagePipelineFactory.java:350)
    at com.facebook.imagepipeline.core.ImagePipelineFactory.getImagePipeline(ImagePipelineFactory.java:276)
    at com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilderSupplier.<init>(PipelineDraweeControllerBuilderSupplier.java:51)
    at com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilderSupplier.<init>(PipelineDraweeControllerBuilderSupplier.java:42)
    at com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilderSupplier.<init>(PipelineDraweeControllerBuilderSupplier.java:35)
    at com.facebook.drawee.backends.pipeline.Fresco.initializeDrawee(Fresco.java:79)
    at com.facebook.drawee.backends.pipeline.Fresco.initialize(Fresco.java:72)
    at com.facebook.drawee.backends.pipeline.Fresco.initialize(Fresco.java:44)
    at com.facebook.react.modules.fresco.FrescoModule.initialize(FrescoModule.java:105)
    at com.facebook.react.bridge.ModuleHolder.doInitialize(ModuleHolder.java:223)
    at com.facebook.react.bridge.ModuleHolder.markInitializable(ModuleHolder.java:98)
    at com.facebook.react.bridge.NativeModuleRegistry.notifyJSInstanceInitialized(NativeModuleRegistry.java:102)
    at com.facebook.react.bridge.CatalystInstanceImpl$2.run(CatalystInstanceImpl.java:405)
    at android.os.Handler.handleCallback(Handler.java:790)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
    at android.os.Looper.loop(Looper.java:192)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232)
    at java.lang.Thread.run(Thread.java:764)
解決辦法:

這個(gè)問題在我這邊是為因:
implementation 'com.facebook.fresco:animated-gif:2.0.0'
這個(gè)依賴的問題,將這個(gè)依賴改為下面這樣就好
implementation 'com.facebook.fresco:animated-gif:1.10.0'

------(未完待續(xù))

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容