-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App crash when add line to MainApplication.Java #16
Comments
Hello! Have you tried building and running our starter-kit app? https://github.com/ViroCommunity/starter-kit It has all the config and We also recommend using the stater kit if you are starting a new AR project in any case! |
Hi Thank you for reply. yes i tried but same error. :/ |
Hi @websasindu in that case I think there is something wrong with your setup, and issues isn't the place to resolve this - come and join our discord, there is a good community who help with these kinds of problems: I'm going to close this issue but please join discord and raise it there. If someone there has seen it they may be able to help. |
@websasindu Did you find the solution to this issue. Also encountering the same issue |
Environment
Please provide the following information about your environment:
Description
I am making new ar ar using this viro library and i did all config
app\src\main\build.gradle
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
}
app\build.gradle
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 24
compileSdkVersion = 29
targetSdkVersion = 29
}
repositories {
google()
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:4.1.1')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
AndroidManifest.xml
MainApplication.java
package com.myviroapp;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import com.viromedia.bridge.ReactViroPackage;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@OverRide
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@OverRide
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@OverRide
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.myviroapp.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
Everything looks fine.but when i add packages.add(new ReactViroPackage(ReactViroPackage.ViroPlatform.valueOf("AR")));
into mainapplication.java file app crashed and when i remove it app running normaly but i got error message Ui manage not found. so what i have to do for solve this issue. Thank you
The text was updated successfully, but these errors were encountered: