java无法解析user的方法_java – 无法解析符号AndroidJUnit4

我正在尝试为我的应用添加loginfacebook.但是当我添加一个需要这样做的存储库时.它导致了一个错误.

AndroidJUnit4现在无法解决.

ExampleInstrumentedTest.java

package com.example.user.enyatravelbataan;

import android.content.Context;

import android.support.test.InstrumentationRegistry;

import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;

import org.junit.runner.RunWith;

import static junit.framework.Assert.assertEquals;

import static org.junit.Assert.*;

/**

* Instrumentation test,which will execute on an Android device.

*

* @see Testing documentation

*/

@RunWith(AndroidJUnit4.class)

public class ExampleInstrumentedTest {

@Test

public void useAppContext() throws Exception {

// Context of the app under test.

Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.example.user.enyatravelbataan",appContext.getPackageName());

}

}

这是我的构建:gradle(app)

apply plugin: 'com.android.application'

android {

compileSdkVersion 24

buildToolsVersion "24.0.3"

useLibrary 'org.apache.http.legacy'

repositories {

mavenCentral()

}

defaultConfig {

applicationId "com.example.user.enyatravelbataan"

minSdkVersion 16

targetSdkVersion 24

versionCode 1

versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

multiDexEnabled true

}

buildTypes {

release {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'

}

}

}

dependencies {

compile fileTree(include: ['*.jar'],dir: 'libs')

compile(name: 'wikitudesdk',ext: 'aar')

// compile 'org.apache.httpcomponents:httpclient:4.5'

// compile 'org.apache.httpcomponents:httpcore:4.4.1'

compile files('libs/MD5Simply.jar')

compile files('libs/GenAsync.1.2.jar')

compile 'com.facebook.android:facebook-android-sdk:[4,5)'

compile 'com.android.support:appcompat-v7:24.2.1'

compile 'com.android.support:multidex:1.0.0'

compile 'com.google.android.gms:play-services:9.8.0'

compile 'com.google.android.gms:play-services-location:9.8.0'

compile 'com.google.android.gms:play-services-appindexing:9.8.0'

compile 'com.android.support:cardview-v7:24.2.1'

compile 'com.squareup.picasso:picasso:2.5.2'

compile 'com.android.support:design:24.2.1'

compile 'com.android.volley:volley:1.0.0'

compile 'com.android.support:support-v4:24.2.1'

testCompile 'junit:junit:4.12'

}

repositories {

flatDir {

dirs 'libs'

}

}

apply plugin: 'com.google.gms.google-services'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值