اذهب إلى المحتوى
  • 0

مشكلة في ربط اليونتي والفلاتر

Sara Mohammed9

السؤال

هذا الخطاء كيف ممكن حلة

FAILURE: Build failed with an exception. 
* What went wrong: 
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. 
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'. 
   > Could not resolve project :unityLibrary. 
     Required by: 
         project :app 
      > No matching configuration of project :unityLibrary was found. The consumer was configured to find an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.0', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but: 
          - None of the consumable configurations have attributes. 

FAILURE: Build failed with an exception. 
* What went wrong: 
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. 
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'. 
   > Could not resolve project :unityLibrary. 
     Required by: 
         project :app 
      > No matching configuration of project :unityLibrary was found. The consumer was configured to find an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.0', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but: 
          - None of the consumable configurations have attributes. 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

Recommended Posts

  • 0

لحل مشكلة الربط بين Unity و Flutter المذكورة نقوم بالتحقق من ملف settings.gradle ونتأكد من أن settings.gradle في جذر المشروع يحتوي على الإدخال الصحيح لمشروع unityLibrary هكذا:

include ':app', ':unityLibrary'
project(':unityLibrary').projectDir = file('../UnityExport/unityLibrary')

ثم نقوم بتحديث build.gradle الخاص بمشروع Unity من خلال فتح ملف build.gradle الخاص بمشروع unityLibrary والتأكد من أن التكوينات متوافقة مع مشروع Flutter:

configurations.maybeCreate("default")
configurations.default.setExtendsFrom(configurations.implementation)

// Ensure these dependencies are set correctly
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.tools.build:gradle:7.3.0'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

ولا تنس أيضا تحديث gradle.properties من خلال التأكد من أن ملف gradle.properties يحتوي على الإعدادات اللازمة التالية:

android.useAndroidX=true
android.enableJetifier=true

 ولتنفيذ أوامر Gradle التالية، في سطر الأوامر داخل مجلد مشروع Flutter، ننفذ الأوامر التالية لتنظيف وإعادة بناء المشروع:

flutter pub get
cd android
./gradlew clean
./gradlew build

ويجب التحقق من إصدار Android Gradle Plugin (AGP) في ملفات build.gradle متوافق مع الإصدار المستخدم في Unity فإذا كنت تستخدم AGP 7.3.0، تأكد من أن التكوينات الأخرى متوافقة مع هذا الإصدار.

رابط هذا التعليق
شارك على الشبكات الإجتماعية

انضم إلى النقاش

يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.

زائر
أجب على هذا السؤال...

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   جرى استعادة المحتوى السابق..   امسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

  • إعلانات

  • تابعنا على



×
×
  • أضف...