You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could not find method implementation() for arguments [project ':unityLibrary'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
#852
Open
007-liang opened this issue
Jul 28, 2023
· 2 comments
What went wrong:
A problem occurred evaluating project ':app'.
Could not find method implementation() for arguments [project ':unityLibrary'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
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.
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
buildscript {
repositories {
google()
jcenter()
maven {
url "https://mvn.mob.com/android"
}
maven {
url 'https://developer.huawei.com/repo/'
}
}
dependencies {
implementation project(':unityLibrary')
classpath "com.mob.sdk:MobSDK2:+"
}
}
android {
namespace "xxx"
compileSdkVersion flutter.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "front.crypcore"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
// minSdkVersion flutter.minSdkVersion
minSdkVersion 22
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation project(':unityLibrary')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
The text was updated successfully, but these errors were encountered:
timbotimbo
added
android
This issue is specific to the Android Platform.
Build
This issue refers to the build configuration and builds failing.
labels
Aug 21, 2023
You are importing unityLibrary in both line 42 and 92.
The one in 92 is how the example project and the readme do it, try removing the one at 42.
Nowehere in the docs or the example is unityLibrary imported inside a buildscript, try removing that.
I'm also not sure why you have a buildscript { .. } section here, new flutter projects usually have that in android/build.gradle instead of android/app/build.gradle.
Build file '/android/app/build.gradle' line: 42
A problem occurred evaluating project ':app'.
The text was updated successfully, but these errors were encountered: