Skip to content

Instantly share code, notes, and snippets.

Avatar
🌨️

Tomo Suzuki suztomo

🌨️
View GitHub Profile
@suztomo
suztomo / note.md
Created Oct 21, 2020
Gradle platform and enforcedPlatform note
View note.md

dependencies {
    constraints {
        implementation('com.google.guava:guava:29.0-jre')
    }
    def c = platform('com.google.cloud:libraries-bom:12.1.0')

    // This line lets me use 29.0-jre
@suztomo
suztomo / gist:2f3c98f89af2393bb2c91f5743aae194
Created Oct 14, 2020
Flutter Android build fails with checkDebugDuplicateClasses
View gist:2f3c98f89af2393bb2c91f5743aae194
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-26.0-android.jar (com.google.guava:guava:26.0-android) and listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)
Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
View gist:e62ae52b807927ed954fc8e60b5ea2c6
suztomo-macbookpro44% curl -vvv https://storage.googleapis.com/flutter
* Trying 172.217.11.48...
* TCP_NODELAY set
* Connected to storage.googleapis.com (172.217.11.48) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
@suztomo
suztomo / flutter_doctor.txt
Last active Oct 7, 2020
"flutter pub get" cannot resolve dependency of the latest "test" plugin 1.15.4
View flutter_doctor.txt
[✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.5 19F101, locale en-US)
• Flutter version 1.22.0 at /Users/suztomo/development/flutter
• Framework revision d408d302e2 (7 days ago), 2020-09-29 11:49:17 -0700
• Engine revision 5babba6c4d
• Dart version 2.10.0
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
@suztomo
suztomo / gist:c7b1562255a9fabb6772bd2c5b585a98
Last active Oct 5, 2020
Diff between libraries-bom 11.1.0 and PR#1693 (google-cloud-bom-0.139.0 branch)
View gist:c7b1562255a9fabb6772bd2c5b585a98
diff --git a/tmp/pom-11.1.0.xml b/tmp/pom-0.139.0.xml
index 10d85a60..670309aa 100644
--- a/tmp/pom-11.1.0.xml
+++ b/tmp/pom-0.139.0.xml
@@ -1,7 +1,7 @@
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< com.google.cloud:libraries-bom >-------------------
-[INFO] Building Google Cloud Platform Supported Libraries 11.1.0
+[INFO] Building Google Cloud Platform Supported Libraries 12.0.0-SNAPSHOT
@suztomo
suztomo / memo.md
Last active Sep 16, 2020
multianewarray throws IllegalAccessError
View memo.md

foo/B.java

package foo;

// We change this modifier to non-public.
public class B {

}
@suztomo
suztomo / memo.md
Last active Sep 16, 2020
instanceof throws a runtime exception
View memo.md

foo/A.java

package foo;

public class A {

  public static final A f = new B();
}
@suztomo
suztomo / memo.md
Created Sep 16, 2020
checkcast throws a runtime exception
View memo.md

foo/A.java

package foo;

public class A {

  public static final A f = new B();
}
@suztomo
suztomo / memo.md
Created Sep 16, 2020
javap output for array creation
View memo.md
package bar;

import foo.A;
import foo.B;

public class C {
  public static void main(String[] arguments) {
    B[] array = new B[3];
    //    B f = A.f;
@suztomo
suztomo / memo.md
Last active Sep 16, 2020
Class reference causing a runtime error
View memo.md

Class Literal Causing a IllegalAccessError

Class C

package bar;

import foo.D;

public class C {
You can’t perform that action at this time.