An Warware: Duplicate class android.support.v4.app.

Matsalolin shirye-shirye sau da yawa suna cikin rikitattun kurakurai da kurakuran da masu haษ“akawa ke ci karo da su yayin aiwatar da codeing. Fahimta da magance waษ—annan kurakuran ba wai kawai tana inganta ฦ™warewar mai haษ“akawa ba amma har ma yana ฦ™ara haษ“aka haษ“akar software.

Kwafin Class android.support.v4.app

Yayin aiki tare da ci gaban Android, kuskuren 'Duplicate class android.support.v4.app' matsala ce ta gama gari da masu haษ“akawa ke fuskanta. Tushen wannan matsala yawanci yana cikin rashin daidaituwa ko kwafin abubuwan dogaro da ke cikin fayil ษ—in Gradle. Wadannan sabani suna faruwa lokacin da dakali da yawa, dogara da sigogi daban-daban na irin sigogi, an ฦ™ara su zuwa aikace-aikace da yawa a cikin aiki mai santsi.

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

A cikin lambar da aka bayar, 'com.android.support:appcompat-v7:28.0.0' da 'com.android.support.constraint:constraint-layout:1.1.3' sune ษ—akunan karatu masu cin karo da juna waษ—anda ke haifar da kuskuren kwafi.

Magance wannan batu yana buฦ™atar aiki tare da waษ—annan ษ—akunan karatu, tare da tabbatar da cewa sun samo asali daga nau'i ษ—aya na ajin iyaye, don haka kawar da kwafi.

Magance Batun 'Kwafin Aji'

Don magance kuskuren 'Duplicate class android.support.v4.app', mai haษ“akawa dole ne ya fara gane kuma ya gano ษ—akunan karatu masu cin karo da juna. Wannan yawanci ya ฦ™unshi binciken kusa da sashin dogara na fayil ษ—in build.gradle na aikace-aikacen. Bayan gano ษ—akunan karatu masu cin karo da juna, ana iya maye gurbinsu da abubuwan dogaro masu dacewa waษ—anda aka daidaita kuma an samo su daga nau'ikan ajin iyaye ษ—aya.

Canje-canje ya kamata a bayyana kamar haka:

dependencies {
   implementation fileTree(dir: 'libs', include: ['*.jar'])
   implementation 'com.android.support:appcompat-v7:28.0.0'
   implementation 'com.android.support.constraint:constraint-layout:1.1.3'
   testImplementation 'junit:junit:4.12'
   androidTestImplementation 'com.android.support.test:runner:1.0.2'
   androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

Fahimtar Lambobin: Tafiya Ta Mataki-Ta-Tafi

A cikin fayil ษ—in Gradle da aka sabunta, duk abin dogara yanzu an daidaita su kuma daga sigar ษ—akin ษ—akin karatu na iyaye ษ—aya, don haka kawar da kuskuren 'Duplicate class android.support.v4.app'.

A cikin wannan fayil ษ—in, kalmar 'aiwatarwa' tana nufin ษ—akunan karatu waษ—anda software ta dogara da su. Misali, 'com.android.support:appcompat-v7:28.0.0' babban ษ—akin karatu ne wanda aikace-aikacen ke buฦ™ata don gudanar da shi.

Mabuษ—in 'testImplementation' yana nufin ษ—akin karatu na gwaji don gudanar da gwaje-gwaje a cikin yanayin ci gaba. 'junit:junit:4.12', alal misali, ษ—akin karatu ne da ake amfani da shi don gudanar da gwaje-gwaje.

A ฦ™arshe, kuskuren 'Duplicate class android.support.v4.app' yana fitowa daga sabani a cikin ษ—akunan karatu masu dogaro da ke cikin fayil ษ—in Gradle na aikace-aikacen. Ta hanyar ganowa da daidaita waษ—annan ษ—akunan karatu, mai haษ“akawa zai iya gyara wannan kuskure cikin sauฦ™i. Wannan dabarar tana nuna mahimmancin fahimtar abin dogaro da sarrafa su a fagen haษ“aka software.

[b]Bi waษ—annan matakan yana tabbatar da cewa amfani da ajin android.support.v4.app baya haifar da matsalolin kwafi - don haka kiyaye mutunci da kwanciyar hankali na aikace-aikacenku.[/b]

Shafi posts:

Leave a Comment