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
java.lang.NullPointerException #801
Comments
me too |
@ljf1172361058 Please paste the whole stacktrace |
@NikoYuwono ok. |
@NikoYuwono hello ,i had this error ,too. |
@cnexcelee Post your code |
@ljf1172361058 我测试发现如果使用apply plugin: 'com.neenbedankt.android-apt'会造成空指针 |
@NikoYuwono I have the same problem,my gradle code: allprojects { }#library build.gradle dependencies { android { |
@LeifDong 分开使用,别一起用 |
@caiyoufei 你好,这是我修改之后的配置,但是依然是java.lang.NullPointerException,我发现编译之后,没有生成XXActivity_ViewBinding.java文件。请问你知道怎么处理吗? dependencies { android { |
dependencies { 我发现添加以上代码到 app‘s build.gradle 是正确的。 |
Any solution?? |
So, I just use old version to solution this proplem: |
In my above everyone whos like me beacuse i am every biger and longer and handsome, look at this !!! i am your brother. |
app's build.gradle:
我试了下,真的是这样才有用,目前也只能加载app's build.gradle中用了。 |
@ljf1172361058` @LeifDong To use Butter Knife in a library, add the plugin to your buildscript: buildscript { and then apply it in your module: Now make sure you use R2 instead of R inside all Butter Knife annotations.
Library 用法不同 根据你的代码 你那是在library中使用么? |
use |
@fvaryu 是的 我的就是在 library 中使用导致的 NullPointerException |
If use Butter Knife in a library, you should check this introduce butterknife#library-projects by J.W |
@ljf1172361058 我也出现这个问题,最后怎么解决的呢 |
@maoxiandemeng 1.在你主 Module 下 build.gradle 中的 apply plugin: 'com.android.application' 的下面加入
3.在你项目下的 build.gradle 中的 dependencies 里加入 |
@ljf1172361058 意思是不用library 形式引入 |
@ljf1172361058 那就是在每个Library中都依赖一下 |
@MrSimpleX 我只在 Library 中依赖了 butterknife,主项目依赖该 Library。(PS:我的项目只有主 Moudule 和 Library ) |
使用butterknife和rxjava出现view空指针 |
Sometimes normal, something wrong。 |
空指针部分机型会出现:华为 GRA-CL00 |
I got this problem too,and i use it in app's build like this: |
@ljf1172361058 我用的rxbinding 一直报空指针,解决不了呢 |
It's not clear what the problem is here, but it seems like code isn't being generated or packaged into the APK. Ensure proper build configuration, that the generated classes are in |
在多module开发中,如果当前项目butterknife依赖来自于其他module,则会导致当前项目使用时空指针。确保项目当前目录下的build.gradle文件中加入butterknife依赖,才能保证当前项目中使用时不会空指针。 |
是的,所以我现在把 butterknife 依赖都放在我的主 module 中来避免空指针 |
butterknife8.0以下的时候,正常使用 |
第一阶段:下面配置可以正常工作,生成对应的xxxActivity_ViewBinding 第二阶段:新项目添加了kotlin环境,在app.gradle中添加了下面的代码,就不能编译自动生成xxxActivity_ViewBinding了,到了指定界面就报NullPointerException apply plugin: 'kotlin-android' 解决办法有两种: |
But 13 line error: java.lang.NullPointerException
Module gradle:
是我的配置出错了么?(Is my configuration error?)
The text was updated successfully, but these errors were encountered: