How do I update Apportable build targets? - apportable

When first run Apportable generates a bunch of stuff, in ProjectName.approj/, which includes some stuff generated from the Xcode project targets.
I have changed my Xcode project's bundle identifier (I need the generated APK to have a certain package name, and that seems to come from the bundle identifier) but the Apportable generated builds still have the old package name. I think this is related to the build targets stuff it generates.
How do I update this?

Adding --generate to the apportable command will cause the xcode project to be reparsed.

Related

Android Studio: This file not part of the project, but the project builds successfully

I have a strange problem that suddenly appeared in android studio. I created a new cpp file, and included it in Android.mk. Then I synced the project. However, android studio still complains that the file is not part of the project and that I need to sync, BUT the whole project builds successfully.
Likewise, if I remove one of the other older files from Android.mk that it did not complain about, and resyncs and then tries to build the project, as expected the build fails, but android studio does NOT complain that that file is not part of the project anymore.
So somehow, suddenly the android studio editor is not able to correctly identify which files have been synced and are part of the project, but during compilation everything works as expected.
Does anyone know how to fix this annoying problem? I have tried clean project, invalidate caches/restart as well as updating android studio without luck (AS version 3.4).
I used Build > Refresh Linked C++ Projects menu and it worked.
I had a similar problem. Like yourself, I have tried everything.
Invalidate and Restart: Doesn't work
Manual deleting folders: .gradle .idea .ndkbuild etc. doesn't work
Clean, Rebuild, Link C++ Files: Doesn't work
One thing that kind of helped me was: I changed the NDK version. I compiled, then got a compilation error (didn't matter because it was the wrong version of NDK anyway), then I reverted to the original NDK. This appeared to solve the problem, however, it got back again.
My solution was to reset Android Studio to factory settings. If you are on Linux, you can start by deleting these folders:
rm -rf ~/.android
rm -rf ~/.AndroidStudio3.4
Then you download and run your Android Studio and not import anything from anywhere.
I suspect the problem was caused by one of the plugins I've installed.
It may be a good idea to backup those two folders from time to time and reload them from there if necessary.
EDIT: It seems that my problem persisted after the above solution after adding more .cpp files. After seeing that, I searched where that popup came from. It follows that "This file is not part of project..." popup is pushed from ndk-build. (Class name: NewCppSourceNotificationProvider - StaleCppProjectNotificationPanel). What I tried, and what worked so far; I used Android Studio 3.5 Canary13 with NDK version r19c (Stable version). I hope this helps you.
Problem Environment
Android Studio 3.5 RC 2
gradle-4.10-all
com.android.tools.build:gradle:3.2.1
Solution
Update to:
- gradle-5.5.1-all
- com.android.tools.build:gradle:3.4.2
Steps
From the project root run (note this has to be done first):
./gradlew wrapper --gradle-version 5.5.1 --distribution-type all
In root build.gradle file:
buildscript {
//...
dependencies {
classpath("com.android.tools.build:gradle:3.4.2")
//...
}
}
I have similar problem, it could be the compatibility issue of gradle version and gradle plugin version, because my solution is replacing the old configuration
// build.gradle
classpath 'com.android.tools.build:gradle:3.2.1'
...
// gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
with the following new one by changing gradle version from 4.6 to 4.10.1.
// build.gradle
classpath 'com.android.tools.build:gradle:3.2.1'
...
// gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
After that, Android studio can index and track my new cpp files in project.
fix this by update my 'com.android.tools.build:gradle'
Had the same problem with Android Studio 4.0.1 and the latest gradle at this time (6.1.1?). The problem went away after I exited Android Studio and deleted .gradle and .idea folders in the project main directory, plus deleted .cxx and build directories in the affected module directory. I'm not sure which really helped, but most probably deleting .grade and/or .idea
I fixed with update 'com.android.tools.build:gradle' in the artic fox version 2020.3.1
For those struggling with this for me I made a small change to CMakeLists.txt (I altered the version required). This forced the CMake to regenerate, and all missing files were added. This is quicker than the other options listed here.
This applied to NDK 21, so YMMV!
Invalidate cache and restart and you should be good. However, make sure you checked the Clear file system cache and local history checkbox.

Error:This project does not use the Gradle build system, even though it was build in gradle system before

My project was build initally with bradle build system in android studio after I switching branches in git I got the following error.
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
When i try exetuting gradle task I get error :
Error:Android Source Generator: [project-name] AndroidManifest.xml file not found , Even though I have the file in proper place.
I have been trying to fix this from several days. I have tried re-importing the project, clone the project again. Any help is gladly welcome.
Thanks,

Android Studio 1.2: Error:Android Source Generator: [app] AndroidManifest.xml file not found

I updated to AS 1.2 and I just tried importing/opening one my previous projects that worked on the previous version of AS. However, when I try building the project, I get an error saying
Error:Android Source Generator: [app] AndroidManifest.xml file not found
but this doesnt make sense since my manifest is src/main folder. How can I fix this and avoid this problem for all of my other projects?
This also bothered me recently, and I'm guessing that Gradle wasn't building it right.
In my circumstance, I just hit the Sync Project with Gradle Files button at left of AVD Manager button. If possible, you can goes with Gradle command lines as well.
then it popped out some errors said that I failed to find Build Tools revision 21.0.2(also this had been installed again and again, assuming I didn't set it right).
After installed some SDKs, clicked finish, studio will automatically rebuild your project.
There it works, can run the project now.

When exactly is .gradle folder created in the home directory in Linux?

Okay so when exactly does gradle begin downloading dependencies? And when exactly is .gradle folder created in the home directory.
Gradle downloads dependencies just-in-time when they are first used. ~/.gradle is used for many purposes, and may be created as soon as Gradle is first started.
When talking about dependencies in gradle, you can categorize them into 2 categories :
build script dependencies : the gradle-plugins required by your script (for instance the android-gradle-plugin when you are building an android project). Those dependencies are downloaded at the very first stage of the gradle process.
project dependencies : downloaded when they are required. (i.e. if you are building only part of your project: it is possible that some dependencies not required for this part aren't downloaded)
There is a third kind of download : when you use the gradle-wrapper : gradle it-self can be downloaded by the wrapper-script (and of course it is the very first download.)
Regarding the ~/.gradle : it is the GRADLE_USER_HOME (by default USER_HOME/.gradle) : it can be redefined in multiple ways (see here) and it is used as soon as a gradle process is started.
EDIT
A gradle process is started as soon as you run a command starting with gradle <with args> in a directory where a build.gradle exists (note that if you use the wrapper : the command is gradlew <with args>) .
When using an IDE (like Android Studio or IntelliJ) : the IDE can start a gradle process for you. In Android-Studio (or IntelliJ) : there is a view named Gradle Console where you can see logs issued by any gradle process started by the IDE.
when we start the gradle it create the .gradle folder inside your home directory. It consist of native (information about your system) and caches. Caches further consist of plugins and all other jars dependencies.
When we build the project first time at that time it download dependencies and plugins and cheched them here. next time when we need them it, it get from here. even when we need them in eclipse to compile the code (=>gradle eclipse), its dependencies are added from cache

Phonegap 3.4.0 fails to build new projects and update old projects

I recently updated phonegap, node, and npm. I have an existing project I previously built with Phonegap version 3.3.0. I then attempted to update my existing project using phonegap platform update ios and received an error stating that the '/platforms' directory does not exist.
I don't think it makes any difference, but I also tried to use the cordova command instead of the phonegap command, but I just get the same error as above. I even created a completely new project with phonegap create Test and I am able to get a project built successfully, but when I try to run/build I get a similar error: Error: /platforms does not exist. Please specify an existing parent folder. [error] /Users/mftcmbp1/.cordova/lib/ios/cordova/3.4.0/bin/create: Command failed with exit code 1 Even stranger, I am able to successfully create a project with the cordova command, build ios and android platforms, and emulate the project, yet I can't do this with the phonegap command like I could before I updated.Any help or suggestions of why this would be occurring will be helpful.
Thanks!
Not sure if there is a bug with Phonegap 3.4.0, but I fixed my issue by uninstalling the latest Phonegap version and installing Phonegap version 3.3.0-0.19.4.
1- you need to 'cd' to your project and add platform first before build
cd Test
2- then add platform
iOS
phonegap platform add ios
android
phonegap platform add android
3- then you can build your project
iOS
phonegap build ios
android
phonegap build android
I ran into this over the weekend, have you tried:
$ mkdir project_directory/platforms
As I remember it, that solved the issue as a hotfix.
The error occured after a project was cloned from github without the platforms directory.
I ran into the same issue, and it looks like an error in the update script, and specifically this file:
node_modules/phonegap/node_modules/cordova/src/util.js
The quick fix is, in the function isRootDir, to change "config.xml" to ".cordova", i.e.:
- if (fs.existsSync(path.join(dir, 'config.xml'))) {
+ if (fs.existsSync(path.join(dir, '.cordova'))) {
The old version identified the base project directory via the existence of the .cordova directory. The new version is incorrectly looking for a directory that contains these three items:
www/
config.xml
platforms/
config.xml should not be in the base directory, it's under www/, which is why it fails.
The script does have fail-safe, which is to look for www/config.xml. However, the way it does this is to continue traversing the tree towards root, and if at any time it finds another www/config.xml, will assume this is a better candidate for the project directory.
In your situation, I'm guessing you have a /www/config.xml off of your root directory, and PhoneGap is erroneously thinking that is your project directory.

Resources