質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Kotlin

Kotlinは、ジェットブレインズ社のアンドリー・ブレスラフ、ドミトリー・ジェメロフが開発した、 静的型付けのオブジェクト指向プログラミング言語です。

Q&A

解決済

1回答

2270閲覧

androidstudioで実行時にエラーが起きる

ryu-sei

総合スコア12

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Kotlin

Kotlinは、ジェットブレインズ社のアンドリー・ブレスラフ、ドミトリー・ジェメロフが開発した、 静的型付けのオブジェクト指向プログラミング言語です。

0グッド

0クリップ

投稿2021/05/08 03:00

前提・実現したいこと

先週まで使えていたプロジェクトなのですが今日ビルドしようとしたら下のようなエラーが出てしまいました。調べていくつか解決法を試してみたのですが改善されなかったので、解決法を教えていただければと思います。

発生している問題・エラーメッセージ

A problem occurred configuring root project 'chart'. > Could not resolve all dependencies for configuration ':classpath'. > java.lang.NullPointerException (no error message)

該当のソースコード

kotlin

1//build.gradle(:app) 2plugins { 3 id 'com.android.application' 4 id 'kotlin-android' 5} 6 7android { 8 compileSdkVersion 30 9 buildToolsVersion "30.0.2" 10 11 defaultConfig { 12 applicationId "com.example.chart" 13 minSdkVersion 30 14 targetSdkVersion 30 15 versionCode 1 16 versionName "1.0" 17 18 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 19 } 20 21 buildTypes { 22 release { 23 minifyEnabled false 24 proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 25 } 26 } 27 compileOptions { 28 sourceCompatibility JavaVersion.VERSION_1_8 29 targetCompatibility JavaVersion.VERSION_1_8 30 } 31 kotlinOptions { 32 jvmTarget = '1.8' 33 } 34 repositories{ 35 maven {url "https://jitpack.io"} 36 } 37 apply plugin: 'com.android.application' 38 apply plugin: 'kotlin-android' 39} 40 41dependencies { 42 43 implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 44 implementation 'com.github.PhilJay:MpAndroidChart:v3.0.2' 45 implementation 'androidx.core:core-ktx:1.3.2' 46 implementation 'androidx.appcompat:appcompat:1.2.0' 47 implementation 'com.google.android.material:material:1.3.0' 48 implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 49 testImplementation 'junit:junit:4.+' 50 androidTestImplementation 'androidx.test.ext:junit:1.1.2' 51 androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' 52}

kotlin

1//build.gradle(プロジェクト名) 2// Top-level build file where you can add configuration options common to all sub-projects/modules. 3buildscript { 4 ext.kotlin_version = "1.4.32" 5 repositories { 6 google() 7 jcenter() 8 } 9 dependencies { 10 classpath "com.android.tools.build:gradle:4.1.1" 11 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 12 13 // NOTE: Do not place your application dependencies here; they belong 14 // in the individual module build.gradle files 15 } 16} 17 18allprojects { 19 repositories { 20 google() 21 jcenter() 22 } 23} 24 25task clean(type: Delete) { 26 delete rootProject.buildDir 27}

試したこと

classpathの番号を下げる、Sdkバージョンの値を上げる、buildscriptのrepositories内のgoogle()を消してみるなどの解決法はとりました。この1週間以内に更新はしていません。

補足情報(FW/ツールのバージョンなど)

API30:Android 11.0(R)

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

AndroidStudioをアップデートしたら解決しました。
お騒がせいたしました。

投稿2021/05/08 03:38

ryu-sei

総合スコア12

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問