「UnsupportedOperationException: isDirectory is not implemented: isDirectory is not implemented」といってファイルを作成させない AndroidStudio 0.5.1

テストコードなど新規につくろうとしたら!

UnsupportedOperationException: isDirectory is not implemented: isDirectory is not implemented

なんなんすか、これは。

これのようです。

Issue 66818 - android - Error After upgrade to 0.5.0: UnsupportedOperationException while creating new file - Android Open Source Project - Issue Tracker - Google Project Hosting

結局、今できる解決法としては、

This is a bug in IntelliJ which was merged into the subsequent EAP build. It'll be available in AS 0.5.2.

Until then, the workaround is to copy over an existing file.

https://android-review.googlesource.com/#/c/85464/

以下から「コピーして上書きしろ」ということです。

Change I7557101c: Fix for IDEA-121307 Cannot create new file (StubVirtualFile throws an exception on isDirectory) | android-review.googlesource Code Review

Change_I7557101c__Fix_for_IDEA-121307_Cannot_create_new_file__StubVirtualFile_throws_an_exception_on_isDirectory____android-review_googlesource_Code_Review

えええ、どうしたらいいのー?

。。。

と思っていたらプラグイン形式で配布してる人いました。

続きを読む >>


ADT 22.6.0 となり Java7 で AndroidStudio をば。

こう書いてあるけど。

ADT 22.6.0 (March 2014)
・・・
Added support for Java 7 language features like multi-catch, try-with-resources, and the diamond operator. These features require version 19 or higher of the Build Tools. Try-with-resources requires minSdkVersion 19; the rest of the new language features require minSdkVersion 8 or higher.
・・・

ADT Plugin | Android Developers

以下のような状態だと。

o multi-catch
x try-with-resources
o diamond operator
o strings in switches

try-with-resource(リソース付きtry/勝手にclose) のみAPI19以降。

try (FileInputStream input = new FileInputStream("file.txt")) {
  int data = input.read();
  while(data != -1){
    System.out.print((char) data);
    data = input.read();
  }
}

なので、もうあげちゃいます Java6 から java7 へ。

続きを読む >>


AndroidStudio 0.5.1 リリース版ビルドで「Lint found fatal errors while assembling a release target.」

リリース版をビルドしていたら
こんなのでました。

Error:Gradle: Execution failed for task ':sample:lintVitalRelease'.
> Lint found fatal errors while assembling a release target.

gradle

。。。

lint に対してコードを修正していくのもアレなので以下を build.gradle に。

android {
  lintOptions {
    checkReleaseBuilds false
    abortOnError false
}

エラーメッセージの言う通りにすれば通るのだけれども、
なんだかな。

しかし、lint っていつもこんなかんじな扱いを受けてるよねー。


サンプル付きのAPIリファレンス「APIMiner」で開発時間を短縮すべし

フツー、公式APIリファレンスで ListView を見るとこんなです。

ListView___Android_Developers

ListView___Android_Developers 2

ListView | Android Developers

で、クラス名やメソッド名や説明文に含まれる単語を元にぐぐったりしながらサンプルコードを見つけたりします。

それってめんどくさかったりします。

こんなリファレンスがあったりします。

ListView_-_Android_SDK___Android_Developers

「Example」ボタンをクリックするとサンプルが続々と表示されます。

ListView_-_Android_SDK___Android_Developers 2

続きを読む >>


端末画面をテレビにミラーリングできる「Mirror」が「super beta」となり Chromecast へ解禁

Chromecast へミラーリング可能となっております。昨日付です。

Mirror_-_Google_Play_の_Android_アプリ

Koush Updates Mirror With 'Super Beta' Support For Chromecast Screen Mirroring, Currently For Rooted Nexus 5 Only

rooted な Nexus5 のみという限定のようですが、音声も綺麗にテレビにミラーリングされます。

まだ、いろいろ不具合はあるようですが、「限定されたアプリ」だけでなく、端末画面がそのままテレビに写しだされるので、いろいろなシーンでの利用が期待できます。

利用したい人は、まず、Google+ コミュニテイ登録から。

Koushik Dutta - Google+ - Mirror for Android (beta) Screencast your Android! Mirror…

Mirror - Google Play の Android アプリ