我在github上下载了一个Android应用程序的zip文件,我正在尝试运行它,但是我收到了一条包含此消息的对话框
app-release-unsigned.apk is not signed. Please configure the signing information for the selected flavor using the Project Structure dialog.
Run Code Online (Sandbox Code Playgroud)
我正在使用Android Studio.我应该做些什么?
今天我刚从Android SDK中导入了一个示例应用程序作为我项目中的模块(分析),当我尝试同步它时突然出现了这个gradle错误: Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE envrinment variable to...
这是我的app gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
defaultConfig {
applicationId "xxx.xxxxxx.xxxxx"
versionCode 1
versionName '1'
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName '1'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
compile 'com.facebook.android:facebook-android-sdk:3.21.1'
testCompile 'junit:junit:4.12'
compile project(':volley') …Run Code Online (Sandbox Code Playgroud) 由于我不知道的原因,languageLevel键从JDK_1_8更改为JDK_1_7.
会发生什么事?
这是否与其他从事该项目的开发人员的IDE有关?也许他们有另一个Android Studio设置?
这是在我注意到源代码管理下的文件发生了变化后弹出的内容:
$ git diff
diff --git a/.idea/misc.xml b/.idea/misc.xml
index fbb6828..5d19981 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
Run Code Online (Sandbox Code Playgroud)
如果重要的话,这是我的gitignore.
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
Run Code Online (Sandbox Code Playgroud)
我该如何进行以便它只是保持这种或那种方式?
从今天开始,Android Studio无法在styles.xml中找到AppCompat主题,但是例如代码中的AppCompatActivity确实得到了识别.我的Android Studio版本是2.2.2,Build#AI-145.3360264
我已经尝试升级到最新的构建工具,编译sdk(25)版本等,但它没有解决问题.
目前我安装了以下内容(来自sdk经理):
和其他一些,这里没有必要列出.
app的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.1'
defaultConfig {
applicationId "xxx.xxxxxxxx.xxxxxxxxx" //not the real applicationId
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/RootTools.jar')
compile 'com.android.support:support-v4:23.+'
compile 'com.android.support:support-v13:23.+'
compile 'com.android.support:appcompat-v7:23.+'
compile 'com.android.support:design:23.+'
compile 'com.android.support:cardview-v7:23.+'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4' …Run Code Online (Sandbox Code Playgroud) android android-appcompat gradle android-studio android-styles
安装失败,消息无效文件:K:\ project\app\build\intermediates\split-apk\with_ImageProcessor\debug\slices\slice_0.apk.通过卸载现有版本的apk(如果存在)然后重新安装,可能会解决此问题.
警告:卸载将删除应用程序数据!
要卸载现有应用程序吗?
我在android studio 2.3 beta 3中运行我的项目.
我有一个应用程序来管理书籍集(如播放列表).
我想显示一个带有垂直RecyclerView的集合列表,并在每行内部显示一个水平RecyclerView中的书籍列表.
当我将内部水平RecyclerView的layout_height设置为300dp时,它会正确显示,但是当我将其设置为wrap_content时,它不会显示任何内容. 我需要使用wrap_content,因为我希望能够以编程方式更改布局管理器以在垂直和水平显示之间切换.

你知道我做错了什么吗?
我的片段布局:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<com.twibit.ui.view.CustomSwipeToRefreshLayout
android:id="@+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/shelf_collection_listview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="10dp"/>
</LinearLayout>
</com.twibit.ui.view.CustomSwipeToRefreshLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
集合元素布局:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF">
<!-- Simple Header -->
</RelativeLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/empty_collection"
android:id="@+id/empty_collection_tv"
android:visibility="gone"
android:gravity="center"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/collection_book_listview"
android:layout_width="match_parent"
android:layout_height="wrap_content"/> <!-- android:layout_height="300dp" -->
</FrameLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
书目项目:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="180dp"
android:layout_height="220dp"
android:layout_gravity="center">
<ImageView
android:id="@+id/shelf_item_cover"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:maxWidth="150dp"
android:maxHeight="200dp"
android:src="@drawable/placeholder"
android:contentDescription="@string/cover"
android:adjustViewBounds="true"
android:background="@android:drawable/dialog_holo_light_frame"/> …Run Code Online (Sandbox Code Playgroud) android android-layout android-support-library android-studio android-recyclerview
我已经在我的MacBook Air(操作系统版本10.11 El Capitan)上安装了Android Studio,并成功编写了一个小型"hello,world"应用程序并安装在设备(Nexus 7)上并在AVD上运行.我现在要做的就是能够构建应用程序并从命令行将其安装在设备上而不是Android Studio.我按照这里的指示:
http://developer.android.com/training/basics/firstapp/running-app.html
相关的是:
确保Android SDK platform-tools /目录包含在PATH环境变量中,然后执行:
问题是我在我的机器上找不到Android SDK!我认为它存在,因为否则程序将无法编译并运行Android Studio?也许这是一个不好的假设?我是Macs的新手(我已经习惯了Windows)所以我不知道搜索Android SDK的最佳方法.所以我的问题:
我已经安装了 Android Studio Canary2020.3.1.22并尝试Flutter在Apple Silicon(ARM) Mac. 不幸的是,当我尝试运行default颤振计数器应用程序时,它给了我这个错误。
这是我收到的错误:
Could not open settings generic class cache for settings file '/Users/khamidjonkhamidov/StudioProjects/dummy/android/settings.gradle' (/Users/khamidjonkhamidov/.gradle/caches/6.7/scripts/f0emg6u6oecmxqzgk5g9nn4ui).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61
Run Code Online (Sandbox Code Playgroud)
Gradle version: 6.7但我尝试了 7+ JDK 版本17
我将衷心感谢您的帮助)
我有一个琐碎的问题困扰了我一段时间.我试图谷歌这个,但没有人似乎和我有同样的问题或没有看到它作为一个问题.当我在布局下的activity_my.xml中创建一个按钮时
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_1_name"
android:id="@+id/button2"
android:layout_marginTop="140dp"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true" />
Run Code Online (Sandbox Code Playgroud)
我得到一个看起来像的按钮
![这] [Imgur](https://i.imgur.com/IrjrxbT.png)
即使我的字符串代码是:
<resources>
<string name="app_name">HelloWorld</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="button_1_name">BuTtOn 1</string>
Run Code Online (Sandbox Code Playgroud)
我知道我肯定在这里缺少一些小东西,但是我如何在按钮文本中使用小写/大写字母?
谢谢!
我试图像在Eclipse中那样在Android Studio中使用自定义字体.但遗憾的是无法找出放置'assets'文件夹的位置!