标签: react-native-android

java.lang.RuntimeException:无法实例化应用程序com.todos.MyApplication:java.lang.ClassNotFoundException

W/dalvikvm(21732): threadid=1: thread exiting with uncaught exception (group=0x41d0cda0)
E/Drive.UninstallOperation( 1829): Package still installed com.todos
E/AndroidRuntime(21732): FATAL EXCEPTION: main
E/AndroidRuntime(21732): Process: com.todos, PID: 21732
E/AndroidRuntime(21732): java.lang.RuntimeException: Unable to instantiate application com.todos.MyApplication: java.lang.ClassNotFoundException: Didn't find class "com.todos.MyApplication" on path: DexPathList[[zip file "/data/app/com.todos-3.apk"],nativeLibraryDirectories=[/data/app-lib/com.todos-3, /vendor/lib, /system/lib]]
E/AndroidRuntime(21732): at android.app.LoadedApk.makeApplication(LoadedApk.java:507)
E/AndroidRuntime(21732): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4841)
E/AndroidRuntime(21732): at android.app.ActivityThread.access$1600(ActivityThread.java:174)
E/AndroidRuntime(21732): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381)
E/AndroidRuntime(21732): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(21732): at android.os.Looper.loop(Looper.java:146)
E/AndroidRuntime(21732): at android.app.ActivityThread.main(ActivityThread.java:5731)
E/AndroidRuntime(21732): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(21732): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(21732): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
E/AndroidRuntime(21732): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
E/AndroidRuntime(21732): at dalvik.system.NativeStart.main(Native Method) …
Run Code Online (Sandbox Code Playgroud)

java android react-native react-native-android

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

适用于 Android 和 iOS 的 react-native 登录 Twitter

有没有人在 Android 和 iOS 的 React Native 应用程序中集成了 twitter 登录。任何帮助都受到高度赞赏。

react-native twitter-login react-native-android react-native-ios

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

如何在 React Native 上检测平板电脑环境

我想将手机和平板电脑上屏幕 S 的边距设置为不同。平板电脑横向和纵向模式有多种变体。

如何为手机、平板纵向、平板横向的变体创建不同的边距尺寸?

对于那些好奇如何在 Android 上做的人,我们只需在正确的文件夹中创建一些资源文件:

  • 默认
  • 平板电脑默认值-sw600dp
  • values-sw600dp-land用于平板电脑横向

react-native react-native-android

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

无法确定包装版本

我创建了一个反应本机应用程序,只需执行以下操作:

react-native init app
Run Code Online (Sandbox Code Playgroud)

我遵循了本教程:Facebook 入门(我使用 Linux)

我已经完全按照它说的做了。

但是,当我尝试运行应用程序 ( react-native run-android) 时,收到以下消息:

正在启动 JS 服务器...在设备上构建和安装应用程序(cd android && ./gradlew installDebug)...线程“main”中的异常 java.lang.RuntimeException:无法确定包装器版本。在 org.gradle.wrapper.GradleWrapperMain.wrapperVersion(GradleWrapperMain.java:111) 在 org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) 引起:java.lang.RuntimeException:未找到构建收据资源。在 org.gradle.wrapper.GradleWrapperMain.wrapperVersion(GradleWrapperMain.java:97) ... 1 more 无法在设备上安装应用程序,请阅读上面的错误以了解详细信息。确保您有一个正在运行的 Android 模拟器或已连接的设备并已设置您的 Android 开发环境:https : //facebook.github.io/react-native/docs/android-setup。 ``

我怎么解决这个问题?

react-native react-native-android

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

React Native - Native Base Footer不会改变颜色

这是代码:

 // Bottom.js
<StyleProvider style={getTheme(commonColor)}>
    <Footer>
        <FooterTab>
            <Button active>
                <Icon active name="food" size={24}  />
                <Text active>Lunch Box</Text>
            </Button>
            <Button>
                <Icon name="coins" size={24} />
                <Text>Point</Text>
            </Button>
            <Button>
                <Icon name="face" size={24} />
                <Text>Profile</Text>
            </Button>
        </FooterTab>
    </Footer>

</StyleProvider>

// commonColor.js

// Footer
footerHeight: 55,
footerDefaultBg: '#ffffff',

// FooterTab
tabBarTextColor: '#FFF',
tabBarTextSize: platform === 'ios' ? 14 : 16,
activeTab: platform === 'ios' ? '#007aff' : '#fff',
sTabBarActiveTextColor: '#007aff',
tabBarActiveTextColor: '#fff',
tabActiveBgColor: platform === 'ios' ? '#1569f4' : '#1569f4',
Run Code Online (Sandbox Code Playgroud)

这是结果: 结果

我已经尝试直接编辑FooterTab.js但根本没有改变.

渲染上可能发生的唯一变化是tabActiveBgColor: platform …

android react-native react-native-android native-base

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

如何在React Native中在TextInput上应用点击事件

嗨,我TextInput在我的本机应用程序中使用。我要在单击时打开日期对话框TextInput。我找不到在上应用点击事件的任何解决方法TextInput。有谁知道如何在本地反应中做到这一点?

<TextInput
  style={{
    height: 40,
    borderColor: "gray",
    borderWidth: 1,
    marginTop: 8
  }}
  underlineColorAndroid="transparent"
  placeholder={strings.schedule_date}
  onKeyPress={keyPress => console.log(keyPress)}
/>
Run Code Online (Sandbox Code Playgroud)

android react-native react-native-android

2
推荐指数
3
解决办法
5259
查看次数

任务':app:installDebug'的React Native BUILD FAILED执行失败

运行cmd> react-native run-android时出现以下错误指导我修复此问题。

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 27.72 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-android

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

如何在本机Es6上检测OnResume和onPause

如何检测从后台到前台es6的任何方法?

在React-native中这可能吗?是否有任何类或工具可以帮助这种方法?

android onresume onpause react-native-android

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

如何崩溃反应本机Android应用程序

我正在研究react-native-firebase crashlytics.我正在使用rnfirebase入门套件.在那里,我们将崩解与项目整合在一起.现在,我想让我的应用程序崩溃以检查崩溃报告.

react-native react-native-android react-native-firebase

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

未设置素材资源目标文件夹跳过本机响应(图片未加载到APK中)

我正在使用此命令:

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle
Run Code Online (Sandbox Code Playgroud)

输出
Scanning folders for symlinks in C:\Users\mgaba\Desktop\InfraGBU\node_modules (86ms) Scanning folders for symlinks in C:\Users\mgaba\Desktop\InfraGBU\node_modules (94ms) Loading dependency graph, done. bundle: Writing bundle output to: android/app/src/main/assets/index.android.bundle bundle: Done writing bundle output **Assets destination folder is not set, skipping...**

因此,我将无法在apk中看到图像。图片未与此相关,请帮助消除此错误。

javascript reactjs react-native react-native-android

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