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

R8混淆报错了-dontwarn javax.lang.model.element.** #1060

Open
danatechgithub4 opened this issue Jan 10, 2024 · 3 comments
Open

R8混淆报错了-dontwarn javax.lang.model.element.** #1060

danatechgithub4 opened this issue Jan 10, 2024 · 3 comments

Comments

@danatechgithub4
Copy link

Missing class javax.lang.model.element.Element (referenced from: javax.lang.model.element.Element com.alibaba.android.arouter.facade.model.RouteMeta.rawType and 4 other contexts)

以前用的-dontwarn javax.lang.model.element.**
已经不起作用了,兄弟们怎么办?

@danatechgithub4 danatechgithub4 changed the title 混淆报错了-dontwarn javax.lang.model.element.** R8混淆报错了-dontwarn javax.lang.model.element.** Jan 10, 2024
@NingXiaAndroidYP
Copy link

怎么处理的?也遇到了

@danatechgithub4
Copy link
Author

怎么处理的?也遇到了

自己Fork一份,删掉Element

image

@danatechgithub4
Copy link
Author

package com.alibaba.android.arouter.compiler.entity;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.facade.enums.RouteType;
import com.alibaba.android.arouter.facade.model.RouteMeta;

import java.util.Map;

import javax.lang.model.element.Element;

public class RouteMetaKapt extends RouteMeta {

    private Element rawType;        // Raw type of route

    /**
     * Type
     *
     * @param type        type
     * @param rawType     rawType
     * @param destination destination
     * @param path        path
     * @param group       group
     * @param paramsType  paramsType
     * @param priority    priority
     * @param extra       extra
     */
    public RouteMetaKapt(RouteType type, Element rawType, Class<?> destination, String name, String path, String group, Map<String, Integer> paramsType, int priority, int extra) {
        super(type, destination, name, path, group, paramsType, priority, extra);
        this.rawType = rawType;
    }

    /**
     * Type
     *
     * @param route      route
     * @param rawType    rawType
     * @param type       type
     * @param paramsType paramsType
     */
    public RouteMetaKapt(Route route, Element rawType, RouteType type, Map<String, Integer> paramsType) {
        this(type, rawType, null, route.name(), route.path(), route.group(), paramsType, route.priority(), route.extras());
    }

    public Element getRawType() {
        return rawType;
    }

    public RouteMeta setRawType(Element rawType) {
        this.rawType = rawType;
        return this;
    }

    @Override
    public String toString() {
        return super.toString() + " rawType = " + rawType;
    }
}

image

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