java.lang.NullPointerException (no error message)

前端 未结 11 2173
北恋
北恋 2020-11-28 06:10

I know that this question of mine has been asked many times and I did follow most of the answers but none of those helped me. So this is my problem, whenever I sync my proje

相关标签:
11条回答
  • 2020-11-28 06:50

    For me it worked to delete the Gradle cache on user directory level: /Users/<username>/.gradle/cache. The --info option showed an inconsistency there.

    0 讨论(0)
  • 2020-11-28 06:51

    I had a similar problem when importing firebase into my project. First of all make sure that you followed the tutorial steps correctly and have imported the provided .json file into the right directory.

    Also, since firebase v9.0 it has been implemented into the google play services, so for firebase to work properly, make sure that the Google play services are up to date on the device that you're testing,

    I've also found this answer to be helpful while solving my issue https://stackoverflow.com/a/37310513/6728099

    0 讨论(0)
  • 2020-11-28 06:55

    This Problem created when the suddenly System restarted, then gradle file corrupted. and that corrupted file cached, so we need to Delete this file from your project

    your_project_path/.gradle/2.14.1/taskArtifacts
    

    It will be re-generate again.

    Then restart the Android studio and re-compile the project.

    source : https://code.google.com/p/android/issues/detail?id=220741#c13

    It is worked for me.

    0 讨论(0)
  • 2020-11-28 06:57

    Check your app/build.gradle. My problem was a ' in a dependency.

    0 讨论(0)
  • 2020-11-28 06:58

    I have same problem when the java version is 1.9

    jenv use java 1.8 
    

    all problem is solved.

    0 讨论(0)
  • 2020-11-28 07:00

    Remove below lines from dependency's, because already you compile complete play services dependency

        compile 'com.google.android.gms:play-services-location:9.4.0'
        compile 'com.google.android.gms:play-services-appindexing:9.4.0'
    
    0 讨论(0)
提交回复
热议问题