- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
如标题所述:运行我的 Android 混合 (Java/C) 项目时,出现此错误:
08-07 12:49:54.933 4546-4557/editor.lua.com.luaeditor E/AndroidRuntime﹕ FATAL EXCEPTION: GLThread 10
java.lang.ExceptionInInitializerError
at editor.lua.com.luaeditor.Opengl_Renderer.onSurfaceChanged(Opengl_Renderer.java:28)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1381)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1138)
Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1312]: 2123 cannot locate 'srand'...
at java.lang.Runtime.loadLibrary(Runtime.java:434)
at java.lang.System.loadLibrary(System.java:554)
at editor.lua.com.luaeditor.Native.<clinit>(Native.java:12)
at editor.lua.com.luaeditor.Opengl_Renderer.onSurfaceChanged(Opengl_Renderer.java:28)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1381)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1138)
为了安全起见,这是我的 build.grable :
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "editor.lua.com.luaeditor"
minSdkVersion 10
targetSdkVersion 10
ndk {
cFlags "-NDK_HOST_32BIT 1"
cFlags "-std=c99"
moduleName "Lua_Editor"
ldLibs "GLESv2"
}
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
}
这是我的 list :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="editor.lua.com.luaeditor">
<application android:allowBackup="true" android:label="@string/app_name"
android:icon="@mipmap/ic_launcher" android:theme="@style/AppTheme">
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<activity
android:name=".Lua_Editor"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
通过浏览网络和文档,我发现其他人也有同样的问题:Android NDK: load_library: cannot locate srand当时的答案是安装 32 位 NDK。
经过进一步挖掘,我发现 build-ndk 有一个选项:NDK_HOST_32BIT 1
此选项应该强制 NDK 编译为 32 位。
使用 Android Studio,所以使用 gradle,我搜索了在哪里可以添加这个选项来配置 ndk,唯一编译的尝试是尝试粘贴为我的 build.grable
仍然,我的错误仍然存在,我一直在挖掘,但 android studio 1.3 预览版 ndk 插件的文档似乎很少。
有关信息:我在 Samsung Galaxy S 上运行应用程序,在 64 位 Mint 计算机(基于 Ubuntu)上编译。
所以我求助于你们作为最后的手段。是我傻还是我傻?
最佳答案
如果您希望代码在旧版本上运行,则需要针对 21 之前的 SDK 版本构建 native 源代码。 (Java 部分仍然可以使用最新的 SDK 构建。)
如果可以降低通用 compileSdkVersion
,请尝试将其降低到 19 或 20。如果不行,您可能想尝试在 中添加
block 。compileSdkVersion 19
ndk
参见 https://stackoverflow.com/a/27338365/3115956和 https://stackoverflow.com/a/27093163/3115956有关此问题的更多解释。
关于安卓工作室 1.3 NDK : cannot locate 'srand' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31876608/
我正在尝试在 python 中编写正则表达式来查找目录路径:我的文本如下所示: text = "The public disk is: \\\\diskA\\FolderB\\SubFolderC\\
我想写一个LocationListener,它把最近最精确的位置作为它的位置。我打算在我的 LocationListener 中使用此代码: @Override public void
我想建立一个有光泽和 plotly 的交互式图表。 Shiny 有一个内置功能来获取有关用户交互的信息。比如:input$plot_click、input$plot_dblclick、input$pl
我正在使用 MobileFirst 提供的 WL.Device.Geo.acquirePosition(onGeoLocationSuccess, onGeoLocationFailure, opti
我最近开始使用 ionic 框架,它里面有 angular js。为了在屏幕之间导航,我使用了 $location.path 并且效果很好。但是,在我下载的一个示例中,我看到 $state.go 被用
谁能解释一下这种行为?我使用 history.pushState(null, null, '#test'); 推送历史状态。然后,当尝试使用console.log(window.location.ha
这里是相关代码: https://www.facebook.com/sharer/sharer.php?u={{$location.absUrl()}} https://www.facebook.c
这两个重定向之间有什么区别?我有一个应用程序,当我使用时,它可以在 chrome 和 android 4 上正常工作,但在 android 2.x.x 上不能正常工作 document.locatio
JavaScript 的区别是什么 window.location.href = window.location.href 和 window.location.reload() 功能? 最佳答案 如果
有什么区别 window.location.href="http://example.com"; window.location.replace("http://example.com"); wind
JavaScript 的区别是什么 window.location.href = window.location.href 和 window.location.reload() 功能? 最佳答案 如果
以下 3 个指令之间有区别吗? location ~* \.(png)$ { expires max; log_not_found off; } location ~ \.(png)$ {
位于正文末尾之前的以下脚本在 Internet Explorer 和 Chrome(以及任何其他浏览器)中都会被调用。但重定向到指定的 URL 仅发生在 IE 中。我还尝试了 window.locat
我正在使用 Angular ngRouter。我需要更改 url 路径以及搜索参数。我知道 $location.path 和 $location.search,但是有没有一个函数可以同时设置它们? 最
在angularjs中用$location和window.location哪个更好。 例如,我们可以使用$location.path() 或window.location.href 来完成同样的工作。
我在我的网站上使用上述 2 个命令。似乎它们对 95% 访问它应该触发的页面的人有效,但对其他人则不会。 有谁知道是否可以完全阻止这些 javascript 命令?我真的很头疼为什么它们有时不起作用。
这是我无法弄清楚的另一个错误。 我有这个类ExtendedLocation extends Location实例化时抛出 ClassCastExceptioncurrentGpsLocation =
我一直在尝试简单地将一个包含两个变量(一个字符串和一个位置)的类推送和读取到 firebase,但我一直收到此错误。 **com.google.firebase.database.DatabaseEx
我注意到 iPhone 上的“常用位置”似乎比监控 iOS 访问的应用程序 (https://developer.apple.com/reference/corelocation/clvisit) 使
在我的 javascript 代码中,在某些时候,我需要刷新窗口(用户上传了新图片但在页面中仍然可以看到它) 我想知道为什么 location.href = location.href 不刷新窗口?
我是一名优秀的程序员,十分优秀!