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

🐛  باگ: باگ هنگام بیلد گرفتن #31

Open
Feryjo opened this issue Oct 24, 2024 · 17 comments
Open

🐛  باگ: باگ هنگام بیلد گرفتن #31

Feryjo opened this issue Oct 24, 2024 · 17 comments
Labels
bug Something isn't working

Comments

@Feryjo
Copy link

Feryjo commented Oct 24, 2024

باگ هنگام بیلد گرفتن:

**
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':tapsell_plus:compileDebugKotlin'.

'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

  • 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.
Get more help at https://help.gradle.org.

BUILD FAILED in 6s
Error: Gradle task assembleDebug failed with exit code 1
**:

نحوه‌ی تولید مجدد آن توسط تیم توسعه:

پکیج نیم برنامه‌: ``

اطلاعات اضافی که به حل مشکل کمک می‌کنند:

@Feryjo Feryjo added the bug Something isn't working label Oct 24, 2024
@MortezaNedaei
Copy link
Member

سلام این مشکل معمولا مربوط به نسخه گریدل IDE یا پروژه هست. داخل فایل گریدل این تنظیمات رو اعمال کنید:

compileOptions {
  sourceCompatibility JavaVersion.VERSION_17
  targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
  jvmTarget = '17'
}

@taheri79
Copy link

taheri79 commented Jan 2, 2025

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':tapsell_plus:compileDebugKotlin'.

'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

همچنان با این تغییرات کار نمیکنه

@MortezaNedaei
Copy link
Member

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':tapsell_plus:compileDebugKotlin'.

'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

همچنان با این تغییرات کار نمیکنه

اپ سمپل رو هم لطفا تست کنید ببینید همچنان مشکل دارید؟

@taheri79
Copy link

taheri79 commented Jan 2, 2025

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}

این رو به تپسل اضافه کردم بیلد شد

@MortezaNedaei
Copy link
Member

compileOptions {

sourceCompatibility JavaVersion.VERSION_17

targetCompatibility JavaVersion.VERSION_17

}

kotlinOptions {

jvmTarget = '17'

}

این رو به تپسل اضافه کردم بیلد شد

اضافه کردن همین کد به پروژه خودتون جواب نمیده؟ نسخه گریدل پروژه‌تون چند هست؟

@taheri79
Copy link

taheri79 commented Jan 2, 2025

خیر هرکاری کردم جواب نداد
نسخه گرندل: 8.0

@MortezaNedaei
Copy link
Member

خیر هرکاری کردم جواب نداد نسخه گرندل: 8.0

با توجه به اینکه روی پروژه سمپل، تونستین بیلد بگیرین، احتمالا یه کانفیگ مثل نسخه کاتلین یا گریدل پروژه، مشکل ایجاد کرده باشه.
میتونید یک تمپلیت از پروژه ای که مشکل داره رو به اکانت@TapsellTechSupport در تلگرام بفرستید بررسی کنیم؟

@sadjadtalakoob74
Copy link

این مشکل همچنان پابرجاست
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':tapsell_plus:compileDebugKotlin'.

'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

@smsseyedipoor
Copy link

سلام
منم همچین مشکلی دارم

  • What went wrong:
    Execution failed for task ':tapsell_plus:compileDebugKotlin'.

Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin' (21).

پروژه بدون استفاده از پکیج tapsell_plus با همین تنظیماتی که داره بالا میاد اما وقتی پکیج tapsell_plus رو ادد می کنم دیگه بالا نمیاد.

@smsseyedipoor
Copy link

پکیج رو باز کردم و build.gradle رو اینجوری تغییر دادم درست شد.

android {
namespace 'ir.tapsell.plus.flutter'
compileSdkVersion 34

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
    minSdkVersion 19
}

// اضافه کردن تنظیمات Java به 21
compileOptions {
    sourceCompatibility JavaVersion.VERSION_21
    targetCompatibility JavaVersion.VERSION_21
}

// اضافه کردن تنظیمات Kotlin به 21
kotlinOptions {
    jvmTarget = "21"
}

}

بسته به ورژن هایی که در برناه خودم استفاده می کنم ورژن های جاوا و کاتلین رو اینجا ست کردم.

@mohammadmahdiyousefi
Copy link

سلام من این مشکل دارم چگونه درستش کنم تو نسخه فلاتر 3.29

  • What went wrong:
    Execution failed for task ':tapsell_plus:compileDebugKotlin'.

Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin' (17).

Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain
Learn more about JVM-target validation: https://kotl.in/gradle/jvm/target-validation

  • 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.
Get more help at https://help.gradle.org.

BUILD FAILED in 43s
Error: Gradle task assembleDebug failed with exit code 1

@MortezaNedaei
Copy link
Member

این کد زیر رو در فایل build.gradle به بلاک submodules اضافه کنید و امتحان کنید

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
        kotlinOptions.jvmTarget = "1.8"
    }

@mohammadmahdiyousefi
Copy link

سلام من این راه رو هم امتحان کردم جواب نداد مشکل از خود پکیجه لطفا پکیج رو آپدیت کنید تا مشکل حل بشه ممنون

@smsseyedipoor
Copy link

شما از jvm ورژن 17 استفاده می کنید.
برو توی app/build.gradle اونجا از هر ورژنی که استفاده می کردی در آدرس پکیج هم همون ورژن رو لحاظ کن.

آدرس پکیج
External libraries --> Flutter Plugins --> tapsell_plus-2.3.1 --> android --> build.gradle

مثلا برای من اینارو تغییر دادم.
از ورژن 1.8 به 21
شما احتمالا باید به ورژن 17 تغییر بدی.

// اضافه کردن تنظیمات Java به 21
compileOptions {
    sourceCompatibility JavaVersion.VERSION_21
    targetCompatibility JavaVersion.VERSION_21
}

// اضافه کردن تنظیمات Kotlin به 21
kotlinOptions {
    jvmTarget = "21"
}

یک روش دیگه هم fork کردن تپسل در گیت هست.

@mohammadmahdiyousefi
Copy link

شما از jvm ورژن 17 استفاده می کنید. برو توی app/build.gradle اونجا از هر ورژنی که استفاده می کردی در آدرس پکیج هم همون ورژن رو لحاظ کن.

آدرس پکیج External libraries --> Flutter Plugins --> tapsell_plus-2.3.1 --> android --> build.gradle

مثلا برای من اینارو تغییر دادم. از ورژن 1.8 به 21 شما احتمالا باید به ورژن 17 تغییر بدی.

// اضافه کردن تنظیمات Java به 21
compileOptions {
    sourceCompatibility JavaVersion.VERSION_21
    targetCompatibility JavaVersion.VERSION_21
}

// اضافه کردن تنظیمات Kotlin به 21
kotlinOptions {
    jvmTarget = "21"
}

یک روش دیگه هم fork کردن تپسل در گیت هست.

ممنون از راهنمایی دقیقتون اررور رفع شد

@MortezaNedaei
Copy link
Member

ازدوستان کسی میتونه این مشکل رو در نسخه‌ی 2.3.2 هم تست کنه؟
من یک پروژه تست اینجا قرار میدم که با جاوای 8 و 11 و 17 و 21 کار میکنه و نیازی به تغییری در کتابخانه تپسل نداره.

test.zip

@mohammadmahdiyousefi
Copy link

ازدوستان کسی میتونه این مشکل رو در نسخه‌ی 2.3.2 هم تست کنه؟ من یک پروژه تست اینجا قرار میدم که با جاوای 8 و 11 و 17 و 21 کار میکنه و نیازی به تغییری در کتابخانه تپسل نداره.

test.zip

من تست کردم مشکل رفع شده

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants