Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error run android device #30154

Open
ilsanto17 opened this issue Jan 24, 2025 · 2 comments
Open

error run android device #30154

ilsanto17 opened this issue Jan 24, 2025 · 2 comments
Labels

Comments

@ilsanto17
Copy link

When I try to run my android application on real and virtual device I get this error.

capacitor run android --target Pixel_8_Pro_API_35
[capacitor] ✔ Copying web assets from www to android/app/src/main/assets/public in 26.01ms
[capacitor] ✔ Creating capacitor.config.json in android/app/src/main/assets in 449.29μs
[capacitor] [info] Inlining sourcemaps
[capacitor] ✔ copy android in 35.57ms
[capacitor] ✔ Updating Android plugins in 2.08ms
[capacitor] [info] Found 4 Capacitor plugins for android:
[capacitor]        @capacitor/[email protected]
[capacitor]        @capacitor/[email protected]
[capacitor]        @capacitor/[email protected]
[capacitor]        @capacitor/[email protected]
[capacitor] ✔ update android in 34.52ms
[capacitor] ✖ Running Gradle build - failed!
[capacitor] [error] 
[capacitor]         > Configure project :app
[capacitor]         WARNING: Using flatDir should be avoided because it doesn't support any meta-data formats.
[capacitor]         
[capacitor]         > Configure project :capacitor-cordova-android-plugins
[capacitor]         WARNING: Using flatDir should be avoided because it doesn't support any meta-data formats.
[capacitor]         
[capacitor]         > Task :app:preBuild UP-TO-DATE
[capacitor]         > Task :app:preDebugBuild UP-TO-DATE
[capacitor]         > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
[capacitor]         > Task :capacitor-android:preBuild UP-TO-DATE
[capacitor]         > Task :capacitor-android:preDebugBuild UP-TO-DATE
[capacitor]         > Task :app:javaPreCompileDebug
[capacitor]         > Task :capacitor-app:preBuild UP-TO-DATE
[capacitor]         > Task :capacitor-app:preDebugBuild UP-TO-DATE
[capacitor]         > Task :capacitor-cordova-android-plugins:preBuild UP-TO-DATE
[capacitor]         > Task :capacitor-cordova-android-plugins:preDebugBuild UP-TO-DATE
[capacitor]         > Task :capacitor-haptics:preBuild UP-TO-DATE
[capacitor]         > Task :capacitor-haptics:preDebugBuild UP-TO-DATE
[capacitor]         > Task :capacitor-keyboard:preBuild UP-TO-DATE
[capacitor]         > Task :capacitor-keyboard:preDebugBuild UP-TO-DATE
[capacitor]         > Task :capacitor-cordova-android-plugins:writeDebugAarMetadata
[capacitor]         > Task :capacitor-app:writeDebugAarMetadata
[capacitor]         > Task :capacitor-haptics:writeDebugAarMetadata
[capacitor]         > Task :capacitor-android:writeDebugAarMetadata
[capacitor]         > Task :capacitor-status-bar:preBuild UP-TO-DATE
[capacitor]         > Task :capacitor-status-bar:preDebugBuild UP-TO-DATE
[capacitor]         > Task :capacitor-keyboard:writeDebugAarMetadata
[capacitor]         > Task :capacitor-status-bar:writeDebugAarMetadata
[capacitor]         > Task :app:generateDebugResValues
[capacitor]         > Task :capacitor-android:generateDebugResValues
[capacitor]         > Task :app:checkDebugAarMetadata
[capacitor]         > Task :capacitor-android:generateDebugResources
[capacitor]         > Task :capacitor-android:packageDebugResources
[capacitor]         > Task :capacitor-app:generateDebugResValues
[capacitor]         > Task :capacitor-app:generateDebugResources
[capacitor]         > Task :capacitor-app:packageDebugResources
[capacitor]         > Task :capacitor-cordova-android-plugins:generateDebugResValues
[capacitor]         > Task :capacitor-cordova-android-plugins:generateDebugResources
[capacitor]         > Task :capacitor-cordova-android-plugins:packageDebugResources
[capacitor]         > Task :capacitor-haptics:generateDebugResValues
[capacitor]         > Task :capacitor-haptics:generateDebugResources
[capacitor]         > Task :capacitor-haptics:packageDebugResources
[capacitor]         > Task :capacitor-keyboard:generateDebugResValues
[capacitor]         > Task :capacitor-keyboard:generateDebugResources
[capacitor]         > Task :capacitor-keyboard:packageDebugResources
[capacitor]         > Task :capacitor-status-bar:generateDebugResValues
[capacitor]         > Task :capacitor-status-bar:generateDebugResources
[capacitor]         > Task :capacitor-status-bar:packageDebugResources
[capacitor]         > Task :app:mapDebugSourceSetPaths
[capacitor]         > Task :app:generateDebugResources
[capacitor]         > Task :app:packageDebugResources
[capacitor]         > Task :app:createDebugCompatibleScreenManifests
[capacitor]         > Task :app:extractDeepLinksDebug
[capacitor]         > Task :capacitor-android:extractDeepLinksDebug
[capacitor]         > Task :capacitor-app:extractDeepLinksDebug
[capacitor]         > Task :capacitor-cordova-android-plugins:extractDeepLinksDebug
[capacitor]         > Task :capacitor-haptics:extractDeepLinksDebug
[capacitor]         > Task :capacitor-keyboard:extractDeepLinksDebug
[capacitor]         > Task :capacitor-status-bar:extractDeepLinksDebug
[capacitor]         > Task :app:parseDebugLocalResources
[capacitor]         > Task :capacitor-haptics:processDebugManifest
[capacitor]         > Task :capacitor-status-bar:processDebugManifest
[capacitor]         > Task :capacitor-app:processDebugManifest
[capacitor]         > Task :capacitor-cordova-android-plugins:processDebugManifest
[capacitor]         > Task :capacitor-android:processDebugManifest
[capacitor]         > Task :capacitor-keyboard:processDebugManifest
[capacitor]         > Task :app:mergeDebugResources
[capacitor]         > Task :capacitor-android:compileDebugLibraryResources
[capacitor]         > Task :app:processDebugMainManifest
[capacitor]         > Task :app:processDebugManifest
[capacitor]         > Task :app:processDebugManifestForPackage
[capacitor]         > Task :capacitor-android:parseDebugLocalResources
[capacitor]         > Task :capacitor-app:compileDebugLibraryResources
[capacitor]         > Task :capacitor-app:parseDebugLocalResources
[capacitor]         > Task :capacitor-cordova-android-plugins:compileDebugLibraryResources
[capacitor]         > Task :capacitor-haptics:compileDebugLibraryResources
[capacitor]         > Task :capacitor-cordova-android-plugins:parseDebugLocalResources
[capacitor]         > Task :capacitor-keyboard:compileDebugLibraryResources
[capacitor]         > Task :capacitor-haptics:parseDebugLocalResources
[capacitor]         > Task :capacitor-keyboard:parseDebugLocalResources
[capacitor]         > Task :capacitor-status-bar:compileDebugLibraryResources
[capacitor]         > Task :capacitor-haptics:generateDebugRFile
[capacitor]         > Task :capacitor-cordova-android-plugins:generateDebugRFile
[capacitor]         > Task :capacitor-android:generateDebugRFile
[capacitor]         > Task :capacitor-app:generateDebugRFile
[capacitor]         > Task :capacitor-keyboard:generateDebugRFile
[capacitor]         > Task :capacitor-android:javaPreCompileDebug
[capacitor]         > Task :capacitor-app:javaPreCompileDebug
[capacitor]         > Task :capacitor-status-bar:parseDebugLocalResources
[capacitor]         > Task :capacitor-android:compileDebugJavaWithJavac FAILED
[capacitor]         [Incubating] Problems report is available at: file:///Users/utente/app/testAppUnity/android/build/reports/problems/problems-report.html
[capacitor]         
[capacitor]         FAILURE: Build failed with an exception.
[capacitor]         
[capacitor]         * What went wrong:
[capacitor]         Execution failed for task ':capacitor-android:compileDebugJavaWithJavac'.
[capacitor]         > error: invalid source release: 21
[capacitor]         
[capacitor]         * Try:
[capacitor]         > Run with --stacktrace option to get the stack trace.
[capacitor]         > Run with --info or --debug option to get more log output.
[capacitor]         > Run with --scan to get full insights.
[capacitor]         > Get more help at https://help.gradle.org.
[capacitor]         
[capacitor]         BUILD FAILED in 4s
[capacitor]         69 actionable tasks: 69 executed
[capacitor]         
[ERROR] An error occurred while running subprocess capacitor.
        
        capacitor run android --target Pixel_8_Pro_API_35 exited with exit code 1.
        
        Re-running this command with the --verbose flag may provide more information.

I can't solve it in any way. Do you have any ideas?

@ionitron-bot ionitron-bot bot added the triage label Jan 24, 2025
@JulienLecoq
Copy link

I think that this issue should be posted on the Capacitor repo rather than this one.

@omysn
Copy link

omysn commented Jan 29, 2025

@ilsanto17 make sure you're suing >=21 jdk
Update to the 21 version solved the issue for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants