本文的目的是介绍JAXB-未编组的字段为null的详细情况,特别关注编辑未包含main类型的相关信息。我们将通过专业的研究、有关数据的分析等多种方式,为您呈现一个全面的了解JAXB-未编组的字段为nu
本文的目的是介绍JAXB-未编组的字段为null的详细情况,特别关注编辑未包含main类型的相关信息。我们将通过专业的研究、有关数据的分析等多种方式,为您呈现一个全面的了解JAXB-未编组的字段为null的机会,同时也不会遗漏关于angular-过滤字段为null时,过滤器引发错误、hive join 对关联字段为NULL的处理方式、java – HIbernate没有获取数据库记录中字段为null的值、java – 用作锁的瞬态final字段为null的知识。
本文目录一览:- JAXB-未编组的字段为null(编辑未包含main类型)
- angular-过滤字段为null时,过滤器引发错误
- hive join 对关联字段为NULL的处理方式
- java – HIbernate没有获取数据库记录中字段为null的值
- java – 用作锁的瞬态final字段为null
JAXB-未编组的字段为null(编辑未包含main类型)
我们正在整理来自http://xmlgw.companieshouse.gov.uk/的回复。这是发送给马歇尔的文本:
<NameSearch xmlns="http://xmlgw.companieshouse.gov.uk/v1-0/schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlgw.companieshouse.gov.uk/v1-0/schema http://xmlgw.companieshouse.gov.uk/v1-0/schema/NameSearch.xsd"> <ContinuationKey>...</ContinuationKey> <RegressionKey>...</RegressionKey> <SearchRows>20</SearchRows> <CoSearchItem> <CompanyName>COMPANY NAME</CompanyName> <CompanyNumber>23546457</CompanyNumber> <DataSet>LIVE</DataSet> <CompanyIndexStatus>DISSOLVED</CompanyIndexStatus> <CompanyDate></CompanyDate> </CoSearchItem> // more CoSearchItem elements</NameSearch>
CoSearchItem的模型如下:
@XmlAccessorType(XmlAccessType.FIELD)@XmlType(name = "CoSearchItem", propOrder = { "companyName", "companyNumber", "dataSet", "companyIndexStatus", "companyDate", "searchMatch"})public class CoSearchItem { @XmlElement(name = "CompanyName", required = true) protected String companyName; @XmlElement(name = "CompanyNumber", required = true) protected String companyNumber; @XmlElement(name = "DataSet", required = true) protected String dataSet; @XmlElement(name = "CompanyIndexStatus") protected String companyIndexStatus; @XmlElement(name = "CompanyDate") @XmlSchemaType(name = "date") protected XMLGregorianCalendar companyDate; @XmlElement(name = "SearchMatch") protected String searchMatch; // getters and setters}
NameSearch模型具有以下结构:
@XmlAccessorType(XmlAccessType.FIELD)@XmlType(name = "NameSearch", namespace = "http://xmlgw.companieshouse.gov.uk/v1-0/schema", propOrder = { "continuationKey", "regressionKey", "searchRows", "coSearchItem"})@XmlRootElement(name = "NameSearch", namespace = "http://xmlgw.companieshouse.gov.uk/v1-0/schema")public class NameSearch { @XmlElement(name = "ContinuationKey", required = true) protected String continuationKey; @XmlElement(name = "RegressionKey", required = true) protected String regressionKey; @XmlElement(name = "SearchRows", required = true) protected BigInteger searchRows; @XmlElement(name = "CoSearchItem") protected List<CoSearchItem> coSearchItem; // setters and getters}
该软件包具有以下注释:
@XmlSchema(namespace = "http://xmlgw.companieshouse.gov.uk/v1-0", elementFormDefault = XmlNsForm.QUALIFIED, // xmlns = { @XmlNs(prefix = "xsi", namespaceURI = "http://www.w3.org/2001/XMLSchema-instance") })package uk.gov.companieshouse;
解组从第一完成Node
提取从一个更大的Document
,内部any
的产品清单。但是,当我们解析xml时,CoSearchItem中的所有字段都设置为null,无法找出原因。
答案1
小编典典您需要使用包级@XmlSchema
注释来指定模型的名称空间限定。
@XmlSchema( namespace = "http://xmlgw.companieshouse.gov.uk/v1-0/schema", elementFormDefault = XmlNsForm.QUALIFIED)package example;import javax.xml.bind.annotation.XmlNsForm;import javax.xml.bind.annotation.XmlSchema;
使用此选项,您无需在@XmlRootElement
和@XmlType
上指定名称空间URI NameSearch
。
想要查询更多的信息
- http://blog.bdoughan.com/2010/08/jaxb-namespaces.html
从任何项目列表中的较大文档提取的第一个节点开始进行拆组。
确保用于创建节点的DOM解析器可识别名称空间。
documentBuilderFactory.setNamespaceAware(true);
angular-过滤字段为null时,过滤器引发错误
headerText中的'item'可能为null,但不是textType
this.order = result.headerText && result.headerText.find((item) => item && item.textType === 'Order');
如果您使用最新版本的打字稿,则可以使用可选的链接建议
this.order = result.headerText?.find((item) => item?.textType === 'Order');
,
find()是属于数组类型的函数。您从result.headerText获取结果的错误为null或不是数组。
例如,您可以考虑进行以下检查:
if (result.headerText && Array.isArray(result.headerText)) {
return result.headerText.find(item => item.textType === 'Order')
}
return undefined;
hive join 对关联字段为NULL的处理方式
在hive version 0.10.0上测试 ,发现两表关联时,NULL=NULL 时不进行关联。
java – HIbernate没有获取数据库记录中字段为null的值
SessionFactory factory = null; Session session = null; try { factory = getSessionFactory(); session = factory.openSession(); final Criteria criteria = session .createCriteria(CrfEmailDataBean.class); criteria.add(Restrictions.eq(CAMPN_NBR,campNbr)); returnList = criteria.list(); } catch (Exception e) { logger.error(e.getMessage()); throw new DAOException(e); } finally { DBUtil.close(factory,session); } if (logger.isInfoEnabled()) { logger.info(LOG_METHOD_EXIT); } return returnList; }
在CrfEmailDataBean类中,我已经声明了一个私有的字符串crfEmailTypeCd;数据库中为null的字段.由于null,它不在返回列表中设置记录.如果我去数据库中的字段内输入一个值,它就会获取.
我尝试直接在sql数据库上运行查询,形成的查询是正确的并获取所有数据.
为什么不提取该记录?我该如何解决这个问题?
解决方法
private int number; private int value; private char option;
如果hibernate数据库准备就绪,那么当Hibernate生成器的转换器出错时
>这种从不用户原始类型的解决方案
>或者为属性定义默认值
>每个其他可能性您的日期不为空,此值为白色
> white与null不同
>制作测试条件Restrictions.isNotNull.
>制作其他测试条件Restrictions.isNull.
>其他测试使一个方法接收int,调用send一个Integer null
第一项
private Integer number; private Integer value; private Character option;
最后一项测试
public class Test{ public static void setInt(int value){ System.out.println(value); } public static void main(String[] args) { Integer testValue=null; Test.setInt(testValue); } }
java – 用作锁的瞬态final字段为null
import java.io.*; public class NullFinalTest { public static void main(String[] args) throws IOException,ClassNotFoundException { Foo foo = new Foo(); foo.useLock(); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); new ObjectOutputStream(buffer).writeObject(foo); foo = (Foo) new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray())).readobject(); foo.useLock(); } public static class Foo implements Serializable { private final String lockUsed = "lock used"; private transient final Object lock = new Object(); public void useLock() { System.out.println("About to synchronize"); synchronized (lock) { // <- NullPointerException here on 2nd call System.out.println(lockUsed); } } } }
这是输出:
About to synchronize lock used About to synchronize Exception in thread "main" java.lang.NullPointerException at NullFinalTest$Foo.useLock(NullFinalTest.java:18) at NullFinalTest.main(NullFinalTest.java:10)
如何锁定可能为空?
解决方法
以下是关于瞬态变量的一些事实:
– 在实例变量上使用Transient关键字时,将阻止该实例变量被序列化.
– 在反序列化时,瞬态变量达到其默认值…..
例如:
> Object Reference变量为null
> int到0
> boolean to false等等…….
这就是你在反序列化时获得NullPointerException的原因……
我们今天的关于JAXB-未编组的字段为null和编辑未包含main类型的分享就到这里,谢谢您的阅读,如果想了解更多关于angular-过滤字段为null时,过滤器引发错误、hive join 对关联字段为NULL的处理方式、java – HIbernate没有获取数据库记录中字段为null的值、java – 用作锁的瞬态final字段为null的相关信息,可以在本站进行搜索。
如果您想了解需要帮助处理由java.lang.IncompatibleClassChangeError引起的致命异常和您需要帮助的知识,那么本篇文章将是您的不二之选。我们将深入剖析需要帮助处理由java.lang.IncompatibleClassChangeError引起的致命异常的各个方面,并为您解答您需要帮助的疑在这篇文章中,我们将为您介绍需要帮助处理由java.lang.IncompatibleClassChangeError引起的致命异常的相关知识,同时也会详细的解释您需要帮助的运用方法,并给出实际的案例分析,希望能帮助到您!
本文目录一览:- 需要帮助处理由java.lang.IncompatibleClassChangeError引起的致命异常(您需要帮助)
- .IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected
- android – IncompatibleClassChangeError com.google.gson.annotations.SerializedName.value
- android – IncompatibleClassChangeError:接口未实现
- android – 由ActivityTestRule实例引起的java.lang.IncompatibleClassChangeError
需要帮助处理由java.lang.IncompatibleClassChangeError引起的致命异常(您需要帮助)
因此,我昨天在Android
Studio中遇到了一个我从未见过的错误,这是由过去三个月未触及的一段代码引起的。这来自用于注册推送通知的代码,本周初工作正常,但现在导致此错误:
05-20 10:37:02.064 22471-22681/com.appname E/AndroidRuntime: FATAL EXCEPTION: IntentService[RegIntentService] Process: com.appname, PID: 22471 java.lang.IncompatibleClassChangeError: The method ''java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)'' was expected to be of type virtual but instead was found to be of type direct (declaration of ''java.lang.reflect.ArtMethod'' appears in /system/framework/core-libart.jar) at com.google.android.gms.iid.zzd.zzeb(Unknown Source) at com.google.android.gms.iid.zzd.<init>(Unknown Source) at com.google.android.gms.iid.zzd.<init>(Unknown Source) at com.google.android.gms.iid.InstanceID.zza(Unknown Source) at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source) at com.appname.services.RegistrationIntentService.onHandleIntent(RegistrationIntentService.java:32) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.os.HandlerThread.run(HandlerThread.java:61)
这是我的RegistrationIntentService类:
package com.appname.services;import android.app.IntentService;import android.content.Context;import android.content.Intent;import com.google.android.gms.gcm.GoogleCloudMessaging;import com.google.android.gms.iid.InstanceID;import com.appname.MainSharedPreferences;import com.appname.R;import java.io.IOException;public class RegistrationIntentService extends IntentService { private static final String TAG = "RegIntentService"; public RegistrationIntentService() { super(TAG); } public static void startService(final Context context) { final Intent intent = new Intent(context, RegistrationIntentService.class); context.startService(intent); //HERE is the line that is causing the crash } @Override public void onHandleIntent(Intent intent) { InstanceID instanceID = InstanceID.getInstance(this); try { String token = instanceID.getToken(getString(R.string.gcm_defaultSenderId) , GoogleCloudMessaging.INSTANCE_ID_SCOPE, null); MainSharedPreferences.saveGCMInstanceToken(token, getApplicationContext()); } catch (IOException e) { e.printStackTrace(); } }
这是从我的MainActivity类调用上面的类的代码行:
RegistrationIntentService.startService(getApplicationContext());
我的MainActivity上的一些信息是否有帮助…
public class MainActivity extends SocialActivity implements SeekBar.OnSeekBarChangeListenerpublic abstract class SocialActivity extends AppCompatActivity implements GraphRequest.GraphJSONObjectCallback
我尝试跳回几个较早的提交,但是遇到了相同的错误。这使我相信,Android
Studio或Java版本可能存在问题。我更新了Java版本并重新安装了Android
Studio,但仍然是相同的错误。在具有旧版本的单独计算机上也尝试过,仍然存在相同的错误。
我什至尝试根据此指南从GCM迁移到Firebase ,最终再次遇到相同的错误。
我可以注释掉使应用程序崩溃的行,它将正常运行,但随后我不再收到通知。
在此问题上的任何帮助或建议,将不胜感激!
编辑: 这也是我相关的编译/类路径语句…
在appname build.gradle中:
buildscript { repositories { jcenter() } repositories { mavenCentral() } dependencies { classpath ''com.android.tools.build:gradle:2.1.0'' classpath ''com.google.gms:google-services:3.0.0'' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}
在应用程序build.gradle中:
apply plugin: ''com.android.application''apply plugin: ''io.fabric''repositories { //...}allprojects { //...}android { //...}dependencies { compile fileTree(dir: ''libs'', include: [''*.jar'']) testCompile ''junit:junit:4.12'' compile ''com.android.support:appcompat-v7:23.4.0'' compile ''com.google.code.gson:gson:2.5'' compile ''com.android.support:design:23.4.0'' compile ''com.android.support:recyclerview-v7:+'' compile "com.google.firebase:firebase-messaging:9.0.0" //...}apply plugin: ''com.google.gms.google-services''
答案1
小编典典5月27日更新:
我们刚刚发布了一个更新(version 9.0.1
),以解决我在第一次编辑中提到的不兼容问题。
请更新您的依赖关系,并告诉我们是否仍然存在问题。
谢谢!
原答案5月20日:
您遇到的问题是由于play-services / firebase sdk v9.0.0
和 之间的不兼容`com.android.support:appcompat-v7
= 24`
(与android-N sdk一起发布的版本)
您应该可以通过定位支持库的早期版本来修复它。喜欢:
compile ''com.android.support:appcompat-v7:23.4.0''
.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected
java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expectedandroid – IncompatibleClassChangeError com.google.gson.annotations.SerializedName.value
java.lang.IncompatibleClassChangeError: Couldn't find com.google.gson.annotations.Serializedname.value at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:659) at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:641) at libcore.reflect.AnnotationAccess.getDeclaredAnnotation(AnnotationAccess.java:170) at java.lang.reflect.Field.getAnnotation(Field.java:242) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getFieldName(ReflectiveTypeAdapterFactory.java:71) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getFieldName(ReflectiveTypeAdapterFactory.java:67) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:142) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:83) at com.google.gson.Gson.getAdapter(Gson.java:359) at com.google.gson.Gson.fromJson(Gson.java:809) at com.google.gson.Gson.fromJson(Gson.java:775) at com.google.gson.Gson.fromJson(Gson.java:724) at com.google.gson.Gson.fromJson(Gson.java:696) at com.cubii.utils.SessionManager.getUserID(SessionManager.java:70) at com.cubii.BluetoothLeService.broadcastUpdate(BluetoothLeService.java:188) at com.cubii.BluetoothLeService.access$400(BluetoothLeService.java:47) at com.cubii.BluetoothLeService$1.onCharacteristicChanged(BluetoothLeService.java:139) at android.bluetooth.BluetoothGatt$1.onNotify(BluetoothGatt.java:443) at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:399)`enter code here` at android.os.Binder.execTransact(Binder.java:446)
代码如下:
public int getUserID(){ try { String json = preferences.getString("User",""); LoginResponse loginResponse = new Gson().fromJson(json,LoginResponse.class);//getting error from this line Integer id = 0; if (loginResponse != null) { if (loginResponse.getId() != null) { id = loginResponse.getId(); } else { id = loginResponse.getUserId(); } } return (id == null) ? 0 : id; }catch (Exception e){ Logger.dump(e); } return 0; }
LoginResponse是我的POJO课程.
preferences.getString("User","")
将返回JSON字符串,这是服务器响应.
解决方法
这里有更多关于此问题的报告,它只影响三星设备.
https://code.google.com/p/android/issues/detail?id=172339
编辑
他们中的一些人也在三星以外的设备上遇到这个问题,所以它可能不完全是三星的故障.此问题已分配给Google小组.作为Google团队成员之一,如果有人可以向团队分享错误报告,他们可以尽快解决此问题.
After reproducing the issue,navigate to developer settings,ensure
‘USB debugging’ is enabled,then enable ‘Bug report shortcut’. To take
bug report,hold the power button and select the ‘Take bug report’
option.Note: Please upload the bug report to google drive and share the
folder to android-bugreport@google.com,then share the link 07002.
android – IncompatibleClassChangeError:接口未实现
堆栈跟踪
java.lang.IncompatibleClassChangeError: interface not implemented at in.plackal.lovecyclesfree.PasswordActivity.onCreate(PasswordActivity.java) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performlaunchActivity(ActivityThread.java:2627) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) at android.app.ActivityThread.access$2300(ActivityThread.java:125) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4627) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636) at dalvik.system.NativeStart.main(Native Method)
我的守则
public class PasswordActivity extends Activity implements Utilities { //Private Variables private EditText m_passwrdEditText; private TextView m_passwrdErrorText; private Resources m_res; @Override public void onCreate(Bundle savedInstanceState) { //Setup the activity super.onCreate(savedInstanceState); this.requestwindowFeature(Window.FEATURE_NO_TITLE); setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); displayMetrics dm = new displayMetrics(); getwindowManager().getDefaultdisplay().getMetrics(dm); if(dm.widthPixels == 320 && dm.heightPixels == 480) { setContentView(R.layout.password_activity_hvga); } else { setContentView(R.layout.password_activity); } GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker.getInstance();; tracker.startNewSession("UA-xxxxxxx-1",this); tracker.trackPageView("Password"); tracker.dispatch(); m_res = getResources(); final Typeface face = Typeface.createFromAsset(getAssets(),"fonts/Cicle Semi.otf"); m_passwrdErrorText = (TextView) findViewById(R.id.txt_error_message); m_passwrdErrorText.setTypeface(face); m_passwrdEditText = (EditText) findViewById(R.id.txt_edit_passwrd); m_passwrdEditText.setonClickListener(new OnClickListener() { @Override public void onClick(View v) { m_passwrdEditText.setHint(""); m_passwrdEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); m_passwrdEditText.setTypeface(face); } }); m_passwrdEditText.setTypeface(face); m_passwrdEditText.setonKeyListener(new OnKeyListener() { public boolean onKey(View v,int keyCode,KeyEvent event) { if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) { String strPassEntered = m_passwrdEditText.getText().toString(); String strPassSaved = CycleManager.getSingletonObject().getpassWord(); m_passwrdEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); if (strPassSaved.equals(strPassEntered) || strPassEntered.equals(DEFAULT_PASSWORD)) { Intent intent = new Intent(PasswordActivity.this,ActivityManager.class); startActivity(intent); PasswordActivity.this.finish(); } else { m_passwrdErrorText.setText(m_res.getString(R.string.passwrd_error_text)); m_passwrdEditText.setFocusable(true); } } else if(keyCode == KeyEvent.KEYCODE_DEL) { m_passwrdEditText.setHint(m_res.getString(R.string.passwrd_hint_text)); m_passwrdErrorText.setText(""); } m_passwrdEditText.setTypeface(face); return false; } }); } }
解决方法
幸运的是,我室友的手机遇到了同样的异常.通过以下链接阅读:What causes java.lang.IncompatibleClassChangeError?,我修复它的方式(至少在我室友的手机上)是通过将android-support-v4.jar添加到项目的“libs”文件夹并添加到构建路径.然后在“订购和导出”下的项目“Java构建路径”部分中,导出新添加的jar文件并删除用于导出“Android私有库”的选择.
android – 由ActivityTestRule实例引起的java.lang.IncompatibleClassChangeError
这是导致错误的代码行:(HomePageScreenTest.java:27)
@Rule public ActivityTestRule<HomePageActivity> homePageActivityTestRule = new ActivityTestRule<>(HomePageActivity.class);
这是错误:
java.lang.IncompatibleClassChangeError: com.example.rocklee.mehmvp.HomePage.HomePageActivity at dalvik.system.DexFile.defineClassNative(Native Method) at dalvik.system.DexFile.defineClass(DexFile.java:226) at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219) at dalvik.system.DexPathList.findClass(DexPathList.java:321) at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54) at java.lang.classLoader.loadClass(ClassLoader.java:511) at java.lang.classLoader.loadClass(ClassLoader.java:469) at com.example.rocklee.mehmvp.HomePage.HomePageScreenTest.<init>(HomePageScreenTest.java:27) at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:217) at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:266) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runchild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runchild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runchildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runchild(Suite.java:128) at org.junit.runners.Suite.runchild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runchildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:54) at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:240) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1853)
解决方法
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.1'
至
// Espresso-contrib for DatePicker,RecyclerView,Drawer actions,Accessibility checks,CountingIdlingResource androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.2.1') { exclude module: 'support-annotations' exclude module: 'support-v4' exclude module: 'support-v13' exclude module: 'recyclerview-v7' }
我发现这个代码在jacobduron的评论this answer,它修复了我的问题.
今天关于需要帮助处理由java.lang.IncompatibleClassChangeError引起的致命异常和您需要帮助的分享就到这里,希望大家有所收获,若想了解更多关于.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected、android – IncompatibleClassChangeError com.google.gson.annotations.SerializedName.value、android – IncompatibleClassChangeError:接口未实现、android – 由ActivityTestRule实例引起的java.lang.IncompatibleClassChangeError等相关知识,可以在本站进行查询。
本文标签: