我不得不在构建时遇到问题.我添加了构建firebase核心16.0.0,但是在构建时,这是构建firebase核心17.0.0.为什么它构建17.0.0.I检查android https://firebase.google.com/docs/android/setup#available_libraries,现在版本16.0.0,我必须删除构建项目,但这不成功.你能帮助我吗?谢谢.
当我增加版本构建
classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
Run Code Online (Sandbox Code Playgroud)
和
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//them multiDexEnabled = true
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
// butter knife.
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
// gson.
implementation 'com.google.code.gson:gson:2.8.2'
// image loading.
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation "com.github.bumptech.glide:okhttp3-integration:4.7.1"
implementation 'com.github.bumptech.glide:annotations:4.7.1'
//com.squareup.retrofit2
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
//com.squareup.okhttp3
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
//io.reactivex.rxjava2
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.13'
// keyboard keyboardvisibilityevent
implementation …Run Code Online (Sandbox Code Playgroud) 我正在用Rcpp创建一个包,我希望有一个函数,而不是可以作为参数a std::string或a 接受int.我该怎么做?
我有以下功能:
int myFunction(std::string varname);
RcppExport SEXP myFunction(SEXP varname) {
BEGIN_RCPP
Rcpp::RObject __result;
Rcpp::RNGScope __rngScope;
std::string myVarname = as<std::string>(varname);
__result = Rcpp::wrap(myFunction(myVarname));
return __result;
END_RCPP
}
int myFunction(int varname);
RcppExport SEXP myFunction(SEXP varname) {
BEGIN_RCPP
Rcpp::RObject __result;
Rcpp::RNGScope __rngScope;
int myVarname = as<int>(varname);
__result = Rcpp::wrap(myFunction(myVarname));
return __result;
END_RCPP
}
Run Code Online (Sandbox Code Playgroud)
我已经实现了两个c ++函数(一个承认一个int,另一个承认一个std::string)
在我定义R函数的文件中,我有:
myFunction <- function(varname) {
.Call('myFunction', PACKAGE = 'myPackage', varname)
}
Run Code Online (Sandbox Code Playgroud)
当我构建我的包时,我收到以下错误:
RcppExports.cpp:78:17: error: redefinition of ‘SEXPREC* myFunction(SEXP)’
RcppExport …Run Code Online (Sandbox Code Playgroud) 我正在开发一个有成就的安卓应用程序。是否可以知道成就是否已解锁(或者是否通过增量达到目标)?
我找到了使用Games.Achievements和添加回调函数的旧实现的解决方案,但它已被弃用。这是我用来解锁成就的代码:
Games.getAchievementsClient(MyActivity.this, acct).unlockImmediate(my_achievement_id));
Run Code Online (Sandbox Code Playgroud)
我想添加一个侦听器,以了解在执行我的代码后是否解锁了成就。
我有一个属性文件,我目前在此文件夹中:
/src/webapp/WEB-INF/classes/my.properties
Run Code Online (Sandbox Code Playgroud)
我正在加载它:
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
InputStream is = classLoader.getResourceAsStream("/my.properties");
Properties props = new Properties();
try {
props.load(is);
} catch (IOException e) {
e.printStackTrace();
}
String test = props.getProperty("test");
Run Code Online (Sandbox Code Playgroud)
现在这在我的Spring mvc应用程序中运行良好.
但是当我为此创建测试时,它失败并且我假设因为应用程序加载它的方式不使用web-inf/classes,因为它只是一个类而不是一个spring web应用程序.
那么我在哪里放置我的属性文件,以便在我的junit测试运行时,拾取属性文件?
此外,对于我的Web应用程序,除了/ web-inf/classes之外,还有哪些其他文件夹位于默认类路径中?