我正在尝试在gradle自动生成的APK文件名中设置特定的版本号.
现在gradle生成myapp-release.apk但我希望它看起来像myapp-release-1.0.apk.
我尝试过重命名看起来很乱的选项.有一个简单的方法吗?
buildTypes {
release {
signingConfig signingConfigs.release
applicationVariants.each { variant ->
def file = variant.outputFile
variant.outputFile = new File(file.parent, file.name.replace(".apk", "-" + defaultConfig.versionName + ".apk"))
}
}
Run Code Online (Sandbox Code Playgroud)
我试过上面的代码没有运气.有什么建议?(使用gradle 1.6)
如果我在java文件中定义这样的功能
/**
* Adds two integers, returning their sum
*/
public native int add( int v1, int v2 );
Run Code Online (Sandbox Code Playgroud)
所以我需要在c文件中编码
JNIEXPORT jint JNICALL Java_com_marakana_NativeLib_add
(JNIEnv * env, jobject obj, jint value1, jint value2) {
printf("\n this is log messge \n");
return (value1 + value2);
}
Run Code Online (Sandbox Code Playgroud)
然后从这个printf将打印它的消息?在logcate我不明白吗?
如何通过放置日志消息来调试任何NDK应用程序?
有没有人得到"Kotlin未配置"的消息
我确定我错过了一些东西,但在大多数情况下我都下载了它,并且只是导入了我现有的2.x设置.我尝试从java类简单地复制/粘贴到新的Kotlin文件,这就是我所处的位置.
这是我目前的顶级build.gradle
buildscript {
repositories {
jcenter {
url = "http://jcenter.bintray.com/"
}
maven {
url = "https://maven.google.com"
}
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
}
}
allprojects {
repositories {
jcenter {
url = "http://jcenter.bintray.com/"
}
maven {
url = "https://maven.google.com"
}
mavenCentral()
}
}
Run Code Online (Sandbox Code Playgroud)
然后在我的模块构建文件的顶部我有这两行
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
Run Code Online (Sandbox Code Playgroud)
当前错误是"找不到插件'kotlin-android'未找到"
在以前的Android版本中,我通过使用热门调用获得了CPU使用率
String[] cmd = {
"sh",
"-c",
"top -m 1000 -d 0 -n 1 | grep \"" + aAppPID + "\""};
lProcess = Runtime.getRuntime().exec(cmd);
BufferedReader lReader = new BufferedReader(new InputStreamReader(lProcess.getInputStream()));
Run Code Online (Sandbox Code Playgroud)
似乎Android 7已经改变了安全性或者不允许这样做的东西.现在,如果附加到Android Studio,它将为我提供CPU%为1的行.如果运行发行版本,我发现它不会返回任何行.
有谁知道是否有可以添加的权限允许这个?
我最好的猜测是,此处记录的权限说明与此问题有关.
https://developer.android.com/about/versions/nougat/android-7.0-changes.html#perm
这是另一个问题的链接,我发布了一个解决方案,以获得Pre-7版本的CPU使用率.
我可以创建一个简单的Hello World,但是有趣的是,如果我使用Spring Boot 1.5.10.RELEASE或2.0。我有一个例外。1.2.7开始正常。
这是2.0.0版本中的serve.log。似乎始于无法从最终课程继承?版本是否不匹配?httpPutFormContentFilter类有东西吗?
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-03-09 10:24:35,514 ERROR [org.springframework.boot.SpringApplication] (MSC service thread 1-12) Application run failed: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'httpPutFormContentFilter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.filter.OrderedHttpPutFormContentFilter]: Factory method 'httpPutFormContentFilter' threw exception; nested exception is java.lang.VerifyError: Cannot inherit from final class …Run Code Online (Sandbox Code Playgroud) 我想开始研究今年在Google IO上宣布的VPS(视觉定位系统),但找到合作伙伴或入门的信息并不容易.
有没有人有任何建议?
android ×4
android-ndk ×1
apk ×1
build ×1
c ×1
gradle ×1
kotlin ×1
logging ×1
spring-boot ×1
wildfly ×1