在为我正在使用的所有库添加ProGuard规则后,我仍然收到以下警告:
警告:有14个未解决的对类或接口的引用。 您可能需要添加缺少的库jar或更新其版本。 如果您的代码正常运行而没有缺少类,则可以取消 带“ -dontwarn”选项的警告。 (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
我知道我可能可以使用该-dontwarn
选项来消除此警告,但是因此我需要知道无法解析哪些包/类/接口。Android不支持全局“ -dontwarn”。
在日志文件中,我发现了很多注释和警告,但是似乎没有一个与以上消息相关。
我试图在styles.xml中包含app:fabSize,但是android studio抛出错误
有没有办法在styles.xml中包含app:fabSize和其他app:属性?
android android-layout android-studio floating-action-button
我刚刚开始使用Android Studio,我想向我的项目添加一个开源库。我在Internet上浏览了很多东西,但是找不到找到使我的项目编译并使该库的类可见的方法。
这是我要包含的库:https : //github.com/TangoAgency/material-intro-screen?utm_source=android-arsenal.com&utm_medium=referral&utm_campaign=4368
在自述文件中,它首先说是添加gradle依赖项:
dependencies {
compile 'agency.tango.android:material-intro-screen:{latest_release}'
}
Run Code Online (Sandbox Code Playgroud)
但是在我看来,在那之前还有更多事情要做……只是我不知道该做什么。
在android studio中,您可以通过在编辑器中切换+/-(代码/折叠)来折叠/扩展代码段。但是当我有一个侦听器时,它不会折叠整个代码,而只是折叠一部分代码。如何隐藏整个听众?例如,当我想折叠下面的代码时:
View.OnClickListener ctgClick = new View.OnClickListener(){ //hide from here
public void onClick(View v){
int tag =(Integer) v.getTag();
Intent intent= new Intent();
intent.putExtra("ctg", tag);
setResult(RESULT_OK, intent);
finish();
}
};//to here
Run Code Online (Sandbox Code Playgroud)
它只是隐藏了部分代码,如下所示:
View.OnClickListener ctgClick = (v) -> {
int tag =(Integer) v.getTag();
Intent intent= new Intent();
intent.putExtra("ctg", tag);
setResult(RESULT_OK, intent);
finish();
}
};
Run Code Online (Sandbox Code Playgroud) 我右键单击我的NDK项目,然后选择“使用gradle链接C ++项目”。我在那里添加了Android.mk文件。出现“ cpp”文件夹。到目前为止还好。
现在,我要撤消此操作,然后再次分配Android.mk路径,因为我之前选择了错误的路径。我怎样才能做到这一点?
我使用的是Android Studio 2.2.3.单击xml代码中的UI组件时,预览窗口会自动关闭.再次在预览中选择时,窗口会再次出现,当选择xml代码时,窗口会消失.有没有可用的修复方法?
这种情况经常发生,但这次我似乎无法解决它.项目从命令行构建良好.这是错误:
Error:org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection
Run Code Online (Sandbox Code Playgroud)
此意外错误的可能原因包括:
所提出的解决方案都没有奏效.我还尝试使缓存无效并手动删除Gradle缓存以强制重新下载依赖项和包装器.
编辑: "升级到最新的构建工具和Gradle版本" 不是一个解决方案,因为这个问题仍然存在.此问题的当前解决方法是"暂时"禁用测试覆盖率.由于该问题最初是在6个月前报告的(尽管它被分类为"关键"),但解决方法不仅是坏的,而且不是暂时的.
当我更新android studio时,出现此错误。创建一个新项目没有问题。我无法建立现有项目。
我已经可以上网了,单击重新下载后此错误无法解决。我该如何解决这个问题?我尝试了很多在互联网上找到的方法,但是没有运气。
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'cz.msebera.android:httpclient:4.4.1.1'
compile 'com.mcxiaoke.volley:library:1.0.18'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.github.florent37:materialtextfield:1.0.5'
compile 'com.googlecode.json-simple:json-simple:1.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
compile 'com.github.sundeepk:compact-calendar-view:1.9.8'
compile 'com.github.bumptech.glide:glide:3.7.0'
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试将我的Google Play服务应用程序索引更新到10.2.0,并在build.gradle的依赖项中更新了编译行,如图所示,编译为"com.google.android.gms:play-services-appindexing: 10.2.0"但我面临一个错误,如图所示"无法解决:com.google.android.gms:play-services-appindexing:10.2.0".
我甚至尝试过安装存储库链接,但它没有用.
在AVD Manager中的Android Studio 2.3(Mac)中,显示了IceCreamSandwich(API15)的图像,但无法下载.
由于我必须满足API15的兼容性要求,我如何下载该图像或在哪里可以找到正确的图像?
谢谢!