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
参考:
https://blog.csdn.net/albb_/article/details/89670130
https://blog.csdn.net/blackei/article/details/79497606
https://stackoverflow.com/questions/66783279/android-studio-error-activity-must-extend-android-app-activity
https://stackoverflow.com/questions/68899665/error-mainactivity-must-extend-android-app-activity-instantiatable
https://www.freesion.com/article/153598403/结论:在Run/Debug Configuration下添加了Gradle Task命令,如下:
:app:installDebug再参考:
https://blog.csdn.net/u011374875/article/details/51956070
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,闪退。
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
结论:删掉build文件夹下apk,然后重新点击运行,正常。
参考:
https://blog.csdn.net/qq_41811438/article/details/98376666
https://blog.csdn.net/qq_31433709/article/details/104825187
https://blog.csdn.net/Sunxiaolin2016/article/details/91403929
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"/>
- 参考:
https://jingyan.baidu.com/article/5552ef479ad552518efbc96f.html
https://www.jianshu.com/p/852fc4b004ed?from=groupmessage
https://blog.csdn.net/zhao8856234/article/details/79958867
https://blog.csdn.net/encienqi/article/details/7834900
https://blog.csdn.net/w05980598/article/details/54580951
https://blog.csdn.net/u014452224/article/details/50058417?locationNum=13&fps=1
https://ask.dcloud.net.cn/question/84662
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'
- 参考:
https://blog.csdn.net/weixin_33757609/article/details/91392302
https://blog.csdn.net/u012229449/article/details/109566160
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上运行按钮旁边的功能按钮,可以执行热更新。
- 参考:
https://blog.csdn.net/wdx_1136346879/article/details/103039104
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'
参考:
https://blog.csdn.net/sinat_29235897/article/details/53432982
https://www.jianshu.com/p/ca86dcd095f7表现:
真机调试APP内部版本时,错误显示:安装失败
与“APP“存在不兼容,无法同时安装原因:由于APP内部版本是从APP移植过来的基础上再修改的,可能有些地方没有剔除干净或者没有替换过来,导致配置冲突了。
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
处理:Build-- Clean Project,重新编译。
参考:
https://blog.csdn.net/mr_jianrong/article/details/72640899
启动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.
- 参考:
https://www.jianshu.com/p/63649895a7d5?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation
https://github.com/apache/incubator-weex/issues/3013
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
参考:
https://blog.csdn.net/u012124438/article/details/53401663同上,修改启动Activity,报错:
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?
- 原因:重复继承了父类
- 参考:
https://blog.csdn.net/Doreen12138/article/details/105025070/
Android平台Widget集成使用wgt/wgtu升级说明
预编译器错误
- 代码使用了scss/sass语言,但未安装相应的编译器插件,请前往插件市场安装该插件
https://ext.dcloud.net.cn/plugin?name=compile-node-sass at components/uni-icon/index.vue:1
处理:
重新编译后,发布了一份App离线资源。并且在HBuilderX上真机调试正常。参考:
https://blog.csdn.net/zhouqiping/article/details/108410431
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),除非是开发功能引入的库,则随功能迁移同步拷贝过来。
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
结论:
没按照参考的处理。直接重启了AS,然后没有打开历史记录上的项目,而是从已有的项目打开,然后让它重新配置了一下项目。正常了。参考:
https://blog.csdn.net/l18848956739/article/details/88369004
权限:
android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
gradle配置
zsh: command not found: gradle
参考:
https://blog.csdn.net/sweetzhangxue/article/details/75419452处理:添加gradle的bin文件到PATH环境变量配置中。
尝试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
参考:
https://www.jianshu.com/p/0fb17278f1bc
https://blog.csdn.net/wujt8888/article/details/107001824尝试如下(Jenkins打包语句)
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'.
参考:
https://blog.csdn.net/ribs0714/article/details/78752562
https://www.jianshu.com/p/0fb17278f1bc
https://blog.csdn.net/wujt8888/article/details/107001824初步分析,应该是版本太高导致的,目前项目中使用的版本为4.1.2.或者4.1.3,而gradle打包使用的是6.5版本。
jsk keystore
- 参考:jsk keystore相互转换
https://blog.csdn.net/qq_20451879/article/details/116718682
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.
- 已经为元素 "application" 指定绑定到名称空间 "http://schemas.android.com/tools" 的属性 "replace"。
- 处理:
tools:replace="android:name|android:allowBackup"
- 参考:
https://blog.csdn.net/ezview_uniview/article/details/55251881
https://www.cnblogs.com/hbolin/p/11126726.html
http://blog.shijiusui.com/archives/1053
(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.
参考:
https://blog.csdn.net/cpcpcp123/article/details/84882373?spm=1001.2101.3001.6650.5&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-5.pc_relevant_paycolumn_v3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-5.pc_relevant_paycolumn_v3
https://www.cnblogs.com/dubo-/p/8660377.html
https://stackoverflow.com/questions/43140059/add-toolsreplace-androidvalue-to-meta-data-element-at-androidmanifest
https://www.jianshu.com/p/486932ad15f6重点参考:
https://blog.csdn.net/qq_36670483/article/details/115603427
Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/filepaths) from AndroidManifest.xml:417:17-61
再参考:
https://blog.csdn.net/rikkatheworld/article/details/112234530最终处理:
参考APP和APP内部版(注意:第二个是从APP配置里复制过来的):配置如下:
<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
处理:在AndroidManifest.xml里添加Activity
参考:
https://blog.csdn.net/weixin_42547014/article/details/106526987
腾云云点播:上传视频,问题
* 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;
^
参考:
https://blog.csdn.net/zhao_liwei/article/details/52240581最终处理:
由于已经迁移到mavenCntal,所以不需要填写maven地址url。
把老的工程迁移过来的maven的url都注释掉,然后采用官方文档中自动配置的即可。
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>
- 参考:
https://blog.csdn.net/qq_40544338/article/details/118222562
https://www.jianshu.com/p/00988ee75fd6
https://blog.csdn.net/Maiduoudo/article/details/83000069
https://blog.csdn.net/lyabc123456/article/details/80995128
https://oomake.com/question/12171366
https://blog.csdn.net/jian11058/article/details/116939016
adb无线调试
- 参考:
https://blog.csdn.net/yuemingxingxing/article/details/105655967
https://wenku.baidu.com/view/edcd84d8f405cc1755270722192e453610665b12.html
Android 应用未安装
安卓4.4安装apk显示:应用未安装
- 参考:
http://www.manongjc.com/article/62476.html
https://www.it610.com/article/1289181681214889984.htm
https://www.taptap.com/topic/3819416
https://www.52pojie.cn/forum.php?mod=viewthread&tid=1136160
https://blog.csdn.net/weixin_42509513/article/details/117554755
老版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.
参考:
https://blog.csdn.net/jiongxian1/article/details/124466816处理:
修改compileSdkVersion从26到29
编译问题:
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)
参考:
https://blog.csdn.net/FDoubleman/article/details/73530609处理:
去掉这些修改,仅更改Gradle的版本配置
老版本:编译报错
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)
参考:
https://blog.csdn.net/y2345699/article/details/121400323
https://blog.csdn.net/m0_65511195/article/details/122148195处理:
更改Gradle对应的JDK版本,如下:
https://blog.csdn.net/m0_65511195/article/details/122148195
路径: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.