eclipse general项目 转换 android项目,编译将Android项目转换为AspectJ时出错(Compile errors in converting Android projec...

在将Android项目转换为AspectJ的过程中遇到大量(500+)编译错误,主要是类型解析问题。问题源于ADT使用的文本文件编码与AspectJ编译器的不同。通过设置ADT使用UTF-8编码,与AspectJ保持一致,成功解决了问题。
摘要由CSDN通过智能技术生成

编译将Android项目转换为AspectJ时出错(Compile errors in converting Android project to AspectJ)

将Android项目转换为AspectJ项目时,我遇到了很多编译错误(500+)。 大多数错误都像“xxx无法解析为类型”

我正在使用ADT。

任何人都可以帮我吗? 如果您需要其他信息,请告诉我。

谢谢。

I got a lot of compile errors (500+) when converting my Android project into AspectJ project. Most of the errors are like "xxx cannot be resolved to a type"

As this page suggests, this might be an encoding issue: Compiling errors occur while convert a project to AspectJ project with AspectJ eclipse 3.4 plugin, ajdt2.0.1.... But I am not able to figure out how to set this ajc option in Eclipse.

I am using ADT.

Could anyone help me out? Just let me know if you need other information.

Thanks.

原文:https://stackoverflow.com/questions/21009311

更新时间:2020-01-15 22:04

最满意答案

I think I solved my problem.

Because I am on Mac, ADT is using some weird encoding for text files. I just need to tell ADT to use UTF-8, which is also used by AspectJ compiler.

These compile errors were caused by the fact that ADT and AspectJ compiler were using different encodings.

2014-01-11

相关问答

当STS中的AJDT版本仍然是基于mars的时候,这是一个问题。 此更新站点提供了一个与霓虹灯更兼容的新AJDT版本: http : //download.eclipse.org/tools/ajdt/46/dev/update 如果从那里更新,则应解决问题。 这将被折叠到下一个STS。 That was a problem when the AJDT version inside STS was still purely mars based. There is a new AJDT versi

...

snap方法需要成为公共API的一部分。 package com.springpractice.app;

import org.springframework.stereotype.Component;

@Component("camera")

public class Camera implements PhotoSnapper {

public Camera() {

//System.out.println("Hello from constructor");

...

请尝试在命令行上执行此操作:ajc -encoding UTF-8 如果ajc未被识别为命令,请将其添加到路径中。 我找到了这些链接,它们可能会有所帮助: http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg07331.html http://osdir.com/ml/java.aop.aspectj.general/2007-01/msg00034.html 如何在windows中更改默认的系统java编码格式? 如果您解决了问题,请告诉我

...

我通过使用“-encoding UTF-8”设置ajc选项解决了这个问题。 这是神秘的,因为eclipse的编码正好是utf-8。 这是否意味着ajc使用我的操作系统默认编码? I have solved it by set ajc option with "-encoding UTF-8". That's mysterious, cause the encoding of eclipse is exactly utf-8. Does that mean ajc use my OS default

...

我得到了解决方案。 这是一个精彩的博客,解释了这个http://ikrk.wz.cz/archiv/23-how-to-use-aspectj-with-android 。 有用 :) I got the solution. Here is a wonderful blog that explains this http://ikrk.wz.cz/archiv/23-how-to-use-aspectj-with-android. It works :)

WebSphere附带了它自己的AspectJ Runtime版本。 它安装在: 基地_ $ {}版本/lib/aspectjrt.jar 将类加载器顺序从“父级第一个”翻转到“父级最后”将不起作用 - 您必须采用不同的路径。 创建共享库(在WebSphere Admin Console中) 将您的AspectJ版本添加到此共享库 为您的应用程序或服务器创建一个新的类加载器,并将此类加载器附加到它。 有关如何做到这一点的说明可以在IBM的网站上找到: http://publib.boulder.i

...

[ERROR]错误消息:configure.incompatibleComplianceForSource in:org.aspectj.ajdt.ajc.messages 将通过添加修复 1.8

除了和默认为1.5 , 1.8不向后兼容1.5 。 [ERROR] error Missing message: configure.in

...

您的示例似乎不完整,您显示的错误与代码不匹配,但我没有看到使用以下pom.xml编译Aspect方面的任何问题:

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apa

...

monkeytalk团队在他们的经纪人中宣称这是一个错误。 他们希望本周发布固定版本。 不管怎么说,还是要谢谢你 :) The monkeytalk team declared this as a bug in their agent. They hope to release a fixed version this week. Thanks anyway :)

解:: 打开项目文件夹中的.project文件 在添加1)添加org.eclipse.jdt.core.javabuilder

...

...

...

org.eclipse.jdt.core.javabuilder

...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值