Skip to content
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

编译出问题了 Task :app:compileDebugJavaWithJavac FAILED #203

Open
kelleryun opened this issue Feb 1, 2021 · 2 comments
Open

编译出问题了 Task :app:compileDebugJavaWithJavac FAILED #203

kelleryun opened this issue Feb 1, 2021 · 2 comments

Comments

@kelleryun
Copy link

安装没问题.
编译错误:> Task :app:compileDebugJavaWithJavac FAILED

Task :app:compileDebugJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
269 actionable tasks: 30 executed, 239 up-to-date
D:\program\migu\android\app\build\generated\rncli\src\main\java\com\facebook\react\PackageList.java:83: ����: �޷����� JMessageReactPackage�еĹ����� JMessageReactPackageӦ�õ���������;
new JMessageReactPackage(false),
^
��Ҫ: û�в���
�ҵ�: boolean
ԭ��: ʵ�ʲ����б�����ʽ�����б����Ȳ�ͬ
ע: D:\program\migu\android\app\src\debug\java\com\migua\ReactNativeFlipper.javaʹ�û�����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣
1 ������

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

@Hexi1997
Copy link

我也是这个问题,你解决了么

@Hexi1997
Copy link

Hexi1997 commented Mar 16, 2021

这个问题困扰了一天,最后终于解决了

原因分析:这个问题的出现是因为今年1月份的时候对JMessageReactPackage.java做了一次commit,详细修改可见 4da1a83 。这个commit会导致更新后的JMessageReactPackage无法传递参数,因为在new JMessageModule(reactContext, false)中写死为false,用户无法传参,将JMessageReactPackage.java改为之前的版本就是正确的。按照文档走安装最新版本的话,用户100%会遇到这个问题。

解决方案:将node_modules/jmessage-react-plugin/android/src/io/jchat/android/JMessageReactPackage.java修改还原为之前版本,代码如下

package io.jchat.android;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class JMessageReactPackage implements ReactPackage {

    private boolean mShutdownToast;

    public JMessageReactPackage(boolean shutdownToast) {
        mShutdownToast = shutdownToast;
    }

    @Override
    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
        List<NativeModule> result = new ArrayList<>();
        result.add(new JMessageModule(reactContext, mShutdownToast));
        return result;
    }

    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return Collections.emptyList();
    }

    @Override
    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        List<ViewManager> viewManagers = new ArrayList<>();
        viewManagers.add(new BubbleMsgManager());
        return  viewManagers;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants