Error building android app

I am trying to build an android app using meteor and I getting the below error -

Checking Java JDK and Android SDK versions -
ANDROID_SDK_ROOT=C:\Users\User\AppData\Local\Android\Sdk (recommended setting)
ANDROID_HOME=C:\Users\User\AppData\Local\Android\Sdk (DEPRECATED)
Using Android SDK: C:\Users\User\AppData\Local\Android\Sdk
%% Reading build config file: D:\Projects\meteor\logic_mobile\logic.meteor\local\cordova-build\build.json
Reading build config file: D:\Projects\meteor\logic_mobile\logic.meteor\local\cordova-build\build.json
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.ova app for Android \

You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to Command-Line Interface Reference in the Gradle documentation.

BUILD SUCCESSFUL in 24s
1 actionable task: 1 executed
%% Subproject Path: CordovaLib
Subproject Path: CordovaLib Android \
%% Subproject Path: app
Subproject Path: appapp for Android
%% Gradle Distribution URL: https://services.gradle.org/distributions/gradle-7.1.1-all.zip
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
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/addon2/03 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/repository2/03 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/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/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 :CordovaLib:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Task :app:compileDebugJavaWithJavac FAILED
D:\Projects\meteor\logic_mobile\logic.meteor\local\cordova-build\platforms\android\app\src\main\java\com\flybuy\cordova\location\BackgroundLocationServicesPlugin.java:29: error: cannot access com.google.android.gms.location.DetectedActivity
import com.google.android.gms.location.DetectedActivity;
^ -
bad class file: C:\Users\User.gradle\caches\transforms-3\be4520a6645d2ec14d41c22c42c67ba7\transformed\jetified-play-services-location-21.2.0-api.jar(com/google/android/gms/location/DetectedActivity.class)
class file has wrong version 55.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.

FAILURE: Build failed with an exception.

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

Compilation failed; see the compiler error output for details.

  • 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See Command-Line Interface

BUILD FAILED in 1m 15s
46 actionable tasks: 46 executed
=> Errors executing Cordova commands:

While building Cordova app for platform Android:
Error: Command failed with exit code 1:
D:\Projects\meteor\logic_mobile\logic.meteor\local\cordova-build\platforms\android\gradlew
:app:bundleDebug -b
D:\Projects\meteor\logic_mobile\logic.meteor\local\cordova-build\platforms\android\build.gradle
at makeError
(C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\cordova-android\node_modules\execa\lib\error.js:60:11)
at handlePromise
(C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\cordova-android\node_modules\execa\index.js:118:26)
at runMicrotasks ()
at processTicksAndRejections
(internal/process/task_queues.js:95:5)
=> awaited here:
at Function.Promise.await
(C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:56:12)
at C:\tools\cordova\project.js:325:7
at
C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\fiber_pool.js:43:40
=> awaited here:
at Function.Promise.await
(C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:56:12)
at CordovaProject.runCommands
(C:\tools\cordova\project.js:896:22)
at CordovaProject.buildForPlatform
(C:\tools\cordova\project.js:323:10)
at C:\tools\cli\commands.js:1243:30
at Object.enterJob (C:\tools\utils\buildmessage.js:388:12)
at C:\tools\cli\commands.js:1226:22
at Object.capture (C:\tools\utils\buildmessage.js:283:5)
at Object.main.captureAndExit (C:\tools\cli\main.js:281:29)
at buildCommand (C:\tools\cli\commands.js:1201:10)
at C:\tools\cli\commands.js:988:25
at Function.run
(C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\tools\tool-env\tools\tool-env\profile.ts:289:14)
at C:\tools\cli\commands.js:986:18
at
C:\Users\User\AppData\Local.meteor\packages\meteor-tool\2.12.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\fiber_pool.js:43:40

Could anyone help me how to solve this problem?

try meteor reset , then run meteor run android

I did it so many times. But didn’t work. However, the problem was solved differently. Thanks for your response.

1 Like