android 删除模块,Android Studio 2.3删除模块引用(Android Studio 2.3 removes module references)...

Android Studio 2.3删除模块引用(Android Studio 2.3 removes module references)

我有一个Android项目,由多个模块组成。 我不使用Gradle 。

使用Android 2.2.3,该项目运行良好,但我将Android Studio更新为2.3。

当我加载主项目时,我收到了以下消息:

Update Property Files

The structure of following Android modules was changed:

ActionbarSherlock

我检查了我的存储库以查看主项目中发生了什么变化,并在我的项目配置中找到了以下内容。

这些行被删除:

# This file is automatically generated by IntelliJ IDEA

# Project target.

target=android-16

android.library.reference.1=../ActionbarSherlock

android.library.reference.2=../WizarDroid

并添加以下行:

# This file is automatically generated by IntelliJ IDEA

# Project target.

target=android-16

project.type=0

在模块依赖关系中,我仍然可以看到模块,但是我得到编译错误:

D:\MainProject\res\values\styles.xml:51: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light'.

D:\MainProject\res\values\styles.xml:53: error: Error: No resource found that matches the given name: attr 'actionBarTabStyle'.

我能做些什么?

更新:

我无法在2.3版本上运行,所以我回到了2.2.3。 现在,当我的项目被编译并运行时,它崩溃并出现以下错误:

java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.Button

在消息对话框中,它显示完全不同的文本而不是OK文本。 这真的搞砸了我的项目...

I have an Android project, consisting of multiple modules. I do not use Gradle.

With Android 2.2.3 the project worked well, but I updated my Android Studio to 2.3.

When I loaded the main project, I got this message:

Update Property Files

The structure of following Android modules was changed:

ActionbarSherlock

I checked my repository to see what has changed in the main project, and in in my project config, I found the following.

These line were removed:

# This file is automatically generated by IntelliJ IDEA

# Project target.

target=android-16

android.library.reference.1=../ActionbarSherlock

android.library.reference.2=../WizarDroid

And this line is added:

# This file is automatically generated by IntelliJ IDEA

# Project target.

target=android-16

project.type=0

In the module dependencies, I still can see the module, yet I get compile errors:

D:\MainProject\res\values\styles.xml:51: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light'.

D:\MainProject\res\values\styles.xml:53: error: Error: No resource found that matches the given name: attr 'actionBarTabStyle'.

What can I do about that?

UPDATE:

I could not make it work with 2.3, so I reverted back to 2.2.3. Now, when my project is compiled and run, it crashes with the following errors:

java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.Button

On the message dialog, it shows a completely different text instead of the OK text. It really messed up my project...

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

更新时间:2019-12-31 07:21

最满意答案

我不得不恢复到2.2.3并再次添加模块。

我想,在2.3中只有Gradle是安全的...

I had to revert back to 2.2.3 and add the modules again.

I guess, in 2.3 only Gradle is safe...

相关问答

如果您正在使用MIUI运行设备,请转至开发人员设置>打开MIUI优化并关闭它。 然后,您需要重新启动设备并重新编译代码。 即时运行应该再次工作 In case you are running a device with MIUI, go to Developer Settings > Turn on MIUI optimization and turn it off. You will then need to restart your device and recompile the code.

...

我有类似的问题,但使用不同的插件(BlackBerry OS AVD导致此问题)。 我搜索了插件名称(错误信息中的最后一行),它显示了BB开发网站,我立即知道发生了什么。 找到哪个插件导致错误,然后转到Configrue(右下角) - >插件 - >删除你的插件,重启android studio。 为我工作。 I had similar problem but with different plugin (BlackBerry OS AVD caused this problem). I sear

...

按照步骤: 1)转到文件 - >设置 2)现在外观和行为 - >系统设置 - >更新 3)从下拉列表中选择稳定频道自动检查更新,如下图所示。 4)申请并确认 5)重新启动,现在检查更新。 它会工作。 Follow the Steps: 1) Go to File -> Settings 2) Now Appearance & Behavior -> System Settings -> Updates 3) Select the Stable Channel from the Dropdown o

...

我不得不恢复到2.2.3并再次添加模块。 我想,在2.3中只有Gradle是安全的... I had to revert back to 2.2.3 and add the modules again. I guess, in 2.3 only Gradle is safe...

因此,在出现此对话框时要小心: 选择 “稍后提醒我”而不是 “更新” 继续使用您已有的构建版本。 Incase,你按下了Update,所以只需将build.gradle(project) Android Gradle Plugin类路径回滚到下面一个: classpath 'com.android.tools.build:gradle:2.2.2'

这对我有用。 So, be careful while this dialog appears: Choose "Remind me later"

...

原来,每个Activity的配置中的screenLayout都是罪魁祸首。 我不应该这样做。 这样做会导致没有任何堆栈跟踪或任何错误的错误。 Turns out, screenLayout within each Activity's config is the culprit. I shouldn't have done that. Doing it would result in an error without any stack trace or whatsoever.

好吧,我终于获得了胜利。 卸载现有的工作室并杀死那些.android&.AndroidStudio2.3文件夹后,我再次重新安装studio。 现在Android工作室正常运行。 Ok I got triumph finally. After uninstalling existing studio and killing those .android & .AndroidStudio2.3 folders, then I re-install studio again. Now the Andr

...

看着mac崩溃 - 一位同事发现这一行“JRSInputMethodController availableInputMethodLocales”导致这个已知的JRE崩溃的问题 ,由于额外的输入,我删除了我的额外键盘布局,崩溃消失了。 正如在问题中所述 - 它是固定在OS X 10.11或更低的Java版本 - 我在OS X 10.10,所以我会升级到10.11 looking at the mac crash - a coworker found this line "JRSInputMetho

...

最后解决了它。 有一个来自构建文件(app)的提示,指出'com.android.support:appcompat-v7:25.0.2'的更新版本,而更新的版本是'com.android.support:appcompat-v7: 25.3.1' 。 我在构建脚本中手动更改了25.0.2到25.3.1并同步。 这将导致Android Studio请求下载新的支持存储库。 完成后,它将解决Gradle构建问题以及无法解析.java文件中的'appCompatActivity'的任何问题。 Fina

...

如果“Messages Gradle Sync”建议升级; 你可能已经这样做了。 禁用即时运行,执行此操作:2.a。 打开“设置”或“首选项”对话框:在Windows或Linux上,从菜单栏中选择“文件”>“设置”。 在Mac OSX上,从菜单栏中选择Android Studio>首选项。 2.B. 导航到构建,执行,部署>即时运行。 取消选中代码更改后重新启动活动旁边的框。 检查您的防病毒和关闭,再试一次。 我没有遇到过这个问题,但是在一些较旧的帖子上建议成功。 希望其中一个能够解决这个问题。

...

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值