Android调试问题汇总

Android Studio 运行报错

Installation did not succeed.
The application could not be installed.

List of apks:
[0] '/Users/hh/Documents/androidProject/app-demo-android/app/build/outputs/apk/DEV/debug/app-DEV-debug.apk'
Installation failed due to: 'Failed to commit install session 790173464 with command cmd package install-commit 790173464. Error: -99'

重新看,有AndroidManifest.xml报错:

Permission is only granted to system apps:21
Permission is only granted to system apps:22
Permission is only granted to system apps:36
Mock locations should only be requested in a test or debug-specific manifest file (typically `src/debug/AndroidManifest.xml`)
Permission is only granted to system apps:44
`PayTimeOutActivity` must extend android.app.Activity
Gradle could not start your build.
> Cannot create service of type DefaultConfigurationCache using DefaultConfigurationCache constructor as there is a problem with parameter #10 of type ConfigurationCacheFingerprintController.
   > Cannot create service of type ConfigurationCacheFingerprintController using ConfigurationCacheFingerprintController constructor as there is a problem with parameter #5 of type FileCollectionFingerprinterRegistry.
      > Cannot create service of type FileCollectionFingerprinterRegistry using method VirtualFileSystemServices$BuildSessionServices.createFileCollectionFingerprinterRegistry() as there is a problem with parameter #1 of type List<FileCollectionFingerprinter>.
         > Could not create service of type CrossBuildFileHashCache using BuildSessionServices.createCrossBuildFileHashCache().
            > Failed to create parent directory '/.gradle' when creating directory '/.gradle/6.8/fileHashes'

* 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.
  • 处理:重启AS后,更新了一下Gradle,报错:
3:29 下午    Gradle sync failed: 
Could not resolve all dependencies for configuration ':app:DEVDebugRuntimeClasspath'.
Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://maven.aliyun.com/nexus/content/groups/public)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.0.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details. 

Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://maven.aliyun.com/nexus/content/groups/public)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.0.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.  (5 m 53 s 130 ms)
  • AS再次重启后,报错
Load error:undefined path variables
Gson is undefined
  • 处理:清理Mac Gradle下载目录
/Users/xxx/.gradle/wrapper/

目的:需要删掉后面建议更新的7.0.2版本,恢复使用之前的4.x.x(大概)版本。
原因:很有可能是更新Gradle未成功导致的。
结论:由于更新失败,导致后面即便重新启动AS,仍然会去做更新重试。

AS 运行apk,报错(adb安装)

11/26 08:57:21: Launching 'app' on OPPO PBAM00.
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_TEST_ONLY

List of apks:
[0] '/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/build/outputs/apk/DEV/debug/app-DEV-debug.apk'
Installation failed due to: 'Failed to commit install session 1204212033 with command cmd package install-commit 1204212033. Error: INSTALL_FAILED_TEST_ONLY'
Retry
  • 参考:
    同上adb安装,根据网上提供的解决方式并没有真正解决问题。

  • 结论:
    通过AS点击 Build ——> BuildAPK(s) 这样生成的app-debug.apk,就可以正常安装了。
    说明:由于暂时使用debug版本(非release版本),所以未配置签名。
    问题:安装成功后,启动apk,闪退。

  • 参考:https://www.cnblogs.com/yongfengnice/p/7814016.fhtml

AS编译release版本apk

  • 编译release版本,一般需要配置签名文件(比如keystore或jsk文件)

  • AS打签名包,失败

10:10 上午    Generate Signed APK: Errors while building APK. You can find the errors in the 'Messages' view.

Execution failed for task ':app:packageDEVRelease'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
   > com.android.ide.common.signing.KeytoolException: Failed to read key key from store "/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/appdemo-sign.jsk": Keystore was tampered with, or password was incorrect

Password verification failed
  • 结论:设置签名密码(app下的build.gradle进行配置)
  signingConfigs {
        appdemo {
            keyAlias 'key0'
            keyPassword 'apppwd'
            storeFile file('../appdemo-sign.jsk')
            storePassword 'apppwd'
        }
    }
  • AS签名apk,失败
No key with alias 'key' found in keystore /Users/hh/Documents/androidProject/app-demo-android/app-demo-android/appdemo-sign.jsk
  • 说明:需要设置alias key。

  • 重新生产debug apk,失败

Entry name 'assets/apps/H53779C1B/www/androidPrivacy.json' collided

apk启动闪退

  • 闪退报错:
E/PermissionCheck: permission check result is: 230
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.app.demo, PID: 19910
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/igexin/sdk/PushManager;
        at io.dcloud.feature.unipush.GTPushService.onStart(GTPushService.java:40)
        at io.dcloud.feature.aps.APSFeatureImpl.onStart(APSFeatureImpl.java:139)
        at io.dcloud.g.b.c.a(SourceFile:151)
        at io.dcloud.g.b.c.a(SourceFile:17)
        at io.dcloud.g.b.d.a(SourceFile:6)
        at io.dcloud.EntryProxy.onCreate(SourceFile:6)
        at io.dcloud.b.onRuntimeCreate(SourceFile:3)
        at io.dcloud.b$a.run(SourceFile:6)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:210)
        at android.app.ActivityThread.main(ActivityThread.java:7080)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:863)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.igexin.sdk.PushManager" on path: DexPathList[[zip file "/data/app/com.app.demo-qqR6-YWB835hUEOxOahCmg==/base.apk"],nativeLibraryDirectories=[/data/app/com.app.demo-qqR6-YWB835hUEOxOahCmg==/lib/arm, /data/app/com.app.demo-qqR6-YWB835hUEOxOahCmg==/base.apk!/lib/armeabi, /system/lib, /vendor/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at io.dcloud.feature.unipush.GTPushService.onStart(GTPushService.java:40) 
        at io.dcloud.feature.aps.APSFeatureImpl.onStart(APSFeatureImpl.java:139) 
        at io.dcloud.g.b.c.a(SourceFile:151) 
        at io.dcloud.g.b.c.a(SourceFile:17) 
        at io.dcloud.g.b.d.a(SourceFile:6) 
        at io.dcloud.EntryProxy.onCreate(SourceFile:6) 
        at io.dcloud.b.onRuntimeCreate(SourceFile:3) 
        at io.dcloud.b$a.run(SourceFile:6) 
        at android.os.Handler.handleCallback(Handler.java:790) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:210) 
        at android.app.ActivityThread.main(ActivityThread.java:7080)
        
E/UncaughtExceptionHandler: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/igexin/sdk/PushManager;
  • 原因:unipush添加后apk启动闪退原因:个推找不到PushManager。对比了dcloud_properties.xml文件后,发现有个push的配置导致apk启动闪退:由于项目在修改获取CID时(需要导入push一个遗漏的包),本地修改完后还没有上传代码。导致获取不到PushManager这个类。apk安装启动之后直接闪退。

  • 处理:

<feature name="Push" value="io.dcloud.feature.aps.APSFeatureImpl">
            <module name="unipush" value="io.dcloud.feature.unipush.GTPushService"/>
        </feature>
        <feature name="Push" value="io.dcloud.feature.aps.APSFeatureImpl"/>

AS找不到device(调试真机):No devices

  • 结论:
    很大原因应该还是gradle版本的问题,目前需要做APP的unipush,该工程的gradle版本为4.1.3.
    这边修改为4.1.2,正常了(文件为整个工程的build.gradle,而不是app下的build.gradle)。
classpath 'com.android.tools.build:gradle:4.1.2'

AS运行失败

Manifest merger failed : Attribute activity#io.dcloud.PandoraEntryActivity@configChanges value=(orientation|keyboardHidden|screenSize|mcc|mnc|fontScale|keyboard|smallestScreenSize|screenLayout|screenSize) from AndroidManifest.xml:260:13-144
    is also present at [:lib.5plus.base-release:] AndroidManifest.xml:64:13-92 value=(orientation|keyboardHidden|screenSize|mcc|mnc|fontScale).
    Suggestion: add 'tools:replace="android:configChanges"' to <activity> element at AndroidManifest.xml:257:9-272:20 to override.
  • 原因:引入库和主工程在AndroidManifest.xml中的configChanges属性重复且冲突了。
  • 处理:错误信息里已有处理方法。

AS: Apply changes and Restart Activity

AS 打包后安装失败

11/29 15:07:02: Launching 'app' on OPPO PBAM00.
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_CONFLICTING_PROVIDER

List of apks:
[0] '/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/build/outputs/apk/DEV/debug/app-DEV-debug.apk'
Installation failed due to: 'Failed to commit install session 1381574909 with command cmd package install-commit 1381574909. Error: INSTALL_FAILED_CONFLICTING_PROVIDER'

AS安装apk启动失败,报错

E/DCLoudApplicationImpl: mApplication--=com.app.demo.CustomApp@727ab2a
E/ANR_LOG: >>> msg's executing time is too long
    Blocked msg = { when=-2s39ms what=110 target=android.app.ActivityThread$H obj=AppBindData{appInfo=ApplicationInfo{4ac8eb8 com.app.demo}} } , cost  = 1984 ms
    >>>Current msg List is:
E/ANR_LOG: Current msg <1>  = { when=-2s33ms what=100 target=android.app.ActivityThread$H obj=ActivityRecord{b450491 token=android.os.BinderProxy@a76686 {com.app.demo/io.dcloud.PandoraEntry}} }
    Current msg <2>  = { when=-2s20ms what=101 target=android.app.ActivityThread$H obj=com.android.internal.os.SomeArgs@ced4ff6 }
    Current msg <3>  = { when=-1s515ms what=103 target=android.app.ActivityThread$H obj=com.android.internal.os.SomeArgs@dac2ff7 }
E/ANR_LOG: Current msg <4>  = { when=-1s515ms what=137 target=android.app.ActivityThread$H arg1=1 obj=android.os.BinderProxy@a76686 }
    Current msg <5>  = { when=-1s15ms what=137 target=android.app.ActivityThread$H obj=android.os.BinderProxy@a76686 }
    Current msg <6>  = { when=-1s3ms what=107 target=android.app.ActivityThread$H obj=com.android.internal.os.SomeArgs@8f7de64 }
    Current msg <7>  = { when=+9s801ms what=132 target=android.app.ActivityThread$H }
    >>>CURRENT MSG DUMP OVER<<<

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.app.demo, PID: 4741
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/baidu/mapapi/SDKInitializer

启动apk显示错误:未配置appkey或配置错误

  • 前提:这个是uniapp离线Android工程

  • 处理:
    1)需要更新AndroidManifest.xml里的dclound_appid
    2)需要更新manifest.json里的appid
    3)更新app/sr/assets/data下的dcloud_control.xml中的appid

编译报错

  • 更新离线AS资源包到uni-app,报错
> Task :app:processDEVDebugMainManifest FAILED
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml:63:5-81 Warning:
    Element uses-permission#android.permission.RECEIVE_BOOT_COMPLETED at AndroidManifest.xml:63:5-81 duplicated with element declared at AndroidManifest.xml:44:5-81
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml Error:
    uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [:oaid_sdk_1.0.25:] /Users/hh/.gradle/caches/transforms-2/files-2.1/765c90d5c90f00e1ae002201591ea531/jetified-oaid_sdk_1.0.25/AndroidManifest.xml as the library might be using APIs not available in 19
    Suggestion: use a compatible library with a minSdk of at most 19,
        or increase this project's minSdk version to at least 21,
        or use tools:overrideLibrary="com.bun.miitmdid" to force usage (may lead to runtime failures)
  • 处理:
    build.gradle中修改 minSdkVersion 19
    改为 minSdkVersion 21

  • 同上,修改后新的报错:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.app.demo, PID: 27936
    java.lang.UnsatisfiedLinkError: No implementation found for void io.dcloud.common.cs.DA.arn(java.lang.String, java.lang.Object) (tried Java_io_dcloud_common_cs_DA_arn and Java_io_dcloud_common_cs_DA_arn__Ljava_lang_String_2Ljava_lang_Object_2)
        at io.dcloud.common.cs.DA.arn(Native Method)
        at io.dcloud.common.cs.DA.ar(DA.java:50)
        at io.dcloud.feature.gg.dcloud.ADHandler.pull(SourceFile:21)
        at io.dcloud.feature.gg.dcloud.AdFeatureImpl.doForFeature(SourceFile:83)
        at io.dcloud.feature.gg.AdFeatureImplMgr.doForFeature(SourceFile:6)
        at io.dcloud.a.a(SourceFile:18)
        at io.dcloud.b.checkAndRequestStoragePermission(SourceFile:27)
        at io.dcloud.WebAppActivity.checkAndRequestStoragePermission(SourceFile:1)
        at io.dcloud.b$c.a(SourceFile:6)
        at io.dcloud.common.ui.b.a(SourceFile:329)
        at io.dcloud.b.onCreate(SourceFile:44)
        at io.dcloud.WebAppActivity.onCreate(SourceFile:24)
        at android.app.Activity.performCreate(Activity.java:7314)
        at android.app.Activity.performCreate(Activity.java:7305)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2959)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3084)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1781)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:210)
        at android.app.ActivityThread.main(ActivityThread.java:7080)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:863)
        
E/weex: [WXBridgeManager] invoke execJSService: framework.js uninitialized.
    [WXBridgeManager] invoke execJSService: framework.js uninitialized.
E/UncaughtExceptionHandler: java.lang.UnsatisfiedLinkError: No implementation found for void io.dcloud.common.cs.DA.arn(java.lang.String, java.lang.Object) (tried Java_io_dcloud_common_cs_DA_arn and Java_io_dcloud_common_cs_DA_arn__Ljava_lang_String_2Ljava_lang_Object_2)
  • 处理:配置了AndroidManifest.xml(apk启动白屏),还是报同样的错误。

  • 结论:
    如链接(https://github.com/apache/incubator-weex/issues/3013)提到,跨平台weex只支持armeabi-v7a, arm64-v8a and x86 但不支持armeabi。所以build.gradle针对ndk配置修改如下:

ndk {
//            abiFilters 'armeabi',
      abiFilters 'x86','armeabi-v7a'
  }

重新跑真机,没有出现上面的报错了。

-参考:
https://ask.dcloud.net.cn/question/122180

  • 同上,修改后报错:
E/DCloud_LOG: createWindow before _url=file:///storage/emulated/0/Android/data/com.app.demo/apps/__UNI__921542C/www/__uniappview.html
    createWindow after _url=file:///storage/emulated/0/Android/data/com.app.demo/apps/__UNI__921542C/www/__uniappview.html
E/chromium: [ERROR:devtools_http_handler.cc(249)] Cannot start http server for devtools. Stop devtools.

E/WebViewData: syncUpdateWebViewData url=null

E/Html5Plus-SplashClosed: 1638320609996
E/Main_Path: closeSplashScreen0 appid=__UNI__921542C;true;closeSplashDid=false

E/Html5Plus-onResume: 1638320991415
E/DCloudApplication: onTrimMemory

调整部分配置,仍然报错:

E/DCLoudApplicationImpl: mApplication--=com.app.demo.CustomApp@d851873
E/weex: [WXBridgeManager] invoke execJSService: framework.js uninitialized.

E/WXParams: setCrashFilePath: /data/user/0/com.app.demo/app_crash
E/weex: weexjss's Path is/data/app/com.app.demo-eNkeSFoU0QorYCCa4myftw==/lib/arm/libweexjss.so
E/weex: getUseSingleProcess is running false
E/WeexCore: params_utils.cpp:214,g_use_single_process is false 
E/weex: getReleaseMap:true
    getLibJscPath is running 
E/WeexCore: params_utils.cpp:258,g_jscSoPath is  
E/weex: getLibJssPath is running /data/app/com.app.demo-eNkeSFoU0QorYCCa4myftw==/lib/arm/libweexjss.so
E/WeexCore: params_utils.cpp:271,g_jssSoPath is /data/app/com.app.demo-eNkeSFoU0QorYCCa4myftw==/lib/arm/libweexjss.so 
E/WXParams: getCrashFilePath:/data/user/0/com.app.demo/app_crash
E/WeexCore: params_utils.cpp:283,g_crashFilePath is /data/user/0/com.app.demo/app_crash 
E/weex: getLibIcuPath is running /system/usr/icu/icudt58l.dat
E/WeexCore: params_utils.cpp:296,g_jssIcuPath is /system/usr/icu/icudt58l.dat 
E/weex: getLibJsbPath is running /data/user/0/com.app.demo/cache/cache/weex/libs/weexjsb/armeabi-v7a/libweexjsb.so
    getLibLdPath is running /data/app/com.app.demo-eNkeSFoU0QorYCCa4myftw==/lib/arm:/data/app/com.app.demo-eNkeSFoU0QorYCCa4myftw==/base.apk!/lib/armeabi-v7a
E/WeexCore: multi_process_and_so_initializer.cpp:38,MultiProcessAndSoInitializer IS IN init
    weex_js_connection.cpp:144,WeexJSConnection g_crashFileName: /data/user/0/com.app.demo/app_crash/crash_dump.log
E/WeexCore: weex_js_connection.cpp:264,startupPie :1
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.app.demo, PID: 18463
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.demo/io.dcloud.PandoraEntry}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.app.demo/io.dcloud.PandoraEntryActivity}; have you declared this activity in your AndroidManifest.xml?
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3006)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3084)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1781)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:210)
        at android.app.ActivityThread.main(ActivityThread.java:7080)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:863)
     Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.app.demo/io.dcloud.PandoraEntryActivity}; have you declared this activity in your AndroidManifest.xml?
        at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1940)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1618)
        at android.app.Activity.startActivityForResult(Activity.java:4711)
        at android.app.Activity.startActivityForResult(Activity.java:4641)
        at android.app.Activity.startActivity(Activity.java:5030)
        at android.app.Activity.startActivity(Activity.java:4998)
        at io.dcloud.PandoraEntry.onCreate(SourceFile:23)
        at android.app.Activity.performCreate(Activity.java:7314)
        at android.app.Activity.performCreate(Activity.java:7305)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2959)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3084) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1781) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:210) 
        at android.app.ActivityThread.main(ActivityThread.java:7080) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:863) 
E/TelephonyUtil: getIMEI exception==getDeviceId: Neither user 10172 nor current process has android.permission.READ_PHONE_STATE.
E/libc: Access denied finding property "net.dns1"

E/UncaughtExceptionHandler: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.demo/io.dcloud.PandoraEntry}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.app.demo/io.dcloud.PandoraEntryActivity}; have you declared this activity in your AndroidManifest.xml?

Android平台Widget集成使用wgt/wgtu升级说明

预编译器错误

  • 代码使用了scss/sass语言,但未安装相应的编译器插件,请前往插件市场安装该插件
https://ext.dcloud.net.cn/plugin?name=compile-node-sass at components/uni-icon/index.vue:1

App离线打包资源:全包libs更新,编译报错。

/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/java/com/app/plugins/Camera.java:9: 错误: 程序包com.blankj.utilcode.util不存在
import com.blankj.utilcode.util.ActivityUtils;
                               ^
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/java/com/app/plugins/Camera.java:10: 错误: 程序包com.huantansheng.easyphotos不存在
import com.huantansheng.easyphotos.EasyPhotos;
                                  ^
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/java/com/app/plugins/Camera.java:23: 错误: 找不到符号
        Activity activity = ActivityUtils.getTopActivity();
                            ^
  符号:   变量 ActivityUtils
  位置: 类 Camera
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/java/com/app/plugins/Camera.java:24: 错误: 找不到符号
        EasyPhotos.createCamera(activity, false)
        ^
  符号:   变量 EasyPhotos
  位置: 类 Camera

                               
                               import com.blankj.utilcode.util.ActivityUtils;
                               import com.huantansheng.easyphotos.EasyPhotos;
                               
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/java/com/app/demo/CustomApp.java:19: 错误: 找不到符号
                                                               MultiDex.install(this);
                                                               ^
                                                         符号:   变量 MultiDex
                                                         位置: 类 CustomApp
                                                         
                               import androidx.multidex.MultiDex;

/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/java/com/app/demo/EntryActivity.java:6: 错误: 程序包com.huantansheng.easyphotos不存在
import com.huantansheng.easyphotos.EasyPhotos;
                                  ^
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/java/com/app/demo/EntryActivity.java:7: 错误: 程序包com.huantansheng.easyphotos.models.album.entity不存在
import com.huantansheng.easyphotos.models.album.entity.Photo;
                                                      ^
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/java/com/app/demo/EntryActivity.java:20: 错误: 找不到符号
            ArrayList<Photo> resultPhotos = intent.getParcelableArrayListExtra(EasyPhotos.RESULT_PHOTOS);
                      ^
  符号:   类 Photo
  位置: 类 EntryActivity
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/java/com/app/demo/EntryActivity.java:20: 错误: 找不到符号
            ArrayList<Photo> resultPhotos = intent.getParcelableArrayListExtra(EasyPhotos.RESULT_PHOTOS);
                                                                               ^
  符号:   变量 EasyPhotos
  位置: 类 EntryActivity

                            import com.huantansheng.easyphotos.EasyPhotos;
                            import com.huantansheng.easyphotos.models.album.entity.Photo;
  • 处理:
    build.gradle的dependencis添加库依赖:
annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'
implementation 'com.github.HuanTanSheng:EasyPhotos:3.1.3'
implementation 'com.blankj:utilcodex:1.30.1'
  • 将新旧两部分libs库合并,库冲突报错:
-amap-libs-release-runtime (amap-libs-release.aar)
Duplicate class com.amap.api.maps.AMap$OnMultiPointClickListener found in modules jetified-amap-gp-libs-release-runtime (amap-gp-libs-release.aar) and jetified-amap-libs-release-runtime (amap-libs-release.aar)

Duplicate class com.baidu.android.bbalbs.common.a.a found in modules jetified-BaiduLBS_Android_base (BaiduLBS_Android_base.jar) and jetified-baidu-libs-release-runtime (baidu-libs-release.aar)

Duplicate class com.baidu.location.Address found in modules jetified-BaiduLBS_Android_geolocation_v7.1 (BaiduLBS_Android_geolocation_v7.1.jar) and jetified-baidu-libs-release-runtime (baidu-libs-release.aar)

Duplicate class com.baidu.mapapi.BMapManager found in modules jetified-BaiduLBS_Android_v4.3.1 (BaiduLBS_Android_v4.3.1.jar) and jetified-baidu-libs-release-runtime (baidu-libs-release.aar)

Duplicate class com.bun.miitmdid.core.ErrorCode found in modules jetified-msa_mdid_1.0.13-runtime (msa_mdid_1.0.13.aar) and jetified-oaid_sdk_1.0.25-runtime (oaid_sdk_1.0.25.aar)

Duplicate class com.dcloud.android.annotation.ColorInt found in modules jetified-lib.5plus.base-release-runtime (lib.5plus.base-release.aar) and jetified-pdr (pdr.jar)

...
  • 说明:
    升级之后的lib.5plus.base-release.aar包含了旧版本的多个库文件(比如pdr.jar,xhr.jar,share.jar,uploader.jar,my-nineoldandroids-2.4.0.jar,downloader.jar,geolocation-system.jar,geolocation.jar,gallery.jar,file.jar,camera.jar,invocation.jar,navigatorui.jar,nativeui.jar,ui.jar,sensor.jar,nopermission.jar,oauth.jar,audio.jar,device.jar,nativeObj.jar,my-imageloader.jar等)。

  • 注意:uniapp的SDK是包括所有的库文件,但是工程中并不需要所有的库,可以根据HBuilder-HelloUniApp的libs库来按需添加。
    另外,baidu-libs-release.aar这个文件在SDK和HBuilder-HelloUniApp的libs库对比貌似有一些不一样。
    不需要的库包括一些用不到的库,比如ads-360-release.aar。

  • 结论:刚开始接触uniapp不太熟悉。这里是更新HBuilder,从老的版本更新到3.2.16版本,刚开始以为需要合并两个版本下工程的库。后来发现并不需要:
    (1)新版本的基础库在原来版本上做了更新,甚至合并了若干个基础库。
    (2)\color{#FF0000}{直接使用新版本的libs库},除非是开发功能引入的库,则随功能迁移同步拷贝过来。

androistudio没有build

AS版本过低,需要升级

This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 4.1 or newer.

AS报错:Module not specified

权限:

android.permission.ACCESS_LOCATION_EXTRA_COMMANDS

gradle配置

zsh: command not found: gradle
gradle clean
gradle assembleAPPMASTERDebug
  • 报错:
> Task :app:processAPPMASTERDebugMainManifest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processAPPMASTERDebugMainManifest'.
> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @5e05d18
gradle assembleAPPMASTER

报错同上。

  • 尝试:
gradle APPMASTERDebug

报错:

FAILURE: Build failed with an exception.

* What went wrong:
Task 'APPMASTERDebug' is ambiguous in root project 'app-demo-android'. Candidates are: 'signAPPMASTERDebugBundle', 'signingConfigWriterAPPMASTERDebug', 'signingConfigWriterAPPMASTERDebugAndroidTest', 'stripAPPMASTERDebugDebugSymbols', 'stripAPPMASTERReleaseDebugSymbols'.

jsk keystore

Manifest merger问题

(1) Manifest merger问题1

 > Manifest merger failed with multiple errors, see logs

/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml:95:9-35 Error:
    Attribute application@allowBackup value=(true) from AndroidManifest.xml:95:9-35
    is also present at [elogin-1.3.0.0.aar] AndroidManifest.xml:18:9-36 value=(false).
    Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:93:5-376:19 to override.
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml:93:5-376:19 Error:
    tools:replace specified at line:93 for attribute android:name|android:allowBackup, but no new value specified
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml Error:
    Validation failed, exiting


/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml:95:9-36 Error:
    Attribute application@allowBackup value=(false) from AndroidManifest.xml:95:9-36
    is also present at [com.github.HuanTanSheng:EasyPhotos:3.1.3] AndroidManifest.xml:20:9-35 value=(true).
    Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:93:5-376:19 to override.
tools:replace="android:name|android:allowBackup"

(2) manifest merge 问题2

/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml:129:13-69 Error:
    Attribute provider#androidx.core.content.FileProvider@authorities value=(com.app.demo.dc.fileprovider) from AndroidManifest.xml:129:13-69
    is also present at [openDefault-10.10.0.aar] AndroidManifest.xml:64:13-64 value=(com.app.demo.fileprovider).
    Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:127:9-135:20 to override.
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml:134:17-53 Error:
    Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/rc_file_path) from AndroidManifest.xml:134:17-53
    is also present at [openDefault-10.10.0.aar] AndroidManifest.xml:69:17-50 value=(@xml/filepaths).
    Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml:132:13-134:56 to override.
  • 与元素类型 "provider" 相关联的 "tools:replace" 属性值不能包含 '<' 字符。

  • 原因:缺少双引号

工程报错:

/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/java/com/app/demo/wxapi/WXEntryActivity.java:7: 错误: 无法访问IWXAPIEventHandler
    public class WXEntryActivity extends AbsWXCallbackActivity{
           ^
  找不到com.tencent.mm.opensdk.openapi.IWXAPIEventHandler的类文件
  • 处理:
    添加如下lib库:
  implementation files('libs/tx_wx.jar')

APP合入支付SDK,报错:

Duplicate class com.tencent.mm.opensdk.channel.MMessageActV2 found in modules jetified-wechat-sdk-android-without-mta-5.5.8 (com.tencent.mm.opensdk:wechat-sdk-android-without-mta:5.5.8) and jetified-wechat-sdk-android-without-mta-6.7.9-runtime (wechat-sdk-android-without-mta-6.7.9.aar)

Go to the documentation to learn how to Fix dependency resolution errors.
  • 处理:同一个库不同版本,注释掉一个即可。

  • 修改后,报错:

> Task :app:processAPPMASTERDebugMainManifest FAILED
[geolocation-baidu-release.aar] /Users/hh/.gradle/caches/transforms-2/files-2.1/6f94fed06a294c37f80f1efca3d01b6e/jetified-geolocation-baidu-release/AndroidManifest.xml Warning:
    Package name 'io.dcloud.feature' used in: geolocation-baidu-release.aar, baidu-libs-release.aar, statistics-umeng-release.aar.
[androidx.vectordrawable:vectordrawable-animated:1.0.0] /Users/hh/.gradle/caches/transforms-2/files-2.1/a9725e7c1dd9c01390e43626e0dcaeb8/vectordrawable-animated-1.0.0/AndroidManifest.xml Warning:
    Package name 'androidx.vectordrawable' used in: androidx.vectordrawable:vectordrawable-animated:1.0.0, androidx.vectordrawable:vectordrawable:1.0.0.
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml Error:
    uses-sdk:minSdkVersion 21 cannot be smaller than version 22 declared in library [qmf-ppplugin-android-3.1.3.aar] /Users/hh/.gradle/caches/transforms-2/files-2.1/73c303ed90d2e6a051c883dfefdfc1a8/jetified-qmf-ppplugin-android-3.1.3/AndroidManifest.xml as the library might be using APIs not available in 21
    Suggestion: use a compatible library with a minSdk of at most 21,
        or increase this project's minSdk version to at least 22,
        or use tools:overrideLibrary="com.chinaums.pppay" to force usage (may lead to runtime failures)

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/build/intermediates/incremental/mergeAPPMASTERDebugResources/merged.dir/values-zh/values-zh.xml:30: warn: multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?.


Execution failed for task ':app:processAPPMASTERDebugMainManifest'.
> Manifest merger failed with multiple errors, see logs

* 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.
  • 处理:minSdkVersion需要从21改成22.

找不到库报错

2022-03-01 18:05:58.218 19867-19867/? W/DCloud_Exception: FeatureMgr.processEvent
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/tencent/weibo/sdk/android/api/util/Util;
        at io.dcloud.share.tencent.TencentWeiboApiManager.a(TencentWeiboApiManager.java:87)
        at io.dcloud.share.tencent.TencentWeiboApiManager.getJsonObject(TencentWeiboApiManager.java:125)
        at io.dcloud.share.a.a(SourceFile:240)
        at io.dcloud.share.a.a(SourceFile:110)
        at io.dcloud.share.ShareFeatureImpl.execute(SourceFile:1)
        at io.dcloud.i.b.a(SourceFile:141)
        at io.dcloud.i.b.b(SourceFile:3)
        at io.dcloud.i.b.processEvent(SourceFile:174)
        at io.dcloud.g.b.c.dispatchEvent(SourceFile:22)
        at io.dcloud.common.core.ui.l.processEvent(SourceFile:2)
        at io.dcloud.common.adapter.ui.AdaUniWebView.exec(SourceFile:7)
        at io.dcloud.common.adapter.ui.AdaUniWebView$1.execute(SourceFile:5)
        at io.dcloud.common.adapter.util.MessageHandler$1.handleMessage(SourceFile:3)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:210)
        at android.app.ActivityThread.main(ActivityThread.java:7080)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:863)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.tencent.weibo.sdk.android.api.util.Util" on path: DexPathList[[zip file "/data/app/com.app.demo-LC4jSPjuH-tcNhp2iRfqjA==/base.apk"],nativeLibraryDirectories=[/data/app/com.app.demo-LC4jSPjuH-tcNhp2iRfqjA==/lib/arm64, /data/app/com.app.demo-LC4jSPjuH-tcNhp2iRfqjA==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at io.dcloud.share.tencent.TencentWeiboApiManager.a(TencentWeiboApiManager.java:87) 
        at io.dcloud.share.tencent.TencentWeiboApiManager.getJsonObject(TencentWeiboApiManager.java:125) 
        at io.dcloud.share.a.a(SourceFile:240) 
        at io.dcloud.share.a.a(SourceFile:110) 
        at io.dcloud.share.ShareFeatureImpl.execute(SourceFile:1) 
        at io.dcloud.i.b.a(SourceFile:141) 
        at io.dcloud.i.b.b(SourceFile:3) 
        at io.dcloud.i.b.processEvent(SourceFile:174) 
        at io.dcloud.g.b.c.dispatchEvent(SourceFile:22) 
        at io.dcloud.common.core.ui.l.processEvent(SourceFile:2) 
        at io.dcloud.common.adapter.ui.AdaUniWebView.exec(SourceFile:7) 
        at io.dcloud.common.adapter.ui.AdaUniWebView$1.execute(SourceFile:5) 
        at io.dcloud.common.adapter.util.MessageHandler$1.handleMessage(SourceFile:3) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:210) 
        at android.app.ActivityThread.main(ActivityThread.java:7080) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:863) 
  • 处理:注释掉如下代码
<!--            <module name="Tencent" value="io.dcloud.share.tencent.TencentWeiboApiManager"/>-->
  • 原因:由于没有导入腾讯微博的库,所以在进入分享的时候,应该是在获取所有分享类型的时候因为找不到腾讯微博的库而导致崩溃(EXception),所以去掉这个,就正常了。

手机诊断:编译问题

> Task :app:processAPPMASTERDebugMainManifest FAILED
[geolocation-baidu-release.aar] /Users/hh/.gradle/caches/transforms-2/files-2.1/94915b3445101859241490dac3129786/jetified-geolocation-baidu-release/AndroidManifest.xml Warning:
    Package name 'io.dcloud.feature' used in: geolocation-baidu-release.aar, baidu-libs-release.aar, statistics-umeng-release.aar.
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml:68:5-81 Warning:
    Element uses-permission#android.permission.RECEIVE_BOOT_COMPLETED at AndroidManifest.xml:68:5-81 duplicated with element declared at AndroidManifest.xml:49:5-81
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml:104:5-105:47 Warning:
    Element uses-permission#android.permission.MOUNT_UNMOUNT_FILESYSTEMS at AndroidManifest.xml:104:5-105:47 duplicated with element declared at AndroidManifest.xml:21:5-84
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml:118:5-119:47 Warning:
    Element uses-permission#android.permission.WRITE_SETTINGS at AndroidManifest.xml:118:5-119:47 duplicated with element declared at AndroidManifest.xml:36:5-73
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml:64:13-64 Error:
    Attribute provider#androidx.core.content.FileProvider@authorities value=(com.app.demo.fileprovider) from [openDefault-10.10.0.aar] AndroidManifest.xml:64:13-64
    is also present at [com.rratchet.cloud.platform.strategy:core:9527.3.1-beta3] AndroidManifest.xml:321:13-64 value=(com.app.demo.fileProvider).
    Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:62:9-70:20 to override.
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml:415:17-61 Error:
    Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/filepaths) from AndroidManifest.xml:415:17-61
    is also present at [com.rratchet.cloud.platform.strategy:core:9527.3.1-beta3] AndroidManifest.xml:326:17-51 value=(@xml/file_paths).
    Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.

add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.
Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/filepaths) from AndroidManifest.xml:417:17-61
 <provider
        android:name="io.dcloud.common.util.DCloud_FileProvider"
        android:authorities="com.app.demo.dc.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true"
        tools:replace="android:authorities"
        >
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/dcloud_file_provider"
            tools:replace="android:resource"
            />
    </provider>

    <provider
        android:name="androidx.core.content.FileProvider"
        android:authorities="com.app.demo.dc.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true"
        tools:replace="android:authorities">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/rc_file_path"
            tools:replace="android:resource"/>
    </provider>

诊断问题:

2022-03-12 22:37:13.906 26057-26117/com.app.demo E/InvProxy: NativeObject.execMethod login method ; params=class com.app.demo.diagnosis.DiagnosisUtiljava.lang.reflect.InvocationTargetException

腾云云点播:上传视频,问题

* What went wrong:
Execution failed for task ':app:compileAPPMASTERDebugJavaWithJavac'.
> Could not resolve all files for configuration ':app:APPMASTERDebugCompileClasspath'.
   > Could not find cos-android-nobeacon-5.8.3.jar (com.qcloud.cos:cos-android-nobeacon:5.8.3).
     Searched in the following locations:
         http://maven.aliyun.com/nexus/content/groups/public/com/qcloud/cos/cos-android-nobeacon/5.8.3/cos-android-nobeacon-5.8.3.jar
The specified Android SDK Build Tools version (28.0.3) is ignored, as it is below the minimum supported version (29.0.2) for Android Gradle Plugin 4.1.3.

Could not HEAD 'https://dl.bintray.com/tencentqcloudterminal/maven/androidx/appcompat/appcompat/1.0.0/appcompat-1.0.0.pom'. Received status code 502 from server: Bad Gateway
Disable Gradle 'offline mode' and sync project

Build file '/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/build.gradle' line: 4

A problem occurred evaluating project ':app'.
> No signature of method: build_8qj6fh0xisyg7xeumv86vorg1.android() is applicable for argument types: (build_8qj6fh0xisyg7xeumv86vorg1$_run_closure1) values: [build_8qj6fh0xisyg7xeumv86vorg1$_run_closure1@1b889eb]

Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/java/com/app/demo/videoupload/impl/TXUGCPublishOptCenter.java:8: 错误: 程序包android.support.annotation不存在
import android.support.annotation.NonNull;
                                ^

Android通过maven导入库文件最终下载到哪里去了

获取位置信息,崩溃

E/UncaughtExceptionHandler: java.lang.RuntimeException: Unable to resume activity {com.app.demo/com.app.demo.EntryActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.location.LocationManager.isProviderEnabled(java.lang.String)' on a null object reference
  • 原因:处理逻辑的地方,locationManager还没有初始化。

miniSdkVersion问题

> Task :app:processAPPMASTERDebugMainManifest FAILED
[amap-libs-release.aar] /Users/hh/.gradle/caches/transforms-2/files-2.1/edc5c860c2a2578a1d9fd3c7cc32f913/jetified-amap-libs-release/AndroidManifest.xml Warning:
    Package name 'io.dcloud.feature' used in: amap-libs-release.aar, statistics-umeng-release.aar.
[androidx.vectordrawable:vectordrawable-animated:1.0.0] /Users/hh/.gradle/caches/transforms-2/files-2.1/a9725e7c1dd9c01390e43626e0dcaeb8/vectordrawable-animated-1.0.0/AndroidManifest.xml Warning:
    Package name 'androidx.vectordrawable' used in: androidx.vectordrawable:vectordrawable-animated:1.0.0, androidx.vectordrawable:vectordrawable:1.0.0.
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml Error:
    uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [oaid_sdk_1.0.25.aar] /Users/hh/.gradle/caches/transforms-2/files-2.1/765c90d5c90f00e1ae002201591ea531/jetified-oaid_sdk_1.0.25/AndroidManifest.xml as the library might be using APIs not available in 19
    Suggestion: use a compatible library with a minSdk of at most 19,
        or increase this project's minSdk version to at least 21,
        or use tools:overrideLibrary="com.bun.miitmdid" to force usage (may lead to runtime failures)


> Task :app:processAPPMASTERReleaseMainManifest FAILED
[amap-libs-release.aar] /Users/hh/.gradle/caches/transforms-2/files-2.1/edc5c860c2a2578a1d9fd3c7cc32f913/jetified-amap-libs-release/AndroidManifest.xml Warning:
    Package name 'io.dcloud.feature' used in: amap-libs-release.aar, statistics-umeng-release.aar.
[androidx.vectordrawable:vectordrawable-animated:1.0.0] /Users/hh/.gradle/caches/transforms-2/files-2.1/a9725e7c1dd9c01390e43626e0dcaeb8/vectordrawable-animated-1.0.0/AndroidManifest.xml Warning:
    Package name 'androidx.vectordrawable' used in: androidx.vectordrawable:vectordrawable-animated:1.0.0, androidx.vectordrawable:vectordrawable:1.0.0.
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml Error:
    uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library [qmf-ppplugin-android-3.1.3.aar] /Users/hh/.gradle/caches/transforms-2/files-2.1/73c303ed90d2e6a051c883dfefdfc1a8/jetified-qmf-ppplugin-android-3.1.3/AndroidManifest.xml as the library might be using APIs not available in 19
    Suggestion: use a compatible library with a minSdk of at most 19,
        or increase this project's minSdk version to at least 22,
        or use tools:overrideLibrary="com.chinaums.pppay" to force usage (may lead to runtime failures)
        

> Task :app:processDEVDebugMainManifest FAILED
[androidx.vectordrawable:vectordrawable-animated:1.0.0] /Users/hh/.gradle/caches/transforms-2/files-2.1/0ef88a736b402cd1fdd5321cb8048d86/vectordrawable-animated-1.0.0/AndroidManifest.xml Warning:
    Package name 'androidx.vectordrawable' used in: androidx.vectordrawable:vectordrawable-animated:1.0.0, androidx.vectordrawable:vectordrawable:1.0.0.
/Users/hh/Documents/androidProject/app-demo-android/app-demo-android/app/src/main/AndroidManifest.xml Error:
    uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [:appafclib] /Users/hh/Documents/androidProject/app-demo-android/app-demo-android/appafclib/build/intermediates/library_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 19
    Suggestion: use a compatible library with a minSdk of at most 19,
        or increase this project's minSdk version to at least 21,
        or use tools:overrideLibrary="com.app.afc" to force usage (may lead to runtime failures)
  • 处理:
    AndroidManifest.xml中与权限同级添加:
    <uses-sdk tools:overrideLibrary="com.bun.miitmdid, com.chinaums.pppay"></uses-sdk>

adb无线调试

Android 应用未安装

安卓4.4安装apk显示:应用未安装

老版APP:启动失败

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.app.demo, PID: 14630
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/igexin/sdk/PushManager;
        at io.dcloud.feature.unipush.GTPushService.onStart(GTPushService.java:40)
        at io.dcloud.feature.aps.APSFeatureImpl.onStart(APSFeatureImpl.java:139)
        at io.dcloud.g.b.c.a(SourceFile:151)
        at io.dcloud.g.b.c.a(SourceFile:17)
        at io.dcloud.g.b.d.a(SourceFile:6)
        at io.dcloud.EntryProxy.onCreate(SourceFile:6)
        at io.dcloud.b.onRuntimeCreate(SourceFile:3)
        at io.dcloud.b$a.run(SourceFile:6)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:210)
        at android.app.ActivityThread.main(ActivityThread.java:7080)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:863)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.igexin.sdk.PushManager" on path: DexPathList[[zip file "/data/app/com.app.demo-rHTvoxxXLVvEEsGjzH0vhw==/base.apk"],nativeLibraryDirectories=[/data/app/com.app.demo-rHTvoxxXLVvEEsGjzH0vhw==/lib/arm, /data/app/com.app.demo-rHTvoxxXLVvEEsGjzH0vhw==/base.apk!/lib/armeabi, /system/lib, /vendor/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at io.dcloud.feature.unipush.GTPushService.onStart(GTPushService.java:40) 
        at io.dcloud.feature.aps.APSFeatureImpl.onStart(APSFeatureImpl.java:139) 
        at io.dcloud.g.b.c.a(SourceFile:151) 
        at io.dcloud.g.b.c.a(SourceFile:17) 
        at io.dcloud.g.b.d.a(SourceFile:6) 
        at io.dcloud.EntryProxy.onCreate(SourceFile:6) 
        at io.dcloud.b.onRuntimeCreate(SourceFile:3) 
        at io.dcloud.b$a.run(SourceFile:6) 
        at android.os.Handler.handleCallback(Handler.java:790) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:210) 
        at android.app.ActivityThread.main(ActivityThread.java:7080) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:863) 
  • 处理:
implementation files('libs/gtsdk-3.2.2.0.aar')
  • 编译问题:
AAPT: error: resource android:attr/dialogCornerRadius not found.

编译问题:

Execution failed for task ':app:checkAPPMASTERDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.0.0-runtime (androidx.core:core:1.0.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
  • 处理:
    support的v4包和compat(27.1.1)有重复的类

  • 运行错误:

2022-05-31 09:22:40.106 3338-3338/com.app.demo E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.app.demo, PID: 3338
    java.lang.UnsatisfiedLinkError: No implementation found for void io.dcloud.common.cs.DA.arn(java.lang.String, java.lang.Object) (tried Java_io_dcloud_common_cs_DA_arn and Java_io_dcloud_common_cs_DA_arn__Ljava_lang_String_2Ljava_lang_Object_2)

老版本:编译报错

Unable to start the daemon process.
The project uses Gradle 4.4 which is incompatible with Java 11 or newer.
Possible solution:
 - Upgrade Gradle wrapper to 4.8 version and re-import the project

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> java.lang.NullPointerException (no error message)

路径:Preferences找到Gradle配置。
Gradle JDK配置默认为Android Studio default JDK version 11.0.12/Applications/Android Studio.app/Contents/jrc/Contents/home
由于这里是APP老版本,最低支持Android4.4,所以Gradle JDK需要选择11 version 11.0.12/Applications/Android Studio.app/Contents/jrc/Contents/home

  • 问题:
Minimum supported Gradle version is 6.5. Current version is 4.4.

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,271评论 5 476
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,275评论 2 380
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,151评论 0 336
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,550评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,553评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,559评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,924评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,580评论 0 257
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,826评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,578评论 2 320
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,661评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,363评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,940评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,926评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,156评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,872评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,391评论 2 342

推荐阅读更多精彩内容