小编Anu*_*Anu的帖子

Android ReactNative java.lang.UnsatisfiedLinkError:可以找到要加载的DSO:libreactnativejni.so

我一直在尝试将ReactNative添加到我现有的Android应用程序中.我按照链接的说明进行操作.我可以添加它,但是一旦打开react本机活动,应用程序就会崩溃.我已经启动了服务器使用

adb reverse tcp:8081 tcp:8081
Run Code Online (Sandbox Code Playgroud)

并开始使用反应原生

react-native start
Run Code Online (Sandbox Code Playgroud)

我得到了js文件正在加载的对话框.但最终以崩溃告终.以下是在logcat中打印的错误:

java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so
    at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:213)
    at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:178)
    at com.facebook.react.bridge.JSCJavaScriptExecutor.<clinit>(JSCJavaScriptExecutor.java:19)
    at com.facebook.react.ReactInstanceManager.onJSBundleLoadedFromServer(ReactInstanceManager.java:413)
    at com.facebook.react.ReactInstanceManager.createReactContextInBackground(ReactInstanceManager.java:236)
Run Code Online (Sandbox Code Playgroud)

我完全迷失了,因为我无法弄清楚这个问题的原因.

提前致谢.

java android react-native

17
推荐指数
4
解决办法
1万
查看次数

与Android应用程序的Flurry集成给出了一个错误"找不到类'com.flurry.sdk.i',从com.flurry.sdk.hu.a方法引用"

这是我到目前为止所尝试的:

public class ScoreUpApp extends Application {
private static ScoreUpApp scoreUpDataCache;
public static final String TAG = "MyApp";

@Override
public void onCreate() {
    // TODO Auto-generated method stub
    super.onCreate();

    // configure Flurry
    FlurryAgent.setLogEnabled(true);
    // init Flurry
    FlurryAgent.init(this, "V88JVYGFF7QX5D9RYZG2");

}
}
Run Code Online (Sandbox Code Playgroud)

这就是我在Logcat中得到的错误:

03-17 14:06:41.924: E/dalvikvm(30175): Could not find class 'com.flurry.sdk.i', referenced from method com.flurry.sdk.hu.a

03-17 14:31:36.694: W/dalvikvm(31798): VFY: unable to resolve const-class 2065 (Lcom/flurry/sdk/i;) in Lcom/flurry/sdk/hu;
Run Code Online (Sandbox Code Playgroud)

谢谢.

android flurry flurry-analytics

10
推荐指数
1
解决办法
2739
查看次数

无法将db'/data/data/com.scoreup/databases/scoreUp'的语言环境更改为'en_GB'

我最近更新了我的一个应用程序,在极少数情况下我得到了上述错误.仅当用户尝试通过现有应用程序更新应用程序时,才会出现此错误.这不会发生在每次和每台设备上.我在Android SQLiteException上发现了类似的问题:无法将db的语言环境更改为'en_US'但是回复并没有解决我的问题.我一直试图通过一个小小的方式来解决这个问题而且我失败了.我使用过SQLiteDatabase,因此我没有给出任何数据库路径.崩溃报告如下

android.database.sqlite.SQLiteException: Failed to change locale for db '/data/data/com.scoreup/databases/scoreUp' to 'en_US'.
0
android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration
SQLiteConnection.java:393
1
android.database.sqlite.SQLiteConnection.open
SQLiteConnection.java:218
2
android.database.sqlite.SQLiteConnection.open
SQLiteConnection.java:193
3
android.database.sqlite.SQLiteConnectionPool.openConnectionLocked
SQLiteConnectionPool.java:463
4
android.database.sqlite.SQLiteConnectionPool.open
SQLiteConnectionPool.java:185
5
android.database.sqlite.SQLiteConnectionPool.open
SQLiteConnectionPool.java:177
6
android.database.sqlite.SQLiteDatabase.openInner
SQLiteDatabase.java:806
7
android.database.sqlite.SQLiteDatabase.open
SQLiteDatabase.java:791
8
android.database.sqlite.SQLiteDatabase.openDatabase
SQLiteDatabase.java:694
9
android.app.ContextImpl.openOrCreateDatabase
ContextImpl.java:1148
10
android.content.ContextWrapper.openOrCreateDatabase
ContextWrapper.java:268
11
android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked
SQLiteOpenHelper.java:223
12
android.database.sqlite.SQLiteOpenHelper.getWritableDatabase
SQLiteOpenHelper.java:163
13
com.scoreup.gson.DatabaseHandler.openDatabase
DatabaseHandler.java:35
14
com.scoreup.gson.DatabaseHandler.getQuizBots
DatabaseHandler.java:379
15
com.scoreup.activity.earn.fragments.EarnScreenBottomFragmentWinners.onCreateView
EarnScreenBottomFragmentWinners.java:66
16
android.app.Fragment.performCreateView
Fragment.java:2053
17
android.app.FragmentManagerImpl.moveToState
FragmentManager.java:894
18
android.app.FragmentManagerImpl.moveToState
FragmentManager.java:1067
19
android.app.BackStackRecord.run
BackStackRecord.java:834
20
android.app.FragmentManagerImpl.execPendingActions
FragmentManager.java:1452
21 …
Run Code Online (Sandbox Code Playgroud)

android android-sqlite android-database

6
推荐指数
0
解决办法
704
查看次数

如何以编程方式使用 android:digits

我目前正在使用

android:digits="qwertzuiopasdfghjklyxcvbnmQWERTZUIOPASDFGHJKLYXCVBNM "
Run Code Online (Sandbox Code Playgroud)

在 EditText 中的 android XML 中,它运行良好。用户只能输入 az、AZ 和空格中的字符(我不想让用户输入数字或特殊字符)。我想以编程方式将此属性添加到另一个编辑文本字段。谁能帮我以编程方式添加上述属性。我已经参考了以下链接,但它没有用

编程方式更改 android:digits如何在 androids editText 中阻止特殊字符?没有安卓:数字

如果我使用

edtTxt.setKeyListener(DigitsKeyListener.getInstance("qwertzuiopasdfghjklyxcvbnmQWERTZUIOPASDFGHJKLYXCVBNM"));
Run Code Online (Sandbox Code Playgroud)

数字小键盘正在打开。

android android-edittext

6
推荐指数
1
解决办法
3620
查看次数

约束布局滚动到底部,键盘打开

我正在ConstraintLayout设计一个注册屏幕。我在ConstraintLayout里面放了一个滚动视图。即使键盘打开,用户也应该能够滚动并查看整个内容。此功能在我使用时有效, RelativeLayout但在我使用ConstraintLayout. 屏幕底部的视图隐藏在键盘后面。以下是我正在使用的布局。

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF"
    android:paddingTop="23dp"
    android:fillViewport="true"
    tools:context="com.givhero.activities.LoginActivity">

    <android.support.constraint.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="bottom"
        tools:context="com.givhero.activities.LoginActivity">

        <ImageView
            android:id="@+id/back"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="15dp"
            android:src="@drawable/back"
            android:tint="@color/colorPrimary"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:layout_editor_absoluteX="0dp"/>
        <TextView
            android:id="@+id/regEmail"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:paddingLeft="10dp"
            android:text="@string/sign_up_email"
            android:textColor="@color/colorPrimary"
            android:textSize="@dimen/titles_lists"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/back"
            tools:layout_editor_absoluteX="0dp"/>

        <TextView
            android:id="@+id/nameEditText"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="15dp"
            android:layout_marginLeft="15dp"
            android:layout_marginRight="15dp"
            android:layout_marginStart="15dp"
            android:layout_marginTop="30dp"
            android:background="@android:color/transparent"
            android:gravity="left"
            android:hint="Name"
            android:textColor="@color/dark"
            android:textColorHint="@color/dark"
            android:textSize="@dimen/base"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/regEmail"
            />

        <View
            android:id="@+id/nameDivider"
            android:layout_width="0dp"
            android:layout_height="1dp"
            android:layout_marginTop="15dp"
            android:background="@color/divider"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/nameEditText"
            />

        <EditText …
Run Code Online (Sandbox Code Playgroud)

android android-layout android-constraintlayout

6
推荐指数
1
解决办法
6107
查看次数

意图在 Android N 中打开 PDF 文件

我一直在尝试使用 Intent 打开 PDF 文件。它适用于 Adroid N 之前的设备。以下是我使用的代码

File file = new File(gridItems.get(position).getPath());
                        Intent intent = null;
                        if (Build.VERSION.SDK_INT < 24) {
                            intent = new Intent(Intent.ACTION_VIEW);
                            intent.setDataAndType(Uri.fromFile(file), "application/pdf");
                            intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
                        } else {
                            intent = new Intent();
                            intent.setAction(Intent.ACTION_VIEW);
                            Uri pdfURI = FileProvider.getUriForFile(GalleryPdfActivity.this, getApplicationContext()
                                    .getPackageName
                                            () +
                                    ".provider", file);
                            intent.putExtra(Intent.EXTRA_STREAM, pdfURI);
                            intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
                            intent.setType("application/pdf");
                        }
                        try {
                            if (intent.resolveActivity(getPackageManager()) != null)
                                startActivity(intent);
                            else
                                AppUtils.toast("No Application found to open the pdf", GalleryPdfActivity.this);
                        } catch (Exception e) {
                            AppUtils.toast(e.getMessage(), GalleryPdfActivity.this);
                        }
Run Code Online (Sandbox Code Playgroud)

文件选择器打开,我选择了 Google PDF 查看器来打开应用程序。但它返回错误“无法显示 …

android android-intent

2
推荐指数
1
解决办法
4332
查看次数