Alright I submit, I am trying to get a Unity 3D project working in a View on Android and it seems easy enough thanks to some tutorials online. However, I am stuck at the part where I need to convert the unity project to a module/AAR file. When following steps on these online tutorials, I get to the stage where I need to sync the gradle project and I receive:
ERROR: Could not find method bundle() for arguments [build_6plat2lh5rmq66u2k9bfvj0j1$_run_closure3$_closure12@655df9f] on object of type com.android.build.gradle.LibraryExtension.
The steps I used to produce the issue:
Go to build settings
Click Export
build.gradle
applicationID
(as instructed by android docs)apply plugin: 'com.android.application'
to apply plugin: 'com.android.library'
[EDIT] I forgot to mention that I removed [below] from the manifest
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
I ran into the same problem trying all things, commenting the bundle block fixed the problem for me
/*bundle {
language {
enableSplit = false
}
density {
enableSplit = false
}
abi {
enableSplit = true
}
}*/
I am not sure if this is the right approach but after building the project and generating the apk I got my .aar file which I guess is what you are trying to get.
I ran into the same issue. To solve this, you need to change apply plugin: 'com.android.application'
to apply plugin: 'com.android.library'
and delete applicationID
in both build.gradle
as there are two.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With