我在Android上运行的Ionic/ with项目一直有问题。试图解决一个与新安装的节点,角钢,Ionic,Android工作室,新项目从Ionic (标签)。
我还是跑不开,我被困在上面两天了。我现在得到以下错误。
npx cap run android --stacktrace --info
√ Copying web assets from www to android\app\src\main\assets\public in 3.40s
√ Creating capacitor.config.json in android\app\src\main\assets in 3.15ms
√ copy android in 3.48s
√ Updating Android plugins in 10.59ms
[info] Found 4 Capacitor plugins for android:
@capacitor/app@1.0.3
@capacitor/haptics@1.0.3
@capacitor/keyboard@1.0.3
@capacitor/status-bar@1.0.3
√ update android in 148.19ms
× Running Gradle build - failed!
[error] WARNING:: Using flatDirs should be avoided because it doesn't support any meta-data formats.
Currently detected usages:
- repository flatDir used in: project ':capacitor-cordova-android-plugins'
WARNING:: Please remove usages of `jcenter()` Maven repository from your build scripts and
migrate your build to other Maven repositories.
This repository is deprecated and it will be shut down in the future.
See http://developer.android.com/r/tools/jcenter-end-of-service for more information.
Currently detected usages in: project ':capacitor-android', project ':capacitor-app', project ':capacitor-cordova-android-plugins', ...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns
http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns
http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns
http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns
http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns
http://schemas.android.com/sdk/android/repo/sys-img2/01
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :capacitor-android:preBuild UP-TO-DATE
> Task :capacitor-android:preDebugBuild UP-TO-DATE
> Task :capacitor-android:compileDebugAidl NO-SOURCE
> Task :capacitor-app:preBuild UP-TO-DATE
> Task :capacitor-app:preDebugBuild UP-TO-DATE
> Task :capacitor-app:compileDebugAidl NO-SOURCE
> Task :capacitor-cordova-android-plugins:preBuild UP-TO-DATE
> Task :capacitor-cordova-android-plugins:preDebugBuild UP-TO-DATE
> Task :capacitor-cordova-android-plugins:compileDebugAidl NO-SOURCE
> Task :capacitor-haptics:preBuild UP-TO-DATE
> Task :capacitor-haptics:preDebugBuild UP-TO-DATE
> Task :capacitor-haptics:compileDebugAidl NO-SOURCE
> Task :capacitor-keyboard:preBuild UP-TO-DATE
> Task :capacitor-keyboard:preDebugBuild UP-TO-DATE
> Task :capacitor-keyboard:compileDebugAidl NO-SOURCE
> Task :capacitor-status-bar:preBuild UP-TO-DATE
> Task :capacitor-status-bar:preDebugBuild UP-TO-DATE
> Task :capacitor-status-bar:compileDebugAidl NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :capacitor-android:packageDebugRenderscript NO-SOURCE
> Task :capacitor-app:packageDebugRenderscript NO-SOURCE
> Task :capacitor-cordova-android-plugins:packageDebugRenderscript NO-SOURCE
> Task :capacitor-haptics:packageDebugRenderscript NO-SOURCE
> Task :capacitor-keyboard:packageDebugRenderscript NO-SOURCE
> Task :capacitor-status-bar:packageDebugRenderscript NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :capacitor-android:writeDebugAarMetadata UP-TO-DATE
> Task :capacitor-app:writeDebugAarMetadata UP-TO-DATE
> Task :capacitor-haptics:writeDebugAarMetadata UP-TO-DATE
> Task :capacitor-keyboard:writeDebugAarMetadata UP-TO-DATE
> Task :capacitor-status-bar:writeDebugAarMetadata UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :capacitor-cordova-android-plugins:writeDebugAarMetadata
> Task :app:processDebugGoogleServices FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See
https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings
10 actionable tasks: 2 executed, 8 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> No matching client found for package name 'io.ionic.starter'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
我能看到的问题是它所引用的电容-cordova-android文件夹正在每次构建中重建,尽管根build.gradle和app build.gradle已经做了错误中列出的更改。用这个把我的头发拔出来。
帮助感激!
发布于 2021-09-09 09:18:39
我目前正在做一个离子/角度项目,我和你犯了同样的错误。我所做的:
https://stackoverflow.com/questions/69048376
复制相似问题