タグ付けされた質問 「android-studio」

Androidアプリの開発を対象としたGoogleの公式IDEであるAndroid Studioの使用に関する質問に使用します。Androidのプログラミング全般に関する質問には使用しないでください。代わりに、[android]タグを使用してください。



18
RecyclerViewでWRAP_CONTENTを機能させる方法
私が持っているDialogFragment含まれているRecyclerView(カードのリスト)。 この中にRecyclerViewはCardViews、任意の高さを持つことができる1つ以上があります。 私はこれに含まれるにDialogFragment基づいて正しい高さを与えたいですCardViews。 通常これは簡単です、私はこのように設定wrap_contentしRecyclerViewます。 <android.support.v7.widget.RecyclerView ... xmlns:tools="http://schemas.android.com/tools" android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:clickable="true" android:scrollbars="vertical" > </android.support.v7.widget.RecyclerView> 私が使用しているのでRecyclerViewこれは機能しません: https://issuetracker.google.com/issues/37001674 そして ネストされたリサイクラービューの高さはコンテンツをラップしません これらのページの両方で、人々は拡張LinearLayoutManagerしてオーバーライドすることを提案しますonMeasure() 私は最初に誰かが最初のリンクで提供したLayoutManagerを使用しました: public static class WrappingLayoutManager extends LinearLayoutManager { public WrappingLayoutManager(Context context) { super(context); } private int[] mMeasuredDimension = new int[2]; @Override public void onMeasure(RecyclerView.Recycler recycler, RecyclerView.State state, int widthSpec, int heightSpec) …

26
「default」という名前のAndroid Studio Gradle構成が見つかりません
Android Studio(0.1.5)でアプリをコンパイルできません。アプリは、次のように含めた2つのライブラリを使用します。 settings.gradle include ':myapp',':library',':android-ColorPickerPreference' build.gradle buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4' } } apply plugin: 'android' dependencies { compile files('libs/android-support-v4.jar') compile project(':library') compile project(':android-ColorPickerPreference') } android { compileSdkVersion 17 buildToolsVersion "17.0.0" defaultConfig { minSdkVersion 7 targetSdkVersion 16 } } コンパイルすると、次のメッセージが表示されます。 Gradle: A problem occurred configuring …


4
Android .idea / misc.xmlのlanguageLevelタグがJDKを変更し続ける
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" …


8
Android StudioとGradleで-source 1.7を設定する方法
Android Studioでプロジェクトをコンパイルしようとすると、次のエラーが発生します。 Gradle: error: diamond operator is not supported in -source 1.6 私は見つけたすべてのプロジェクト設定で1.7をターゲットとして設定しています。また、1.7 SDKの下のプロジェクトSDKに表示されるパスは、Java 1.7インストールへの正しいパスです。 ターミナルでjava -versionを実行しても、Java 1.7で実行していることがわかります。 JAVA_HOME env変数をこれに設定しようとしました: /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home エラーは解消されません。エラーを解消するにはどうすればよいですか?

18
無効なファイルというメッセージが表示されてインストールが失敗しました
「無効なファイル:K:\ project \ app \ build \ intermediates \ split-apk \ with_ImageProcessor \ debug \ slices \ slice_0.apk」というメッセージが表示されてインストールが失敗しました。この問題が存在する場合は、apkの既存のバージョンをアンインストールしてから再インストールすることで解決できる可能性があります。 警告:アンインストールすると、アプリケーションデータが削除されます! 既存のアプリケーションをアンインストールしますか? Android Studio 2.3 Beta 3でプロジェクトを実行しています。

15
ネストされたリサイクラービューの高さはコンテンツをラップしません
書籍のコレクション(プレイリストなど)を管理するアプリケーションがあります。 垂直方向の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> コレクション要素のレイアウト: <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" …

18
プラグインが古すぎます。最新バージョンに更新するか、ANDROID_DAILY_OVERRIDE環境変数を設定してください
今日、私はプロジェクト(アナリティクス)のモジュールとしてAndroid SDKからサンプルアプリをインポートしましたが、同期しようとすると突然、このGradleエラーが発生しました。 Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE envrinment variable to... これは私のアプリ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 { …

23
styles.xmlのシンボル「テーマ」を解決できません(Android Studio)
今日から、Android Studioはstyles.xmlでAppCompatテーマを見つけることができませんが、たとえばコード内のAppCompatActivityは認識されます。Android Studioのバージョンは2.2.2、ビルド#AI-145.3360264です。 私はすでに最新のビルドツールへのアップグレード、sdk(25)バージョンのコンパイルなどを試みましたが、問題は解決しませんでした。 現時点では、(sdk managerから)以下をインストールしています。 android api:19と23 SDKプラットフォームツール:25.​​0.1 SDKツール:25.​​2.3 ビルドツール:23.0.2および25.0.1 サポートリポジトリ:40 googleリポジトリ:39 他のいくつかは、ここにリストする必要はありません。 アプリの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 …

12
Androidスタジオはメモリを大量に消費します
Android Studio 1.0 RC 2をインストールしました。4GBのRAMをインストールしましたが、Android Studioを起動してAndroid Emulatorを起動した後、物理メモリの90%以上がこれら2つだけで使用されています。このメモリ使用量を減らす方法はありますか?このメモリの問題により、他のアプリケーションを同時に開くことができません。

7
Android Studio 2.0での即時実行(オフにする方法)
Android Studio 2.0プレビューでInstant Runを無効にする方法。設定に移動すると、次のように表示されます。 「インスタント実行を有効にする...」からティックを削除できません 私はAndroid Studio 2.0 Preview 9を使用していますが、このエラーはAndroid Studio 2.0 Preview 7にも存在していました。

22
Android Studio内でLogCatウィンドウを復元する
最近、Android Studio v0.1.1を使い始めましたが、LogCatが見つからないようです...なくなりましたか?そうでない場合は、どうすれば有効にできますか? それがなくなった場合、アプリの動作をログに記録する(そして主にクラッシュする)ように何かを有効にする方法はありますか?

弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.