[Android] Compiler don't compile the AppActivity file. Why?

[Android] Compiler don't compile the AppActivity file. Why?
0

There is no class like NoExtistanceClass. Android Studio must tell me that AppActivity has a compile error because there is no such class.
Android Studio told me that everything was ok and installed on android phone was successful.
So Android Studio don’t compile AppActivity.java class. How can I force to compile this class?

My system is OSX with Android Studio and cocos2dx v4 c++.


public void someFunc() {
      NoExtistanceClass my; 

    }

}

We can ask @coulsonwang to take a look.

I commented java.srcDir “src”

sourceSets.main {
        //java.srcDir "src"
       res.srcDir "res"
        manifest.srcFile "AndroidManifest.xml"
        assets.srcDir "../../Resources"
}

I added

sourceSets {
    main.java.srcDirs += 'src/org'
}

My java files are in src/org/cocos2dx/cpp folder.
Then I invalidated Android Studio caches, clean the project and it fixed my bug.

Solution: I must clean a project. It is not working without cleaning of project.
Actually my problem was that I didn’t clean a project. java.srcDir “src” is also working.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.