由于Facebook登录按钮本身可用,我想要一个适用于Android的React Native包装器组件.所以,我试着写它.但应用程序甚至在开始之前就崩溃了.我的github存储库是:https: //github.com/lalith26/react-native-fb-login-android
我做了以下事情:
https://github.com/lalith26/react-native-fb-login-android/blob/master/android/app/build.gradle#L28
https://github.com/lalith26/react-native-fb-login-android/blob/master/fblogin.js
https://github.com/lalith26/react-native-fb-login-android/blob/master/index.android.js#L21
我通过网络阅读并发现必须传递propTypes.我也试过了.但应用程序在启动时崩溃了.我无法看到任何日志.所以,我无法找到问题的实际原因.我为一个按钮尝试了相同的一组步骤,它工作正常.
有什么我只是做错了.请帮忙..
我通过logcat访问了模拟器的日志.表明:
E/AndroidRuntime(2550):进程:com.fbloginbutton2,PID:2550 E/AndroidRuntime(2550):java.lang.ExceptionInInitializerError E/AndroidRuntime(2550):at com.fbloginbutton2.FBLoginButtonManager.createViewInstance(FBLoginButtonManager.java:29) E/AndroidRuntime(2550):at com.fbloginbutton2.FBLoginButtonManager.createViewInstance(FBLoginButtonManager.java:15)E/AndroidRuntime(2550):at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:41)E/AndroidRuntime(2550):at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:172)E/AndroidRuntime(2550):at com.facebook.react.uimanager.UIViewOperationQueue $ CreateViewOperation.execute(UIViewOperationQueue.java: 137)E/AndroidRuntime(2550):at com.facebook.react.uimanager.UIViewOperationQueue $ 1.运行(UIViewOperationQueue.java:574)E/AndroidRuntime(2550):在com.facebook.react.uimanager.UIViewOperationQueue $ DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:622)E/AndroidRuntime(2550):在com.facebook.react. uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)E/AndroidRuntime(2550):at com.facebook.react.uimanager.ReactChoreographer $ ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:114)E/AndroidRuntime(2550):at android. view.Choreographer $ CallbackRecord.run(Choreographer.java:765)E/AndroidRuntime(2550):在android.view.Choreographer.doCallbacks(Choreographer.java:580)E/AndroidRuntime(2550):在android.view.Choreographer. doFrame(Choreographer.java:549)E/AndroidRuntime(2550):在android.view.Choreographer $ FrameDisplayEventReceiver.运行(Choreographer.java:753)E/AndroidRuntime(2550):在android.os.Handler.handleCallback(Handler.java:739)E/AndroidRuntime(2550):在android.os.Handler.dispatchMessage(Handler.java: 95)E/AndroidRuntime(2550):在android.os.Looper.loop(Looper.java:135)E/AndroidRuntime(2550):在android.app.ActivityThread.main(ActivityThread.java:5221)E/AndroidRuntime( 2550):at java.lang.reflect.Method.invoke(Native Method)E/AndroidRuntime(2550):at java.lang.reflect.Method.invoke(Method.java:372)E/AndroidRuntime(2550):at com .android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:899)E/AndroidRuntime(2550):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)E/AndroidRuntime(2550 ):引起:null E/AndroidRuntime(2550):at com.facebook.internal.Validate.sdkInitialized(Validate.java:99)E/AndroidRuntime(2550):在com.facebook.FacebookSdk.getCallbackRequestCodeOffset(FacebookSdk.java:735)E/AndroidRuntime(2550):在com.facebook.internal.CallbackManagerImpl $ RequestCodeOffset.toRequestCode( CallbackManagerImpl.java:109)E/AndroidRuntime(2550):在com.facebook.login.widget.LoginButton(LoginButton.java:58)E/AndroidRuntime(2550):...... 21多W/ActivityManager(1327):
强制完成活动com.fbloginbutton2/.MainActivity E/EGL_emulation(1373):tid 1373:eglCreateSyncKHR(1181):错误0x3004(EGL_BAD_ATTRIBUTE)
当我@ConfigurationProperties在基于aspectj-maven-plugin的maven编译过程中使用时,我收到以下错误消息:
[信息] 显示类型消息的 AJC 消息详细信息:[错误、警告、失败] [警告] 不支持 @ConfigurationProperty 元数据的字段值处理:
[错误]内部编译器错误:java.lang.IllegalStateException:无法在 org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.writeMetaData(ConfigurationMetadataAnnotationProcessor.java:367) 写入元数据
这是我的 pom 设置:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.8</version>
<configuration>
<forceAjcCompile>true</forceAjcCompile>
<source>${java.version}</source>
<target>${java.version}</target>
<Xlint>ignore</Xlint>
<complianceLevel>${java.version </complianceLevel>
<showWeaveInfo>true</showWeaveInfo>
<encoding>${project.build.sourceEncoding}</encoding>
<verbose>true</verbose>
<!--<aspectLibraries/>-->
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
解决办法是什么?
我正在尝试创建一个堆排序类,我得到了这个错误
java.lang.ArrayIndexOutOfBoundsException
这是我的代码
package heap_sort;
public class main {
public static void main(String[] args) {
int a[]={16,4,10,14,7,9,3,2,8,1};
heapsort(a);
}
public static void heapsort(int a[])
{
build_max_heap(a);
for(int i = a.length ;i<=2 ;i--)
{
a[1]=a[i];
max_heapify(a,1,i-1);
}
}
public static void build_max_heap(int a[])
{
int n=a.length;
for (int i =n/2 ;i>=1 ;i--)
{
max_heapify(a,i,n);
}
}
public static void max_heapify(int a[],int i , int n)
{
int L=i*2;
int R=(i*2)+1;
int Largest=i;
if (L<=n && a[L] > a[i])
Largest=L;
if (R>=n …Run Code Online (Sandbox Code Playgroud)