18

I am REALLY new to Android Studio and I was moving to fast and removed something from my code...now I keep getting an error message & my gradle sync fails.

I see the following in the log:

2016-06-01 05:39:55,358 [32778590]   WARN - radle.project.ProjectSetUpTask -  
2016-06-01 05:39:55,358 [32778590]   INFO - radle.project.ProjectSetUpTask - No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi

Consult IDE log for more details (Help | Show Log) 
2016-06-01 05:39:55,360 [32778592]   INFO - ls.idea.gradle.GradleSyncState - Sync with Gradle for project 'Jumping-Jinn' failed: No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi

Consult IDE log for more details (Help | Show Log) 
2016-06-01 05:39:56,676 [32779908]   INFO -       #com.jetbrains.cidr.lang - Clearing symbols finished in 0 s. 
2016-06-01 05:39:56,677 [32779909]   INFO -       #com.jetbrains.cidr.lang - Loading symbols finished in 0 s. 
2016-06-01 05:39:56,678 [32779910]   INFO -       #com.jetbrains.cidr.lang - Building symbols finished in 0 s. 
2016-06-01 05:39:56,678 [32779910]   INFO -       #com.jetbrains.cidr.lang - Saving symbols finished in 0 s. 

My code basically says nothing: NOTE: AppCompatActivity is in red currently

import android.media.Image;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;

public class HomeScreen extends AppCompatActivity {

    ImageButton musicEnable_ImageButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home_screen);

        musicEnable_ImageButton = (ImageButton) findViewById(R.id.soundEnable_button);
        musicEnable_ImageButton.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                musicEnable_ImageButton.setBackgroundResource(R.drawable.musicon1);
            }
        });
    }
5
  • I've just started to get this error, out of the blue. I don't think it has anything to do with the code you've posted, given that mine is of course different. Did you manage to solve this? I'm searching for a solution now.
    – brandall
    Jun 3, 2016 at 8:08
  • 1
    @brandall after searching a while I finally found a solution: Go to Tools>Android>SDK Manager then, on the SDK Tools view, uncheck Android NDK & click Apply (confirm the selection). This will uninstall your NDK, then simply check it and hit apply & it will reinstall (it takes forever). When it finally finishes try to build & run your app again and it should work. Jun 3, 2016 at 10:14
  • Try the following method: stackoverflow.com/a/54019946/7831470
    – Sagar Giri
    Jan 3, 2019 at 10:08
  • I know it's not an ideal solution, but I cloned my repository and the error disappeared. I tried deleting the ndk folder but it did not work for me. Jan 21, 2022 at 16:17

5 Answers 5

6

The solution for me was the following:

  1. Open project in Android Studio
  2. Wait for sync to finish
  3. Click on File -> Project structure -> SDK Location
  4. At Android NDK Location, if you don't have any NDK, install one
  5. Select an existing NDK location.

That should fix it.

5

Just add this line to your local.properties in android folder: ndk.dir=/Users/apatrck03/Library/Android/sdk/ndk/23.0.7123448

whatever your ndk version is (-:

1
  • 1
    Worked for me. Thanks!
    – makata
    Mar 17, 2021 at 21:42
1

Installing an older NDK version (20.. or lower) from android studio seems to solve the problem. Higher versions don't solve the issue.

1

Go to your Android Folder and add your ndk like this ->

ndk.dir={Android Folder location}/Sdk/ndk/{Your ndk version}

last view like this->

ndk.dir=/home/picoder/Android/Sdk/ndk/21.3.6528147

To check NDK version

enter image description here

0

Add this line to your local.properties

ndk.dir=C\:\\Users\\[userName]\\AppData\\Local\\Android\\Sdk\\ndk\\20.1.5948944

Try to use the NDK version below 21 as mentioned in the above line, I hope it will solve your problem.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.