Comments (29)
@AdamBrodzinski I don't trust run-android
, I just use the ./gradlew
(run from the android
dir) scripts installDebug
or installRelease
together with npm run start
.
In any case, we should start the upgrade to RN31 soon. iOS is upgraded, Android will probably break due to the upgrade so we do it cautiously.
from react-native-navigation.
@AdamBrodzinski i get an error when react-native run-android
E/AndroidRuntime(26807): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.reactnativenavigation.controllers.NavigationActivity}: java.lang.NullPointerException
E/AndroidRuntime(26807): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2192)
E/AndroidRuntime(26807): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2241)
E/AndroidRuntime(26807): at android.app.ActivityThread.access$800(ActivityThread.java:141)
E/AndroidRuntime(26807): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1204)
E/AndroidRuntime(26807): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(26807): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(26807): at android.app.ActivityThread.main(ActivityThread.java:5049)
E/AndroidRuntime(26807): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(26807): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(26807): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/AndroidRuntime(26807): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
E/AndroidRuntime(26807): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(26807): Caused by: java.lang.NullPointerException
E/AndroidRuntime(26807): at com.reactnativenavigation.views.BottomTabs.setStyle(BottomTabs.java:85)
E/AndroidRuntime(26807): at com.reactnativenavigation.views.BottomTabs.(BottomTabs.java:25)
E/AndroidRuntime(26807): at com.reactnativenavigation.layouts.BottomTabsLayout.createBottomTabs(BottomTabsLayout.java:87)
E/AndroidRuntime(26807): at com.reactnativenavigation.layouts.BottomTabsLayout.createLayout(BottomTabsLayout.java:45)
E/AndroidRuntime(26807): at com.reactnativenavigation.layouts.BottomTabsLayout.(BottomTabsLayout.java:40)
E/AndroidRuntime(26807): at com.reactnativenavigation.layouts.LayoutFactory.createBottomTabsScreenLayout(LayoutFactory.java:27)
E/AndroidRuntime(26807): at com.reactnativenavigation.layouts.LayoutFactory.create(LayoutFactory.java:12)
E/AndroidRuntime(26807): at com.reactnativenavigation.controllers.NavigationActivity.createLayout(NavigationActivity.java:69)
E/AndroidRuntime(26807): at com.reactnativenavigation.controllers.NavigationActivity.onCreate(NavigationActivity.java:54)
E/AndroidRuntime(26807): at android.app.Activity.performCreate(Activity.java:5249)
E/AndroidRuntime(26807): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime(26807): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2156)
from react-native-navigation.
Just to be more thorough I made a fresh 0.25.1 project and followed the same steps. I'm getting a similar error:
08-21 16:57:27.908 3400 3421 I ReactNativeJS: Running application "routetest" with appParams: {"initialProps":{},"rootTag":1}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
08-21 17:07:12.802 3515 3515 E AndroidRuntime: FATAL EXCEPTION: main
08-21 17:07:12.802 3515 3515 E AndroidRuntime: Process: com.routetest, PID: 3515
08-21 17:07:12.802 3515 3515 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate application com.routetest.App: java.lang.ClassNotFoundException: Didn't find class "com.routetest.App" on path: DexPathList[[zip file "/data/app/com.routetest-1/base.apk"],nativeLibraryDirectories=[/data/app/com.routetest-1/lib/x86, /data/app/com.routetest-1/base.apk!/lib/x86, /vendor/lib, /system/lib]]
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at android.app.LoadedApk.makeApplication(LoadedApk.java:578)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4680)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.routetest.App" on path: DexPathList[[zip file "/data/app/com.routetest-1/base.apk"],nativeLibraryDirectories=[/data/app/com.routetest-1/lib/x86, /data/app/com.routetest-1/base.apk!/lib/x86, /vendor/lib, /system/lib]]
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at android.app.Instrumentation.newApplication(Instrumentation.java:981)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at android.app.LoadedApk.makeApplication(LoadedApk.java:573)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: ... 9 more
08-21 17:07:12.802 3515 3515 E AndroidRuntime: Suppressed: java.lang.ClassNotFoundException: com.routetest.App
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at java.lang.Class.classForName(Native Method)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
08-21 17:07:12.802 3515 3515 E AndroidRuntime: ... 12 more
08-21 17:07:12.802 3515 3515 E AndroidRuntime: Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
from react-native-navigation.
Side note, is this for your refactor project? π
from react-native-navigation.
@AdamBrodzinski Sorry for the late response. Did you manage to get your project working?
from react-native-navigation.
@guyca No worries and thanks for getting back π In the mean time I did try to tweak the project to match the screenshot of #208 so that I don't have an App.java file but instead modified MainApplication like below. I think I might be close but i'm thinking it's how i'm returning the last method (as they where using VectorIcon so it was a bit diff.)
package com.badger;
import android.app.Application;
import android.util.Log;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.reactnativenavigation.NavigationApplication;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends NavigationApplication {
@Override
public boolean isDebug() {
return BuildConfig.DEBUG;
}
@Override
public List<ReactPackage> createAdditionalReactPackages() {
// Add the packages you require here.
// No need to add RnnPackage and MainReactPackage
//return Arrays.<ReactPackage>asList(); // also tried this.. no dice
return null;
}
}
and that gets me close. builds but when it launches I get a redbox with:
Didn't find class "com.facebook.jni.IteratorHelper" on path: DexPathList[[zip file "/data/app/com.badger-1/base.apk"],nativeLibraryDirectories=[/data/app/com.badger-1/lib/x86, /data/app/com.badger-1/base.apk!/lib/x86, /vendor/lib, /system/lib]]
findClass
BaseDexClassLoader.java:56
loadClass
ClassLoader.java:511
loadClass
from react-native-navigation.
@AdamBrodzinski jeez, sorry about all that. Makes me think that we need to provide a clean template or something. Do you have a clean-ish project I can clone and PR the fixes? This way I think will be the fastest, and shouldn't take more than a few mintues...
from react-native-navigation.
@DanielZlotin No worries, luckily i'm a professional Yak Shaverβ’ π. I've also been plugging away on the iOS simulator so I can keep busy.
I just created a fresh RN 0.30 project and installed the latest beta (i think? .71) as well as transferring the src
and img
folders over from the example project. This project is currently runs in Genymotion.
https://github.com/AdamBrodzinski/react-native-navigation-android-example
Thanks for the help!
from react-native-navigation.
@AdamBrodzinski ah I thought you're trying to run on RN0.25.1; 30 isn't supported yet (there are breaking changes in the android native code interface) - not something big but we must do it along a bunch of other libraries to keep the production working. This upgrade is planned for 2.0.0.
I can do a PR for you with 0.25.1 if you want.
from react-native-navigation.
@DanielZlotin Oh ok. From all of the other issues it seemed like I could go past that and up to 0.30 without much trouble (i'm already on 0.30, mainly for ActivityIndicator
but can I go backwards just to ship). Do you have a ballpark on when 0.30 will be supported?
Here's another repo with 0.25.1. I also could not get it working from the readme.
https://github.com/AdamBrodzinski/android-example2
Thanks!
from react-native-navigation.
@AdamBrodzinski hopefully in 2 weeks. hopefully. It really depends on the compatibility of a bunch of other libraries we use in production..
Now that I got your project working, please create a PR with the change you think should be in the README π
from react-native-navigation.
@DanielZlotin Thanks! I'll make a PR this weekend! π»
from react-native-navigation.
Hi all,
I have problem when release app (using this tutorial)
Then i installed the release using gradlew installRelease and the installation was successful but when i run the apk it says : "unfortunately, application has stopped"
but when i install and tun it using react-native run-android command it will work perfectly .
Do any one have any idea what i'm doing wrong?
Logs:
Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
from react-native-navigation.
@agumack have you tried following along with these commits?
https://github.com/AdamBrodzinski/android-example2
Also you need to use 0.25.1 for those. I used rninit to install a fresh older version.
from react-native-navigation.
thanks @AdamBrodzinski I'll try it now
from react-native-navigation.
@agumack What about running:
./node_modules/react-native/local-cli/cli.js run-android
? also is this the example2 repo or your own that's erroring? You might want to try that one since it's known to work to narrow down the problem.
If it is that repo perhaps trying the scripts in the package.json... npm run install
and npm run start
.
from react-native-navigation.
@DanielZlotin sounds great. I'll try using that instead π
from react-native-navigation.
Anybody found any instructions that get you from start to finish? I've tried everything and still cant figure out how to make a clean app run using RN0.25.1
and [email protected]
. Help!
from react-native-navigation.
The instructions at https://github.com/wix/react-native-navigation/wiki/Installation---Android worked for me, but the react version has to be > 30
as stated in Migrating-to-version-2.0 if you want to use 2.x
version of react-native-navigation
@DanielZlotin could you please update the version in wiki, and maybe remove (or copy to a single page in wiki) all 1.x
mentions because as I understood, even though 2.x
is still experimental, v1 is not supported.
from react-native-navigation.
@tylerclark Please try using v2 (set react-native-navgation: 'next'
in package.json
) and follow the short migration guide @monder linked to. Let me know if you still have any issues. Thanks and sorry for the confusion..
from react-native-navigation.
@drorbiran this is a good idea -#223 (comment) - separate it to 2 installation guides one for each version, and in v1.3 specify it's not in active development, but it's stable with RN0.25
from react-native-navigation.
I pulled the repo.
cd into ./example/android
ran ./gradlew
Got error > Cannot evaluate module react-native-navigation : Configuration with name 'libraryDebug' not found.
Where can I specify a configuration with that name?
from react-native-navigation.
@liuzhen2008 put the following line in your build.gradle:
dependencies {
debugCompile project(path: ':react-native-navigation', configuration: 'libraryDebug')
releaseCompile project(path: ':react-native-navigation', configuration: 'libraryRelease')
}
@DanielZlotin Was this removed from readme somehow? I remember before the readme was re-organized, these lines were part of installation instructions.
from react-native-navigation.
That's actually incorrect. I forgot to update the example project. I'll fix
it.
On Sep 15, 2016 07:40, "Yang" [email protected] wrote:
@liuzhen2008 https://github.com/liuzhen2008 put the following line in
your build.gradle:dependencies {
debugCompile project(path: ':react-native-navigation', configuration:
'libraryDebug')
releaseCompile project(path: ':react-native-navigation', configuration:
'libraryRelease')
}β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#223 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGWgj1AUhSp8I-vQBt0mt1uExBBhUzUSks5qqMw4gaJpZM4JpYgD
.
from react-native-navigation.
@DanielZlotin You mean the new version example should have these removed? We've been using the older version since version 2.0 is WIP. So I haven't been following the changes :]
from react-native-navigation.
@beast He means it's enough to specify compile project(':react-native-navigation')
since there are no differences between release and debug versions.
from react-native-navigation.
@guyca I see. Thanks.
from react-native-navigation.
+1 for adding import android.support.annotation.NonNull;
to MainApplication.java setup instructions I was stuck on that
from react-native-navigation.
hmm.. I think we should add a recommendation to edit java filed in Android Studio, which automatically handles imports for you.
from react-native-navigation.
Related Issues (20)
- [RN71-IOS] - Got a blank screen after setRoot()
- react-native 0.73.2 project getting com.appName.mainActivity can not be cast to com.reactnativenavigation.NavigationActivity HOT 9
- [Android | iOS] componentDidDisappear's performance is inconsistent in Android and iOS when App slides to background
- Event RNN.ComponentDidAppear called before render screen component when animations.showModal.enabled = false
- Header Style Shadows warnings can't be disabled
- Android - Left buttons are not in order
- Android Regression RN 0.73 - `onDropViewInstance` not called anymore, View not cleaned up
- Bottom tabs text is cut off on iPad HOT 6
- All bottom tab components load when a text input is pressed and the keyboard opens
- BottomTabs shows a top solid border when content is scrolled to the bottom edge on iOS 15 HOT 1
- Right-hand buttons flicker on Android
- Fabric is not working on IOS. HOT 1
- Compile error after upgrading from 7.38.3 to 7.38.6 HOT 2
- Android windowSoftInputMode not respected, keyboard always resizes view
- Does react-native-navigation work completely on Main Thread? Will it work if JS thread is blocked? HOT 1
- Android is not following the Appearance API from react-native HOT 1
- RN 0.74 New Architecture Support HOT 4
- App crashes with more than 5 tabs
- Incorrect rendering order of initial tab
- Xcode 15 RN 0.59 error: UIViewController is missing its initial trait collection populated during initialization
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-navigation.