korlibs / korge

KorGE Game Engine. Multiplatform Kotlin Game Engine
https://korge.org/
Other
2.54k stars 125 forks source link

BundleDebugAar not found in project :android. #355

Open Kesanov opened 3 years ago

Kesanov commented 3 years ago

Running gradlew bundleAndroid --info fails with

Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.
Parsed shrinker version: 2.0.88

> Task :bundleAndroid FAILED
Caching disabled for task ':bundleAndroid' because:
  Build cache is disabled
Task ':bundleAndroid' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
Analytics other plugin to proto: Unknown plugin type org.gradle.api.plugins.JvmEcosystemPlugin expected enum ORG_GRADLE_API_PLUGINS_JVMECOSYSTEMPLUGIN
Analytics other plugin to proto: Unknown plugin type org.gradle.api.plugins.JavaBasePlugin$Inject expected enum ORG_GRADLE_API_PLUGINS_JAVABASEPLUGIN$INJECT
Analytics other plugin to proto: Unknown plugin type org.jetbrains.kotlin.gradle.internal.AndroidSubplugin expected enum ORG_JETBRAINS_KOTLIN_GRADLE_INTERNAL_ANDROIDSUBPLUGIN
:bundleAndroid (Thread[Execution worker for ':',5,main]) completed. Took 0.271 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Task 'bundleDebugAar' not found in project ':android'. Some candidates are: 'bundleDebug'.

* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --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 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s
soywiz commented 3 years ago

I think I need more context to understand this. This is androidDirect or androidIndirect mode? That gradlew is being executed on the root folder or in build/platforms/android?

Kesanov commented 3 years ago

It's executed in the root folder with targetAll (same thing happens with android indirect).

Kesanov commented 3 years ago

I am getting the same issue with the game 2048 - issue https://github.com/RezMike/2048/issues/4

soywiz commented 3 years ago

Can you share a zip with a project reproducing it? Which operating system are you using? Which version of korge plugin are you using? (The one at gradle.properties) Anything else relevant to reproduce? Is runAndroidDebug in the root folder not working for you?:

gradlew runAndroidDebug
Kesanov commented 3 years ago

The zip is here: https://www.transfernow.net/dl/202103311dl3EJUV I am on Windows10 with gradle 6.8 and korge-gradle-plugin:2.0.9.1. runAndroidDebug fails with same message as installAndroidDebug, the message I am getting is in the 2048 issue: https://github.com/RezMike/2048/issues/4

soywiz commented 3 years ago

I believe it is because on of the parts of the component is a number and that's something invalid.

 tag is not a valid Android package name: 'io.github.rezmike.2048'.

Try to change it from io.github.rezmike.2048 to io.github.rezmike.n2048

Kesanov commented 3 years ago

Okay, that worked. Now I am getting Could not dispatch a message to the daemon.

Starting a Gradle Daemon, 1 busy and 1 incompatible and 3 stopped Daemons could not be reused, use --status for details
The message received from the daemon indicates that the daemon has disappeared.
Build request sent: Build{id=e0735128-f141-44f0-bfcb-982c8627743f, currentDir=D:\2048}
Attempting to read last messages from the daemon log...
Daemon pid: 14952
  log file: E:\Users\Me\.gradle\daemon\6.8\daemon-14952.out.log
----- Last  20 lines from daemon log file - daemon-14952.out.log -----
2021-03-31T13:11:19.545+0200 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 20: received class org.gradle.launcher.daemon.protocol.Build
2021-03-31T13:11:19.545+0200 [DEBUG] [org.gradle.launcher.daemon.server.DefaultDaemonConnection] thread 20: Received non-IO message from client: Build{id=e0735128-f141-44f0-bfcb-982c8627743f, currentDir=D:\2048}
2021-03-31T13:11:19.546+0200 [INFO] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Received command: Build{id=e0735128-f141-44f0-bfcb-982c8627743f, currentDir=D:\2048}.
2021-03-31T13:11:19.546+0200 [DEBUG] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler] Starting executing command: Build{id=e0735128-f141-44f0-bfcb-982c8627743f, currentDir=D:\2048} with connection: socket connection from /127.0.0.1:57232 to /127.0.0.1:57233.
2021-03-31T13:11:19.548+0200 [ERROR] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Command execution: started DaemonCommandExecution[command = Build{id=e0735128-f141-44f0-bfcb-982c8627743f, currentDir=D:\2048}, connection = DefaultDaemonConnection: socket connection from /127.0.0.1:57232 to /127.0.0.1:57233] after 0.0 minutes of idle
2021-03-31T13:11:19.549+0200 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Marking the daemon as busy, address: [b349109d-64b8-4dc4-a31a-db4d86d795e8 port:57232, addresses:[localhost/127.0.0.1]]
2021-03-31T13:11:19.549+0200 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Marking busy by address: [b349109d-64b8-4dc4-a31a-db4d86d795e8 port:57232, addresses:[localhost/127.0.0.1]]
2021-03-31T13:11:19.550+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
2021-03-31T13:11:19.550+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2021-03-31T13:11:19.552+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2021-03-31T13:11:19.553+0200 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] resetting idle timer
2021-03-31T13:11:19.553+0200 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
2021-03-31T13:11:19.554+0200 [INFO] [org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy] Daemon is about to start building Build{id=e0735128-f141-44f0-bfcb-982c8627743f, currentDir=D:\2048}. Dispatching build started information...
2021-03-31T13:11:19.554+0200 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 22: dispatching org.gradle.launcher.daemon.protocol.BuildStarted@42846eb0
2021-03-31T13:11:19.556+0200 [DEBUG] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Configuring env variables: [USERDOMAIN_ROAMINGPROFILE, NVM_SYMLINK, PROCESSOR_LEVEL, SESSIONNAME, ALLUSERSPROFILE, PROCESSOR_ARCHITECTURE, __INTELLIJ_COMMAND_HISTFILE__, PSModulePath, SystemDrive, =ExitCode, DIRNAME, USERNAME, CMD_LINE_ARGS, ProgramFiles(x86), FPS_BROWSER_USER_PROFILE_STRING, APP_HOME, DEFAULT_JVM_OP
TS, PATHEXT, DriverData, OneDriveConsumer, ProgramData, ProgramW6432, HOMEPATH, PROCESSOR_IDENTIFIER, ProgramFiles, PUBLIC, windir, =::, _SKIP, RUST_BACKTRACE, LOCALAPPDATA, USERDOMAIN, FPS_BROWSER_APP_PROFILE_STRING, LOGONSERVER, PROMPT, OneDrive, APPDATA, STACK_ROOT, JAVA_EXE, CommonProgramFiles, Path, OS, COMPUTERNAME, SBT_HOME, NVM_HOME, PROCESSOR_REVISION, CLASSPATH, CommonProgramW6432, ComSpec, APP_BASE_NAME, TER
MINAL_EMULATOR, =D:, TEMP, SystemRoot, USERPROFILE, HOMEDRIVE, TMP, CommonProgramFiles(x86), NUMBER_OF_PROCESSORS, IDEA_INITIAL_DIRECTORY]
2021-03-31T13:11:19.562+0200 [DEBUG] [org.gradle.launcher.daemon.server.exec.LogToClient] About to start relaying all logs to the client via the connection.
2021-03-31T13:11:19.562+0200 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] The client will now receive all logging from the daemon (pid: 14952). The daemon log file: E:\Users\Me\.gradle\daemon\6.8\daemon-14952.out.log
2021-03-31T13:11:19.563+0200 [INFO] [org.gradle.launcher.daemon.server.exec.LogAndCheckHealth] Starting build in new daemon [memory: 2 GiB]
2021-03-31T13:11:19.568+0200 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has started executing the build.
2021-03-31T13:11:19.568+0200 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=c7bacb22-605a-4739-ad66-6026fa28306f,javaHome=C:\Program Files\Graal,daemonRegistryDir=E:\Users\Me\.gradle\daemon,pid=14952,idleTimeout=10800000,priority=NORMAL,daemonOpts=--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-ope
ns,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,-Xmx2g,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]
----- End of the daemon log -----

But I have no device connected, which could be the cause of issue. Anyway, apk is being generated in build, which was the thing I cared about.

However, gradlew bundleAndroid still fails with the same message Task 'bundleDebugAar' not found in project ':android'. Some candidates are: 'bundleDebug'.

soywiz commented 3 years ago

You can deploy to a simulatort with runAndroidSimulatorDebug or something like that, and runAndroidDeviceDebug. Is the application launched on either a simulator or a device?