Program type already present com.google.gson.FieldAttributes

前端 未结 4 2141
一生所求
一生所求 2020-12-18 11:47

My android app refuses to build with the following error:

Program type already present: com.google.gson.FieldAttributes
Message{kind=ERROR, text=Program type         


        
相关标签:
4条回答
  • 2020-12-18 11:55

    After 3 hours of googling around I finnaly found an Answer:
    GPDR compilance library caused the problem

    implementation ('com.google.android.ads.consent:consent-library:1.0.6') {
                    exclude module: 'gson'
     }
    
    0 讨论(0)
  • 2020-12-18 11:58

    add this code to your build.gradle(app) -

    dependencies {
        configurations {
        all*.exclude group: 'com.google.code.gson'
    }
    

    This should solve your problem.

    0 讨论(0)
  • 2020-12-18 12:06

    Add this line to build.gradle file.

    configurations {
                all*.exclude group: 'com.google.code.gson'
            }
    
    0 讨论(0)
  • 2020-12-18 12:19

    Add Dependency to build.gradle file

    implementation 'com.google.code.gson:gson:2.8.2'
    
    0 讨论(0)
提交回复
热议问题