Gradle build failed with new import rules - android-studio

I met an error after I updated android studio to version 3.6. When I tried to import Scenceform asset, it shows a warning in the picture below, whatever I click, it will return
java.lang.RuntimeException: java.lang.NoSuchMethodError: com.android.tools.idea.templates.recipe.RecipeExecutor.append(Ljava/io/File;Ljava/io/File;)
How can I fix this?

-- Update June 2020 --
Sceneform 1.15 has been replaced by the open source Sceneform 1.16. This appears to have also changed the model build approach, no longer using the SceneForm plugin and .sfa/.sfb workflow and instead including direct support for .gltf format model.
More information is available on the GitHub page, although the respoitory has now been archived which makes it hard to understand the future direction for Sceneform at this time (June 2020):
(https://github.com/google-ar/sceneform-android-sdk)
-- Workaround to the original problem if you are using Sceneform 1.15 --
To workaround the issue is you are using the Sceneform Plugin - see below:
This appears to be an issue with Android Studio 3.6 at the time of writing - see the issue here:
https://github.com/google-ar/sceneform-android-sdk/issues/912
One workaround appears to be to revert to Android Studio 3.5.
Alternatively adding the asset manually appears to work - taking the example in the online documentation for ARCore (https://developers.google.com/ar/develop/java/sceneform):
Follow these steps to import a new 3D asset:
Verify that your project's app folder contains a sampledata folder.
To create the folder, right-click on the app folder in the Project window, then select New > Sample Data Directory.
The sampledata folder is part of your Android Studio project, but its contents will not be included in your APK.
Copy your 3D model source asset file (*.obj, *.fbx, or .gltf), and all of its dependencies (.mtl, *.bin, *.png, *.jpg, etc.) into the sampledata folder.
Do not copy these source files into your project's assets or res folder, as this will cause them to be included in your APK unnecessarily.
Now instead of right clicking and using import, as the instructions at the link above go on to say, add the following lines to the bottom of your build.gradle(app) file manually:
apply plugin: 'com.google.ar.sceneform.plugin'
sceneform.asset('sampledata/andy.obj', // 'Source Asset Path' specified during import.
'default', // 'Material Path' specified during import.
'sampledata/andy.sfa', // '.sfa Output Path' specified during import.
'src/main/res/raw/andy') // '.sfb Output Path' specified during import.
Rebuild your project and the renderable should be imported correctly - check that andy.sfb has appeared in the 'res/raw' folder to be sure.

#harsha make sure the .obj file is referring to the right material.
mtllib chroma_key_video.mtl
g default
v -0.000000 2.244259 0.431967
v ...

Related

unable to find main.dart and lib folder from imported flutter project

hi there!
i backed up my flutter project folder due to some issues with my drive,
i fixed the issues
only for me to try importing the project and continuing my work
and it turns out i can't find my main.dart file along with my entire lib folder
the only recognizable thing left in the project seems to be the assets folder
help me, please
this has really pushed me way behind schedule
also I would be much grateful if i could get an app that decompiles flutter apks
as my code is still in debug mode and i have the apk file.
thanks
enter image description here
To get source code of your apk file(debug) :-
Step 1- download strings for Windows (in your case)
https://learn.microsoft.com/en-us/sysinternals/downloads/strings
Step 2-
Since kernel_blob.bin has all your app's source code,
Run this command,
strings /path/to/extracted/apk/assets/flutter_assets/kernel_blob.bin > extracted_code.dart
Here, replace, "path to extracted" to your own path.
Step 3
You’ll need to clean the extract_code file, and strings like “dart”, “import”, “void” and other keywords in ‘extracted_code.dart’, will help you find the code itself.(search for them to get your code)

Package name contains unexpecting level com.tmp

My Android Studio application called calendar contains package spectorsky, and it works. However, when I try to save the settings by
SharedPreferences calendarSettings;
calendarSettings = getSharedPreferences("calendarINI", Context.MODE_PRIVATE);
calendarSettings.edit().putLong("TimeZone",Double.doubleToLongBits(Riseset.timezone));
and then seek saved xml via Device File Explorer, I see my package on the strange level `com.tmp.spectorsky.calendar', see printscreen:
My file system on the hard disk does not contain tmp directory anywhere concerning this application. I see that the package names on other examples contain com level (somewhat like com.package.app), but no tmp domain is observed.
So, the question: why tmp level appears in my package name, and can (and should) I get rid it?
Level com.tmp was written it two places: in the manifest file AndroidManifest.xml and in the gradle (right-click on the app in project view, Open Module Settings, ApplicationID). Then, after cleaning the project, wrong com.tmp.... directory can be deleted from the Device File Explorer.

Error: Failed to resolve: com.badlogicgames.gdx:gdx-backend-lwjgl:1.6.5

I used gdx-setup.jar to generate a gradle project and then imported it inside Android Studio. But when I try to compile it, I get this error.
I checked the "desktop" + "Android" option while generating and use Android API 20. When I navigated inside the project, I found that in the DesktopLauncher.java class LwjglApplicationConfiguration appears red. The import statements
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
are both marked with errors. "lwjgl" is red and upon hovering over shows "Couldn't resolve symbol 'lwjgl' in blah blah"
Whats wrong?
This happened to me after updating. However, all I did was click build, then rebuild project, wait for it to rebuild and then for gradle to sync. After that everything should be fine.
Its fixed.
For some strange reason, the gdx-setup.jar file was not downloading lwjgl jar files into the .gradle folder in C:\Users\. Not sure why this was happening, maybe a bug. I went to Advanced settings and checked "IDEA" and then clicked generate. This time it downloaded a whole load of jar files. After it finished, I regenerated again by unchecking "IDEA" so that I would get a Gradle based build.
Finally it works. Maybe there's a bug in gdx-setup.jar

Visual studio export template replaces original projectname with $safeprojectname$

My project is a mvc4 project in visual studio 2013 ultimate.
I tryd to send my project by following the steps :
File > Export template > (leave all the options as default)
I get a zip that i unpack. If i open the unpacked solution and run the program i get alot of errors. It looks like visual studio replaced all the text that contained the projectname with $safeprojectname$. How can i export the project without visual studio replacing all the 'projectname' spots so that i can run my program.
I tryed creating a new project (console application) with no code in it, if i export it and import it i get the same message first i get :
Warning 1 Load of property 'RootNamespace' failed. The string for the root namespace must be a valid identifier. SvenEind
and after running i get
190 errors 31 warnings
I tryd importing http://www.asp.net/mvc/tutorials/getting-started-with-ef-5-using-mvc-4/building-the-ef5-mvc4-chapter-downloads and that worked for me.
So i guess the problem is in some kind of settings for exporting files.
replaced all the text that contained the projectname with $safeprojectname$
This is very much by design. You created a project template, a cookie-cutter for new projects. You are not supposed to do anything with the .zip archive. It should sit patiently in your "My Exported Templates" folder. Until the day arrives that you want to start a new project.
You then can pick the template instead of using one of the built-in ones that were preinstalled by the Visual Studio installer. Visual Studio prompts you for the project name. It then unzips the archive, copying the files into your new project directory. And modifies the files, $safeprojectname$ is substituted by the new project name you entered. You now have a good start for your new project, using the settings and assets that you saved earlier when you created the template.
Sounds like you had an entirely different use in mind, I can't guess at the intention from the question.
Hmmm. I got this error on Build:
The app manifest must be valid as per schema: Line 42, Column 18, Reason: '$safeprojectname$' violates pattern constraint of '([A-Za-z][A-Za-z0-9]*)(\.[A-Za-z][A-Za-z0-9]*)*'. The attribute 'Id' with value '$safeprojectname$' failed to parse.
So I grabbed the project name from the VS Configuration Manger and put it in the app manifest like this.
<Applications>
<Application
Id="CordovaApp.Windows10"
And the error went away and the project built. HTH.

Build is producing a .momd in the bundle that is missing the .mom file

I have an app that has been running fine on the iPhone simulator for some time. Recently, I decided I wanted to re-use the data model and related classes in another project - so I dragged them from this project window to the other then told Xcode not to copy, just to make references. At first this didn't work so I jumped through a number of hoops to try to fix it (I may be asking more about that in another post). After all this, I re-compiled and tried to run the original app -- and it's not working any more. On further investigation, I discovered that when I re-compile the original app, I end up with a bundle that contains a .momd package but it contains only a Versioninfo.plist file - no .mom file, no .omo file like I'm expecting to see. I don't recall making any changes to the original app. I don't get any warnings. I just get an incomplete .momd package (and, not surprisingly, my app now crashes).
What's going on here?
BTW, the app now crashes with this message:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
Which I get when executing this line of code:
self.productRegistry = [[UIManagedDocument alloc] initWithFileURL:self.productRegistryURL];
I figured this out by looking more closely at the file locations in the project directory using Finder. In the Xcode window, everything looks normal but in the actual project directory I found that the .datamodeld package had ended up at the top level of the project directory -- at the same level as the project package itself. Xcode apparently did not like this but unfortunately it did not complain -- it just created a partial build output. Once I moved the .datamodeld package into the same folder as the rest of the project's code, everything worked just fine.
This would appear to be just a quirk. I would expect that Xcode would either see that all is well and build correctly OR it would see that things weren't quite as they should be and fail. In this case, it did not build correctly but was silent about it.
Hope this answer helps someone else someday.

Resources